get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817924,
    "url": "http://patchwork.ozlabs.org/api/patches/817924/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/patch/20170924145622.4031-8-linus.walleij@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": "<20170924145622.4031-8-linus.walleij@linaro.org>",
    "list_archive_url": null,
    "date": "2017-09-24T14:56:21",
    "name": "[7/8] extcon: gpio: Get connector type from device property",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e4b72547e95cd4cbb0e624757f48fb81c9272602",
    "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/20170924145622.4031-8-linus.walleij@linaro.org/mbox/",
    "series": [
        {
            "id": 4818,
            "url": "http://patchwork.ozlabs.org/api/series/4818/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-gpio/list/?series=4818",
            "date": "2017-09-24T14:56:14",
            "name": "GPIO extcon modernization",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4818/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817924/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817924/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;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"LOS6kKNZ\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0Vn963DFz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 25 Sep 2017 01:02:21 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752620AbdIXPCJ (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 24 Sep 2017 11:02:09 -0400",
            "from mail-pg0-f48.google.com ([74.125.83.48]:44062 \"EHLO\n\tmail-pg0-f48.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752605AbdIXPCI (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Sun, 24 Sep 2017 11:02:08 -0400",
            "by mail-pg0-f48.google.com with SMTP id j16so2736341pga.1\n\tfor <linux-gpio@vger.kernel.org>;\n\tSun, 24 Sep 2017 08:02:08 -0700 (PDT)",
            "from genomnajs.saswifi.com ([104.153.224.168])\n\tby smtp.gmail.com with ESMTPSA id\n\tn83sm7386805pfi.163.2017.09.24.08.01.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tSun, 24 Sep 2017 08:02:07 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=I0NEvmbxcWXA5okiDqqtuj9tm8T9ilhu7ty7iDdGUhA=;\n\tb=LOS6kKNZLmmkya90eLpPL0wKT4r+X25Enx6ArhrlRdlnny7hVaUSSZLvGgpOLC+9bC\n\ticr4i2DBTUD+I+Bo8aY1CkWNL+cBdocbaWDNtEEQIviE/pPUnHqLp8GSYO6hXza2K+/R\n\tPJeN6XOnWoJkxWNc9QYPrQcLkbZOXEL89aH/E=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=I0NEvmbxcWXA5okiDqqtuj9tm8T9ilhu7ty7iDdGUhA=;\n\tb=MIpXriORmfwMs8MJq9s8H36YNq3RlRIX4uqn79YXimUnpbN72qPOFgnXYsYqQNPTdk\n\tuY2UM5Cs9NLXliKQpBwsBt9Q792aTW6YVAb7ouf3YpekzxwNAEzyhm1qRrpj2uhjewDU\n\tyJBF6gpMswSi4tQHTb9kZgF14+lzDPzLpPLUhOVN4/LUQqZg8NK2e6bB8Br5F/Bni9lx\n\tdv4EY4zU6FY2azWkOWT73iKRoRfS3cTIw4ePoy5Fy+nI0ubXhh7wWRgPawr0PF7xg18q\n\tVJa+mgESO+6atfTQgVPjJaWIwEMNcIzvLzOZP5ic9GeiaU78dYyHZrefzyXO/TOqMxVq\n\tXQmw==",
        "X-Gm-Message-State": "AHPjjUgikBIR3OnEE7joaL60BQdDyQ/8nclnWVgJA/nEwj7bIWttG+0e\n\tiSSHzPNVSzsf4dw7m50FPbRM8g==",
        "X-Google-Smtp-Source": "AOwi7QBfiQx2z6+FjfQwqplh8ONEfdKGTjVz8zBFf45I4Fw7WvZBmoUk2MMWsQbRe9yGLlLQoIQCDQ==",
        "X-Received": "by 10.84.131.74 with SMTP id 68mr4968870pld.227.1506265327650;\n\tSun, 24 Sep 2017 08:02:07 -0700 (PDT)",
        "From": "Linus Walleij <linus.walleij@linaro.org>",
        "To": "MyungJoo Ham <myungjoo.ham@samsung.com>,\n\tChanwoo Choi <cw00.choi@samsung.com>",
        "Cc": "linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,\n\tJohn Stultz <john.stultz@linaro.org>,\n\tMike Lockwood <lockwood@google.com>, Guenter Roeck <linux@roeck-us.net>,\n\tLinus Walleij <linus.walleij@linaro.org>",
        "Subject": "[PATCH 7/8] extcon: gpio: Get connector type from device property",
        "Date": "Sun, 24 Sep 2017 16:56:21 +0200",
        "Message-Id": "<20170924145622.4031-8-linus.walleij@linaro.org>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170924145622.4031-1-linus.walleij@linaro.org>",
        "References": "<20170924145622.4031-1-linus.walleij@linaro.org>",
        "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": "We do not use the \"EXTCON_NONE\" type to report this as before, use\nthe connector type defined in the device property, from device tree or\nACPI DSDT.\n\nSigned-off-by: Linus Walleij <linus.walleij@linaro.org>\n---\n drivers/extcon/extcon-gpio.c | 21 ++++++++++++++-------\n 1 file changed, 14 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c\nindex 8fc52631c8a2..b7353f5018b5 100644\n--- a/drivers/extcon/extcon-gpio.c\n+++ b/drivers/extcon/extcon-gpio.c\n@@ -35,7 +35,8 @@\n  * @debounce_jiffies:\tNumber of jiffies to wait for the GPIO to stabilize, from the debounce\n  *\t\t\tvalue.\n  * @gpiod:\t\tGPIO descriptor for this external connector.\n- * @extcon_id:\t\tThe unique id of specific external connector.\n+ * @connector_type:\tThe connector type we're detecting on this extcon, terminated with EXTCON_NONE\n+ *\t\t\tOne GPIO is one cable, so one type only.\n  * @check_on_resume:\tBoolean describing whether to check the state of gpio\n  *\t\t\twhile resuming from sleep.\n  */\n@@ -44,7 +45,7 @@ struct gpio_extcon_data {\n \tstruct delayed_work work;\n \tunsigned long debounce_jiffies;\n \tstruct gpio_desc *gpiod;\n-\tunsigned int extcon_id;\n+\tunsigned int connector_type[2];\n \tbool check_on_resume;\n };\n \n@@ -56,7 +57,7 @@ static void gpio_extcon_work(struct work_struct *work)\n \t\t\t     work);\n \n \tstate = gpiod_get_value_cansleep(data->gpiod);\n-\textcon_set_state_sync(data->edev, data->extcon_id, state);\n+\textcon_set_state_sync(data->edev, data->connector_type[0], state);\n }\n \n static irqreturn_t gpio_irq_handler(int irq, void *dev_id)\n@@ -74,6 +75,7 @@ static int gpio_extcon_probe(struct platform_device *pdev)\n \tstruct device *dev = &pdev->dev;\n \tunsigned long irq_flags;\n \tu32 debounce_usecs;\n+\tu32 connector_type;\n \tint irq;\n \tint ret;\n \n@@ -81,9 +83,6 @@ static int gpio_extcon_probe(struct platform_device *pdev)\n \tif (!data)\n \t\treturn -ENOMEM;\n \n-\tif (data->extcon_id > EXTCON_NONE)\n-\t\treturn -EINVAL;\n-\n \tdata->gpiod = devm_gpiod_get(dev, \"extcon\", GPIOD_IN);\n \tif (IS_ERR(data->gpiod))\n \t\treturn PTR_ERR(data->gpiod);\n@@ -102,8 +101,16 @@ static int gpio_extcon_probe(struct platform_device *pdev)\n \telse\n \t\tirq_flags = IRQF_TRIGGER_RISING;\n \n+\tret = device_property_read_u32(dev, \"extcon-connector-types\", &connector_type);\n+\tif (ret || !connector_type) {\n+\t\tdev_err(dev, \"illegal cable type or undefined cable type\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tdata->connector_type[0] = connector_type;\n+\tdata->connector_type[1] = EXTCON_NONE;\n+\n \t/* Allocate the memory of extcon devie and register extcon device */\n-\tdata->edev = devm_extcon_dev_allocate(dev, &data->extcon_id);\n+\tdata->edev = devm_extcon_dev_allocate(dev, data->connector_type);\n \tif (IS_ERR(data->edev)) {\n \t\tdev_err(dev, \"failed to allocate extcon device\\n\");\n \t\treturn -ENOMEM;\n",
    "prefixes": [
        "7/8"
    ]
}