get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1213104/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1213104,
    "url": "http://patchwork.ozlabs.org/api/patches/1213104/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/c95eb856c8e05a196551179c2416455c022eb3ea.1576745635.git.matti.vaittinen@fi.rohmeurope.com/",
    "project": {
        "id": 42,
        "url": "http://patchwork.ozlabs.org/api/projects/42/?format=api",
        "name": "Linux GPIO development",
        "link_name": "linux-gpio",
        "list_id": "linux-gpio.vger.kernel.org",
        "list_email": "linux-gpio@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<c95eb856c8e05a196551179c2416455c022eb3ea.1576745635.git.matti.vaittinen@fi.rohmeurope.com>",
    "list_archive_url": null,
    "date": "2019-12-19T09:54:44",
    "name": "[v7,12/12] led: bd71828: Support LED outputs on ROHM BD71828 PMIC",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "3aa5211267377cdcfde24af89f90cd57a79a7eb1",
    "submitter": {
        "id": 74146,
        "url": "http://patchwork.ozlabs.org/api/people/74146/?format=api",
        "name": "Matti Vaittinen",
        "email": "matti.vaittinen@fi.rohmeurope.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/c95eb856c8e05a196551179c2416455c022eb3ea.1576745635.git.matti.vaittinen@fi.rohmeurope.com/mbox/",
    "series": [
        {
            "id": 149534,
            "url": "http://patchwork.ozlabs.org/api/series/149534/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=149534",
            "date": "2019-12-19T09:44:08",
            "name": "Support ROHM BD71828 PMIC",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/149534/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1213104/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1213104/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-gpio-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (no SPF record)\n\tsmtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67;\n\thelo=vger.kernel.org;\n\tenvelope-from=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=fi.rohmeurope.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 47dnKr3vjGz9sPc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 19 Dec 2019 20:54:56 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1726786AbfLSJyz (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tThu, 19 Dec 2019 04:54:55 -0500",
            "from mail-lj1-f194.google.com ([209.85.208.194]:34888 \"EHLO\n\tmail-lj1-f194.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1726599AbfLSJyz (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Thu, 19 Dec 2019 04:54:55 -0500",
            "by mail-lj1-f194.google.com with SMTP id j6so5525584lja.2;\n\tThu, 19 Dec 2019 01:54:52 -0800 (PST)",
            "from localhost.localdomain\n\t(dyt4gctb359myxd0pkwmt-4.rev.dnainternet.fi.\n\t[2001:14bb:430:5140:37cf:5409:8fcc:4495])\n\tby smtp.gmail.com with ESMTPSA id\n\ti17sm728068ljd.34.2019.12.19.01.54.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Dec 2019 01:54:51 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=8nG82QgNA/iA8xDzN8GA+mmnvkdU+1Uef25gTrE9HvI=;\n\tb=sjjwQ5PeVOqlt4bnS1yOHEYUzZp+PdBpbQ2Hq9c7SQRHnp0pZEYDlMrZhfJjN/PTtW\n\tF3zqHrry5B7xjwhfs+cC97gipCATk9sFzGCGBtM9mDC4KXQwYpaH9AENP8B2A/5Jmhs+\n\tVEkgh4hYsLb1aNtc3E6vmT1eFsGmK4fhXwLZREdlbWGXztxvplH1tYbm+7/EWvAYnvpR\n\tdu2Mpv0SVUd2rV3Dv6ZVvCsNR2smT8sy/CU/xIwJBXeB6J0SXTJsUg/VD4mpxd9AHuzq\n\tAfEzell57oarQCjUTHpu5ZdgWfghv7B0Sv8Vkv0KFtAgkzNO52NhjHvf5ug/KAkB+/YZ\n\tZXng==",
        "X-Gm-Message-State": "APjAAAXVzs0CMwxZgPdDR0VDbyEtIMhAIqnPqWMAVxdYMA8lxnFpjah4\n\tMKu5STqUG8AEA6mAFCmbL68=",
        "X-Google-Smtp-Source": "APXvYqwHQC+n6W9UYRnAO1Cnt7jKqNA3I9ZhYJIpamdmycW4OX7fhuXEjuF4VS2jiinJ6RfCshrzPQ==",
        "X-Received": "by 2002:a2e:9a01:: with SMTP id o1mr5057447lji.247.1576749291661;\n\tThu, 19 Dec 2019 01:54:51 -0800 (PST)",
        "Date": "Thu, 19 Dec 2019 11:54:44 +0200",
        "From": "Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>",
        "To": "matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com",
        "Cc": "Jacek Anaszewski <jacek.anaszewski@gmail.com>,\n\tPavel Machek <pavel@ucw.cz>, Dan Murphy <dmurphy@ti.com>,\n\tRob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>,\n\tLee Jones <lee.jones@linaro.org>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@kernel.org>,\n\tLinus Walleij <linus.walleij@linaro.org>,\n\tBartosz Golaszewski <bgolaszewski@baylibre.com>,\n\tLiam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,\n\tAlessandro Zummo <a.zummo@towertech.it>,\n\tAlexandre Belloni <alexandre.belloni@bootlin.com>,\n\tlinux-leds@vger.kernel.org, devicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org",
        "Subject": "[PATCH v7 12/12] led: bd71828: Support LED outputs on ROHM BD71828\n\tPMIC",
        "Message-ID": "<c95eb856c8e05a196551179c2416455c022eb3ea.1576745635.git.matti.vaittinen@fi.rohmeurope.com>",
        "References": "<cover.1576745635.git.matti.vaittinen@fi.rohmeurope.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "In-Reply-To": "<cover.1576745635.git.matti.vaittinen@fi.rohmeurope.com>",
        "User-Agent": "Mutt/1.12.1 (2019-06-15)",
        "Sender": "linux-gpio-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-gpio.vger.kernel.org>",
        "X-Mailing-List": "linux-gpio@vger.kernel.org"
    },
    "content": "ROHM BD71828 power management IC has two LED outputs for charge status\nand button pressing indications. The LED outputs can also be forced\nby SW so add driver allowing to use these LEDs for other indications\nas well.\n\nLeds are controlled by SW using 'Force ON' bits. Please note the\nconstrains mentioned in data-sheet:\n    1. If one LED is forced ON - then also the other LED is forced.\n            => You can't use SW control to force ON one LED and allow HW\n               to control the other.\n    2. You can't force both LEDs OFF. If the FORCE bit for both LED's is\n       zero, then LEDs are controlled by HW and indicate button/charger\n       states as explained in data-sheet.\n\nSigned-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>\n---\n\nNo changes since v6\n\n drivers/leds/Kconfig        |  10 +++\n drivers/leds/Makefile       |   1 +\n drivers/leds/leds-bd71828.c | 118 ++++++++++++++++++++++++++++++++++++\n 3 files changed, 129 insertions(+)\n create mode 100644 drivers/leds/leds-bd71828.c",
    "diff": "diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig\nindex 4b68520ac251..db408e03e296 100644\n--- a/drivers/leds/Kconfig\n+++ b/drivers/leds/Kconfig\n@@ -545,6 +545,16 @@ config LEDS_BD2802\n \t  This option enables support for BD2802GU RGB LED driver chips\n \t  accessed via the I2C bus.\n \n+config LEDS_BD71828\n+\ttristate \"LED driver for LEDS on ROHM BD71828 PMIC\"\n+\tdepends on LEDS_CLASS\n+\tdepends on MFD_ROHM_BD71828\n+\thelp\n+\t  This option enables support for LED outputs located on ROHM\n+\t  BD71828 power management IC. ROHM BD71828 has two led output pins\n+\t  which can be left to indicate HW states or controlled by SW. Say\n+\t  yes here if you want to enable SW control for these LEDs.\n+\n config LEDS_INTEL_SS4200\n \ttristate \"LED driver for Intel NAS SS4200 series\"\n \tdepends on LEDS_CLASS\ndiff --git a/drivers/leds/Makefile b/drivers/leds/Makefile\nindex 2da39e896ce8..a5164acfaf51 100644\n--- a/drivers/leds/Makefile\n+++ b/drivers/leds/Makefile\n@@ -15,6 +15,7 @@ obj-$(CONFIG_LEDS_AN30259A)\t\t+= leds-an30259a.o\n obj-$(CONFIG_LEDS_BCM6328)\t\t+= leds-bcm6328.o\n obj-$(CONFIG_LEDS_BCM6358)\t\t+= leds-bcm6358.o\n obj-$(CONFIG_LEDS_BD2802)\t\t+= leds-bd2802.o\n+obj-$(CONFIG_LEDS_BD71828)\t\t+= leds-bd71828.o\n obj-$(CONFIG_LEDS_CPCAP)\t\t+= leds-cpcap.o\n obj-$(CONFIG_LEDS_LOCOMO)\t\t+= leds-locomo.o\n obj-$(CONFIG_LEDS_LM3530)\t\t+= leds-lm3530.o\ndiff --git a/drivers/leds/leds-bd71828.c b/drivers/leds/leds-bd71828.c\nnew file mode 100644\nindex 000000000000..a02c2ac4a70b\n--- /dev/null\n+++ b/drivers/leds/leds-bd71828.c\n@@ -0,0 +1,118 @@\n+// SPDX-License-Identifier: GPL-2.0-only\n+// Copyright (C) 2019 ROHM Semiconductors\n+\n+#include <linux/device.h>\n+#include <linux/err.h>\n+#include <linux/kernel.h>\n+#include <linux/leds.h>\n+#include <linux/mfd/rohm-bd71828.h>\n+#include <linux/module.h>\n+#include <linux/of.h>\n+#include <linux/platform_device.h>\n+#include <linux/regmap.h>\n+#include <linux/slab.h>\n+\n+#define BD71828_LED_TO_DATA(l) ((l)->id == ID_GREEN_LED ? \\\n+\tcontainer_of((l), struct bd71828_leds, green) : \\\n+\tcontainer_of((l), struct bd71828_leds, amber))\n+\n+/* Names for led identification - these match the data sheet names */\n+enum {\n+\tID_GREEN_LED,\n+\tID_AMBER_LED,\n+\tID_NMBR_OF,\n+};\n+\n+struct bd71828_led {\n+\tstruct led_init_data init_data;\n+\tint id;\n+\tstruct led_classdev l;\n+\tu8 force_mask;\n+};\n+\n+struct bd71828_leds {\n+\tstruct rohm_regmap_dev *bd71828;\n+\tstruct bd71828_led green;\n+\tstruct bd71828_led amber;\n+};\n+\n+static int bd71828_led_brightness_set(struct led_classdev *led_cdev,\n+\t\t\t\t      enum led_brightness value)\n+{\n+\tstruct bd71828_led *l = container_of(led_cdev, struct bd71828_led, l);\n+\tstruct bd71828_leds *data;\n+\tunsigned int val = BD71828_LED_OFF;\n+\n+\tdata = BD71828_LED_TO_DATA(l);\n+\tif (value != LED_OFF)\n+\t\tval = BD71828_LED_ON;\n+\n+\treturn regmap_update_bits(data->bd71828->regmap, BD71828_REG_LED_CTRL,\n+\t\t\t    l->force_mask, val);\n+}\n+\n+static int bd71828_led_probe(struct platform_device *pdev)\n+{\n+\tstruct rohm_regmap_dev *bd71828;\n+\tstruct bd71828_leds *l;\n+\tstruct bd71828_led *g, *a;\n+\tint ret;\n+\n+\tbd71828 = dev_get_drvdata(pdev->dev.parent);\n+\tl = devm_kzalloc(&pdev->dev, sizeof(*l), GFP_KERNEL);\n+\tif (!l)\n+\t\treturn -ENOMEM;\n+\tl->bd71828 = bd71828;\n+\ta = &l->amber;\n+\tg = &l->green;\n+\n+\t/* Fill in details for 'AMBLED' */\n+\ta->init_data.match_property.name = \"rohm,led-compatible\";\n+\ta->init_data.match_property.raw_val = \"bd71828-ambled\";\n+\ta->init_data.match_property.size = strlen(\"bd71828-ambled\");\n+\ta->id = ID_AMBER_LED;\n+\ta->force_mask = BD71828_MASK_LED_AMBER;\n+\n+\t/* Fill in details for 'GRNLED' */\n+\tg->init_data.match_property.name = \"rohm,led-compatible\";\n+\tg->init_data.match_property.raw_val = \"bd71828-grnled\";\n+\tg->init_data.match_property.size = strlen(\"bd71828-grnled\");\n+\tg->id = ID_GREEN_LED;\n+\tg->force_mask = BD71828_MASK_LED_GREEN;\n+\n+\ta->l.brightness_set_blocking = bd71828_led_brightness_set;\n+\tg->l.brightness_set_blocking = bd71828_led_brightness_set;\n+\n+\tret = devm_led_classdev_register_ext(&pdev->dev, &g->l, &g->init_data);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn devm_led_classdev_register_ext(&pdev->dev, &a->l, &a->init_data);\n+}\n+\n+/*\n+ * Device is instantiated through parent MFD device and device matching is done\n+ * through platform_device_id.\n+ *\n+ * However, the *module* matching will be done trough DT aliases. This requires\n+ * of_device_id table - but no .of_match_table as *device* matching is still\n+ * done through platform_device_id.\n+ */\n+static const struct of_device_id bd71828_dt_match[] __used = {\n+\t{ .compatible = \"rohm,bd71828-leds\" },\n+\t{ }\n+};\n+MODULE_DEVICE_TABLE(of, bd71828_dt_match);\n+\n+static struct platform_driver bd71828_led_driver = {\n+\t.driver = {\n+\t\t.name  = \"bd71828-led\",\n+\t},\n+\t.probe  = bd71828_led_probe,\n+};\n+\n+module_platform_driver(bd71828_led_driver);\n+\n+MODULE_AUTHOR(\"Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>\");\n+MODULE_DESCRIPTION(\"ROHM BD71828 LED driver\");\n+MODULE_LICENSE(\"GPL\");\n",
    "prefixes": [
        "v7",
        "12/12"
    ]
}