get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1839956,
    "url": "http://patchwork.ozlabs.org/api/patches/1839956/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20230926-gpio-led-trigger-dt-v2-1-e06e458b788e@linaro.org/",
    "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": "<20230926-gpio-led-trigger-dt-v2-1-e06e458b788e@linaro.org>",
    "list_archive_url": null,
    "date": "2023-09-26T21:48:11",
    "name": "[v2,1/3] gpiolib: of: Allow \"trigger-sources\" to reference a GPIO",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4b78cd3ec58913c3416b71bc01ebc25850d3c8b5",
    "submitter": {
        "id": 7055,
        "url": "http://patchwork.ozlabs.org/api/people/7055/?format=api",
        "name": "Linus Walleij",
        "email": "linus.walleij@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20230926-gpio-led-trigger-dt-v2-1-e06e458b788e@linaro.org/mbox/",
    "series": [
        {
            "id": 375009,
            "url": "http://patchwork.ozlabs.org/api/series/375009/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=375009",
            "date": "2023-09-26T21:48:11",
            "name": "Rewrite GPIO LED trigger to use trigger-sources",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/375009/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1839956/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1839956/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-gpio-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=VoBsLbex;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2620:137:e000::1:20; helo=out1.vger.email;\n envelope-from=linux-gpio-owner@vger.kernel.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20])\n\tby legolas.ozlabs.org (Postfix) with ESMTP id 4RwF9J0gfCz1ypS\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 27 Sep 2023 08:41:56 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n        id S229542AbjIZWly (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n        Tue, 26 Sep 2023 18:41:54 -0400",
            "from lindbergh.monkeyblade.net ([23.128.96.19]:41104 \"EHLO\n        lindbergh.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n        with ESMTP id S229543AbjIZWjy (ORCPT\n        <rfc822;linux-gpio@vger.kernel.org>); Tue, 26 Sep 2023 18:39:54 -0400",
            "from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n [IPv6:2a00:1450:4864:20::22c])\n        by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7683717EB7\n        for <linux-gpio@vger.kernel.org>;\n Tue, 26 Sep 2023 14:48:17 -0700 (PDT)",
            "by mail-lj1-x22c.google.com with SMTP id\n 38308e7fff4ca-2c131ddfeb8so151594631fa.3\n        for <linux-gpio@vger.kernel.org>;\n Tue, 26 Sep 2023 14:48:17 -0700 (PDT)",
            "from [127.0.1.1] ([85.235.12.238])\n        by smtp.gmail.com with ESMTPSA id\n f10-20020a19ae0a000000b0050334e5f5a8sm2299982lfc.271.2023.09.26.14.48.15\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 26 Sep 2023 14:48:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=linaro.org; s=google; t=1695764896; x=1696369696;\n darn=vger.kernel.org;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=8qB5IXPhlDrInJ4+uHWJuFNZT6fpdkJgSFfl8pKGqOw=;\n        b=VoBsLbex+dcgZvna6lB2wr/DU7reAqKP2nW0mB0AoSw17gVe92mLnuqVfx2FTXv8+N\n         tNl46h1QvKVge6SMHag9qUIYtctpR/n8uMXVHAObmajFj2rq8WPni3gFPuy3TRIZJe8m\n         B4AuXrDc1Pz0/TB2wuYCfBBFpfDaqJuHFxNuT/vyv8rPCo44OAviw179J6jkqsRrxRh4\n         Ul3x5PHs9Sk3mWjaoAzhaL4a9wSFcpxajQpJh7AU8CcWtPe8ehHTwcjO2Cyy6p0uYD8D\n         51emj0mLCW+z5BKj5Gb3H+e5jC5U3LNLEdrpAeOQoYY3pCQ8yt+240NTdSZlNZ7LwIFG\n         7Lxg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20230601; t=1695764896; x=1696369696;\n        h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n         :mime-version:subject:date:from:x-gm-message-state:from:to:cc\n         :subject:date:message-id:reply-to;\n        bh=8qB5IXPhlDrInJ4+uHWJuFNZT6fpdkJgSFfl8pKGqOw=;\n        b=Umadi+crCvCw2+mnGoMuL+HFzh5COiblmtoJmjqpyjApgTiLx9Vd51twMAqs5+DrKZ\n         RsM1W8q9zHzEV1tb7gNP0un8FnNKqJkiuluZR2ov0l9NbOTXhNAzngGjrBxndAVfvG7J\n         Ir/MxPvPgvmyMJYzTwyE31pN+sdy93mHAxL5pKbbrcGYQOKttYVVvmTozDzVc+tO6H++\n         vxI+d51Ecf39a9TwF0xM9xBC6d1LH/sosUmC/yq4222GLpxecMqszKFA34r/KN2C57xg\n         h8HLUC2EqrII9Wv2VqKr0AvfElkbURjpIHgOZYDPGbGg24h0WcwJHRDpaxX9NQ25U2GL\n         8vBQ==",
        "X-Gm-Message-State": "AOJu0YytjJTT8edjFpTulzya0U52/Nrxpxvbpx0dCMEmndktVgXh8qtq\n        ECXcIoTnm3oTd/ot0PeuHr4czyjA80s7HFoEft4=",
        "X-Google-Smtp-Source": "\n AGHT+IF07socDjKuzAFiIl/P5XoFGn0P3ljLEYY8uPVMH9VUnHqVycz5Tp/8JEsd/mhpicW4ais7Pw==",
        "X-Received": "by 2002:a05:6512:31c5:b0:500:b63f:4db3 with SMTP id\n j5-20020a05651231c500b00500b63f4db3mr38886lfe.35.1695764895770;\n        Tue, 26 Sep 2023 14:48:15 -0700 (PDT)",
        "From": "Linus Walleij <linus.walleij@linaro.org>",
        "Date": "Tue, 26 Sep 2023 23:48:11 +0200",
        "Subject": "[PATCH v2 1/3] gpiolib: of: Allow \"trigger-sources\" to reference a\n GPIO",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20230926-gpio-led-trigger-dt-v2-1-e06e458b788e@linaro.org>",
        "References": "<20230926-gpio-led-trigger-dt-v2-0-e06e458b788e@linaro.org>",
        "In-Reply-To": "<20230926-gpio-led-trigger-dt-v2-0-e06e458b788e@linaro.org>",
        "To": "=?utf-8?q?Jan_Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>,\n Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,\n Rob Herring <robh+dt@kernel.org>,\n Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,\n Conor Dooley <conor+dt@kernel.org>,\n Jacek Anaszewski <jacek.anaszewski@gmail.com>",
        "Cc": "linux-leds@vger.kernel.org, linux-gpio@vger.kernel.org,\n        devicetree@vger.kernel.org,\n        Linus Walleij <linus.walleij@linaro.org>",
        "X-Mailer": "b4 0.12.3",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n        DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n        SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6",
        "X-Spam-Checker-Version": "SpamAssassin 3.4.6 (2021-04-09) on\n        lindbergh.monkeyblade.net",
        "Precedence": "bulk",
        "List-ID": "<linux-gpio.vger.kernel.org>",
        "X-Mailing-List": "linux-gpio@vger.kernel.org"
    },
    "content": "The \"trigger-sources\" phandle used for LED triggers are special:\nthe DT bindings mandate that such triggers have the same phandle\nreferences no matter what the trigger is. A GPIO is just another\nkind of device that can trigger a LED.\n\nSigned-off-by: Linus Walleij <linus.walleij@linaro.org>\n---\n drivers/gpio/gpiolib-of.c | 28 ++++++++++++++++++++++++++++\n 1 file changed, 28 insertions(+)",
    "diff": "diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c\nindex 531faabead0f..f4a660bf11fd 100644\n--- a/drivers/gpio/gpiolib-of.c\n+++ b/drivers/gpio/gpiolib-of.c\n@@ -611,6 +611,33 @@ static struct gpio_desc *of_find_mt2701_gpio(struct device_node *np,\n \treturn desc;\n }\n \n+/*\n+ * Trigger sources are special, they allow us to use any GPIO as a LED trigger\n+ * and have the name \"trigger-sources\" no matter which kind of phandle it is\n+ * pointing to, whether to a GPIO, a USB host, a network PHY etc. So in this case\n+ * we allow looking something up that is not named \"foo-gpios\".\n+ */\n+static struct gpio_desc *of_find_trigger_gpio(struct device_node *np,\n+\t\t\t\t\t      const char *con_id,\n+\t\t\t\t\t      unsigned int idx,\n+\t\t\t\t\t      enum of_gpio_flags *of_flags)\n+{\n+\tstruct gpio_desc *desc;\n+\n+\tif (!IS_ENABLED(CONFIG_LEDS_TRIGGER_GPIO))\n+\t\treturn ERR_PTR(-ENOENT);\n+\n+\tif (!con_id || strcmp(con_id, \"trigger-sources\"))\n+\t\treturn ERR_PTR(-ENOENT);\n+\n+\tdesc = of_get_named_gpiod_flags(np, con_id, idx, of_flags);\n+\tif (!gpiod_not_found(desc))\n+\t\tpr_debug(\"%s is used as a trigger\\n\", of_node_full_name(np));\n+\n+\treturn desc;\n+}\n+\n+\n typedef struct gpio_desc *(*of_find_gpio_quirk)(struct device_node *np,\n \t\t\t\t\t\tconst char *con_id,\n \t\t\t\t\t\tunsigned int idx,\n@@ -618,6 +645,7 @@ typedef struct gpio_desc *(*of_find_gpio_quirk)(struct device_node *np,\n static const of_find_gpio_quirk of_find_gpio_quirks[] = {\n \tof_find_gpio_rename,\n \tof_find_mt2701_gpio,\n+\tof_find_trigger_gpio,\n \tNULL\n };\n \n",
    "prefixes": [
        "v2",
        "1/3"
    ]
}