get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806331,
    "url": "http://patchwork.ozlabs.org/api/patches/806331/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openbmc/patch/20170828001711.19662-3-andrew@aj.id.au/",
    "project": {
        "id": 56,
        "url": "http://patchwork.ozlabs.org/api/projects/56/?format=api",
        "name": "OpenBMC development",
        "link_name": "openbmc",
        "list_id": "openbmc.lists.ozlabs.org",
        "list_email": "openbmc@lists.ozlabs.org",
        "web_url": "http://github.com/openbmc/",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170828001711.19662-3-andrew@aj.id.au>",
    "list_archive_url": null,
    "date": "2017-08-28T00:17:11",
    "name": "[v2,2/2] leds: gpio: Allow LED to retain state at shutdown",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "92ff6e6c14e5522e86aaaeb7c3f213606214b8ee",
    "submitter": {
        "id": 68332,
        "url": "http://patchwork.ozlabs.org/api/people/68332/?format=api",
        "name": "Andrew Jeffery",
        "email": "andrew@aj.id.au"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openbmc/patch/20170828001711.19662-3-andrew@aj.id.au/mbox/",
    "series": [
        {
            "id": 53,
            "url": "http://patchwork.ozlabs.org/api/series/53/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openbmc/list/?series=53",
            "date": "2017-08-28T00:17:09",
            "name": "leds: gpio: Allow retaining state on shutdown",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/53/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806331/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806331/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "openbmc@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "openbmc@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgXSS5t5nz9s7v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 10:19:04 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xgXSS4jXyzDqh0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 10:19:04 +1000 (AEST)",
            "from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com\n\t[66.111.4.26])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xgXRT4nSszDqb4\n\tfor <openbmc@lists.ozlabs.org>; Mon, 28 Aug 2017 10:18:13 +1000 (AEST)",
            "from compute4.internal (compute4.nyi.internal [10.202.2.44])\n\tby mailout.nyi.internal (Postfix) with ESMTP id E670E20994;\n\tSun, 27 Aug 2017 20:18:10 -0400 (EDT)",
            "from frontend2 ([10.202.2.161])\n\tby compute4.internal (MEProxy); Sun, 27 Aug 2017 20:18:10 -0400",
            "from keelia.aj.id.au\n\t(ppp118-210-176-216.bras2.adl6.internode.on.net [118.210.176.216])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id E0B38248E6;\n\tSun, 27 Aug 2017 20:18:06 -0400 (EDT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"M9CqDjza\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"Xg9atiDO\"; \n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"M9CqDjza\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"Xg9atiDO\"; \n\tdkim-atps=neutral",
            "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"M9CqDjza\";\n\tdkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com\n\theader.b=\"Xg9atiDO\"; dkim-atps=neutral"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=cc\n\t:date:from:in-reply-to:message-id:references:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=nrhTr4\n\tIvqKdTz8/vLqXokWBxuHuq3fkbpiAPW1pCFJ0=; b=M9CqDjzaVGyEMjA/7Zr0Xt\n\tMBUBvvLLze9IF6OmFgKBLp1lwjqxywYcAtDB6MCev/YSmTVHuzOVcaESZQhtYd7+\n\tbZCBxz/fd4z3KMWnLEEn1u81ng6HOtSdJYxgdoOl6cvKylw4R5StSoBdK8vV9xii\n\tTXWjO3r3e+DC8vFdQw2IguHKfCxaZ1WQ7rbjZW+X8B1go+Wu4iwC/WuICK79l6jo\n\tfNFcVVSvCRMo226jaaJsNVMIscdtwhHCMBl0/PIO+pR4e1CaanfGI0EoLdiQQeAR\n\tGV4Bv01by4Et6VWhr23I2ND2urmRrx2M3p3Bc/jibr9nyQYk6XJS+aONib93BWKg\n\t==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:in-reply-to:message-id\n\t:references:subject:to:x-me-sender:x-me-sender:x-sasl-enc\n\t:x-sasl-enc; s=fm1; bh=nrhTr4IvqKdTz8/vLqXokWBxuHuq3fkbpiAPW1pCF\n\tJ0=; b=Xg9atiDO1E2evLKgSeLUUILS6RvuCa1a4A6xemQd0X1R+f8eDlYu9VMX9\n\thCHderekMeGmWfV6DElSWNOU0Hok934HocMBKJ+99+v1yIKHteryMJwyNzfR9V5s\n\taiVtpIy1GmK2KFJdMNtyr7hCKm8V3PVtJCYp7/85n9hbBC3tXoTqPXwfF7Pco271\n\tdHubYrvlNmc1pcPqdf5a1ZtIfwQx4Xn9gInNsYIrQPa7LhHbSMsqfvcouQCZh3FV\n\ta6XwWI5fAhdKxZDtePFsTaHt/UvEbtsI9ccxeOoyI5r6eO8FEOZ20XczG0viUg/J\n\thWYF/P+hqmQ5s1l/NBSkylVUEvKBQ=="
        ],
        "X-ME-Sender": "<xms:QmGjWSi5CA5jplGi5WiMJxkm9A0PBDF_O6_04Ti4pq2dfhvIJxm48g>",
        "X-Sasl-enc": "XrH/P5JQ6Q2zo5zZj/tdvtF2GgdX5oMj96NbGVcp7Gg/ 1503879490",
        "From": "Andrew Jeffery <andrew@aj.id.au>",
        "To": "linux-leds@vger.kernel.org",
        "Subject": "[PATCH v2 2/2] leds: gpio: Allow LED to retain state at shutdown",
        "Date": "Mon, 28 Aug 2017 09:47:11 +0930",
        "Message-Id": "<20170828001711.19662-3-andrew@aj.id.au>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170828001711.19662-1-andrew@aj.id.au>",
        "References": "<20170828001711.19662-1-andrew@aj.id.au>",
        "X-BeenThere": "openbmc@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Development list for OpenBMC <openbmc.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/openbmc/>",
        "List-Post": "<mailto:openbmc@lists.ozlabs.org>",
        "List-Help": "<mailto:openbmc-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "mark.rutland@arm.com, devicetree@vger.kernel.org,\n\tAndrew Jeffery <andrew@aj.id.au>, openbmc@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org, robh+dt@kernel.org, rpurdie@rpsys.net, \n\tjacek.anaszewski@gmail.com, pavel@ucw.cz",
        "Errors-To": "openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "In some systems, such as Baseboard Management Controllers (BMCs), we\nwant to retain the state of LEDs across a reboot of the BMC (whilst the\nhost remains up). Implement support for the retain-state-shutdown\ndevicetree property in leds-gpio.\n\nSigned-off-by: Andrew Jeffery <andrew@aj.id.au>\nAcked-by: Pavel Machek <pavel@ucw.cz>\n---\n drivers/leds/leds-gpio.c | 7 ++++++-\n include/linux/leds.h     | 2 ++\n 2 files changed, 8 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c\nindex e753ba93ba1e..764c31301f90 100644\n--- a/drivers/leds/leds-gpio.c\n+++ b/drivers/leds/leds-gpio.c\n@@ -134,6 +134,8 @@ static int create_gpio_led(const struct gpio_led *template,\n \t\tled_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;\n \tif (template->panic_indicator)\n \t\tled_dat->cdev.flags |= LED_PANIC_INDICATOR;\n+\tif (template->retain_state_shutdown)\n+\t\tled_dat->cdev.flags |= LED_RETAIN_AT_SHUTDOWN;\n \n \tret = gpiod_direction_output(led_dat->gpiod, state);\n \tif (ret < 0)\n@@ -205,6 +207,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)\n \n \t\tif (fwnode_property_present(child, \"retain-state-suspended\"))\n \t\t\tled.retain_state_suspended = 1;\n+\t\tif (fwnode_property_present(child, \"retain-state-shutdown\"))\n+\t\t\tled.retain_state_shutdown = 1;\n \t\tif (fwnode_property_present(child, \"panic-indicator\"))\n \t\t\tled.panic_indicator = 1;\n \n@@ -267,7 +271,8 @@ static void gpio_led_shutdown(struct platform_device *pdev)\n \tfor (i = 0; i < priv->num_leds; i++) {\n \t\tstruct gpio_led_data *led = &priv->leds[i];\n \n-\t\tgpio_led_set(&led->cdev, LED_OFF);\n+\t\tif (!(led->cdev.flags & LED_RETAIN_AT_SHUTDOWN))\n+\t\t\tgpio_led_set(&led->cdev, LED_OFF);\n \t}\n }\n \ndiff --git a/include/linux/leds.h b/include/linux/leds.h\nindex 64c56d454f7d..bf6db4fe895b 100644\n--- a/include/linux/leds.h\n+++ b/include/linux/leds.h\n@@ -49,6 +49,7 @@ struct led_classdev {\n #define LED_HW_PLUGGABLE\t(1 << 19)\n #define LED_PANIC_INDICATOR\t(1 << 20)\n #define LED_BRIGHT_HW_CHANGED\t(1 << 21)\n+#define LED_RETAIN_AT_SHUTDOWN\t(1 << 22)\n \n \t/* set_brightness_work / blink_timer flags, atomic, private. */\n \tunsigned long\t\twork_flags;\n@@ -392,6 +393,7 @@ struct gpio_led {\n \tunsigned\tretain_state_suspended : 1;\n \tunsigned\tpanic_indicator : 1;\n \tunsigned\tdefault_state : 2;\n+\tunsigned\tretain_state_shutdown : 1;\n \t/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */\n \tstruct gpio_desc *gpiod;\n };\n",
    "prefixes": [
        "v2",
        "2/2"
    ]
}