get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819042,
    "url": "http://patchwork.ozlabs.org/api/patches/819042/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170927083555.16580-4-romain.izard.pro@gmail.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170927083555.16580-4-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-27T08:35:50",
    "name": "[v3,3/8] clk: at91: pmc: Support backup for programmable clocks",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "004969db4bcac8e19b744f4f17f33eb21cb75e09",
    "submitter": {
        "id": 8236,
        "url": "http://patchwork.ozlabs.org/api/people/8236/?format=api",
        "name": "Romain Izard",
        "email": "romain.izard.pro@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170927083555.16580-4-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 5311,
            "url": "http://patchwork.ozlabs.org/api/series/5311/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=5311",
            "date": "2017-09-27T08:35:49",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/5311/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819042/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819042/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"ln+cmvCc\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"NFU/Avt1\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y2B5g6XPRz9t3x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:37:27 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dx7qN-0003iI-63; Wed, 27 Sep 2017 08:37:23 +0000",
            "from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dx7pa-0002k5-1j\n\tfor linux-mtd@lists.infradead.org; Wed, 27 Sep 2017 08:36:40 +0000",
            "by mail-wm0-x243.google.com with SMTP id q124so15384010wmb.0\n\tfor <linux-mtd@lists.infradead.org>;\n\tWed, 27 Sep 2017 01:36:16 -0700 (PDT)",
            "from localhost.localdomain (146.187.3.109.rev.sfr.net.\n\t[109.3.187.146]) by smtp.gmail.com with ESMTPSA id\n\tr6sm9699900wrg.40.2017.09.27.01.36.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 27 Sep 2017 01:36:14 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=6aKST+XaqjAQdhsOJKjHpI0UITdCXR+uPv/Z2AOCk7g=;\n\tb=ln+cmvCc2pUv2yqlmVB4IRYhg1\n\tLdKQVhjGo5jU8nQ7WUcZa//np4aIA/NHsdckUfayHIRUIB4s3DSnO0Vm4yca41ek6uo6xarSSVHx/\n\tLU18RokpgN4oWWdsKlRSKk4v01Ms6hWC4xpJEt42UDEvGX23L0IsdaXkC4GLzhTSF6T7m8Ycn+MJg\n\toksdKkDH/sdZDPri5Xfe6uyuyb4bSfrOHWCDq0fiKRy74zZWwgwglgA5SJ/pRvBiSSsG3kGmdV6jl\n\tBuVQoJ+xdTwY2jNZFCbuZYjCNYiul5Ml1v4IcfcbQqIN/Zbw0aPUO9v5wF1+n8QTBCL6dnNROAtVY\n\t9m/+o9hQ==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=iLRDoc1eXp6mQxdaAfv7l1CnPd100UAgbzaexY+m7LI=;\n\tb=NFU/Avt1n2OivYNZJLJsv5/BFn3yG9Ye7CUsC8KWJTGRoH7FplTV/4lv/622XzkiQr\n\t1/HDEiS901deqWZVUU3HqLGJ0pdiTIs8cOXETeiQwqgVDao17DpSTR/ZhZfh3AUIEvgY\n\t2UpX8b5sEqlXds0LoPX1hXidYiCjsquFQFYUlD4rzBXITmaZzROZMWp1V5WaT8slOVuE\n\tUBEdaZOUFcnnisttBEO3E9UIwnrSz+HDhspZvSIYvgRtj9Fd4a9LTP4/GvV7e33FHvF5\n\t06SJDI6fftp7wjieiAYswrSf/kBkC5V4EZoLqPaDr9QVSHe96vdaup2Pbau658i7hTey\n\tB3EQ=="
        ],
        "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=iLRDoc1eXp6mQxdaAfv7l1CnPd100UAgbzaexY+m7LI=;\n\tb=ESA0ZV29aYmq8Q4worJsDynFAuEoeU2STY8uBroMp4CrSs01UQ2+8VtdUBM6wECBT8\n\to4Cqk50z0bI385hFVDzPm2p6In3wudDEwZsPJw3xSp+gouogdj47W9FRgbdmpc2gL2cQ\n\tZEBA0BLqIHUyzY+T4qewt3hnFTQlMZNhhwo0Ilett9noC7JbcMpbp+CydGkEw6GqCZEy\n\tcR7KNGYWOwU328/Od/6jXNBY7iRG3/xGNUhe+xKoLmqQ0MA//PYU/w2cff/m9zVHaZD4\n\tqRKlVjKS1HzZ9pWChTzoQuMNPwEv2lNCZyhN6MG90aP4/SRmAoHY+Nyr5DCT1Iu6Of8M\n\t6C+A==",
        "X-Gm-Message-State": "AHPjjUihmxXiyTLv27VoMGubD4o8NH7IKHcKq+Kp5FLETL8xFfeSucg4\n\tLp7jsYUF9OdnNiW0AnwxIKM=",
        "X-Google-Smtp-Source": "AOwi7QCo5Db5eKdgcBtRjxCvyj41jUdYPcSQHpB8h1sF5WFR89Zz3ToMSaD8TfcWXwS+n8jypK3ZOQ==",
        "X-Received": "by 10.28.8.75 with SMTP id 72mr791437wmi.43.1506501374874;\n\tWed, 27 Sep 2017 01:36:14 -0700 (PDT)",
        "From": "Romain Izard <romain.izard.pro@gmail.com>",
        "To": "Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>, Lee Jones <lee.jones@linaro.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>, \n\tRichard Weinberger <richard@nod.at>,\n\tDavid Woodhouse <dwmw2@infradead.org>, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tJiri Slaby <jslaby@suse.com>, Alan Stern <stern@rowland.harvard.edu>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tNicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>",
        "Subject": "[PATCH v3 3/8] clk: at91: pmc: Support backup for programmable\n\tclocks",
        "Date": "Wed, 27 Sep 2017 10:35:50 +0200",
        "Message-Id": "<20170927083555.16580-4-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170927083555.16580-1-romain.izard.pro@gmail.com>",
        "References": "<20170927083555.16580-1-romain.izard.pro@gmail.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170927_013634_290314_C0F93086 ",
        "X-CRM114-Status": "GOOD (  16.37  )",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c09:0:0:0:243 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Cc": "linux-pwm@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org,\n\tRomain Izard <romain.izard@mobile-devices.fr>, \n\tRomain Izard <romain.izard.pro@gmail.com>, linux-clk@vger.kernel.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "From: Romain Izard <romain.izard@mobile-devices.fr>\n\nWhen an AT91 programmable clock is declared in the device tree, register\nit into the Power Management Controller driver. On entering suspend mode,\nthe driver saves and restores the Programmable Clock registers to support\nthe backup mode for these clocks.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\nAcked-by: Nicolas Ferre <nicolas.ferre@microchip.com>\n---\nChanges in v2:\n* register PCKs on clock startup\nChnages in v3:\n* improve comments on hanling 0 in pmc_register_id and pmc_register_pck\n* declare local variables earlier for checkpatch\n\n drivers/clk/at91/clk-programmable.c |  2 ++\n drivers/clk/at91/pmc.c              | 35 +++++++++++++++++++++++++++++++++++\n drivers/clk/at91/pmc.h              |  2 ++\n 3 files changed, 39 insertions(+)",
    "diff": "diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c\nindex 85a449cf61e3..0e6aab1252fc 100644\n--- a/drivers/clk/at91/clk-programmable.c\n+++ b/drivers/clk/at91/clk-programmable.c\n@@ -204,6 +204,8 @@ at91_clk_register_programmable(struct regmap *regmap,\n \tif (ret) {\n \t\tkfree(prog);\n \t\thw = ERR_PTR(ret);\n+\t} else {\n+\t\tpmc_register_pck(id);\n \t}\n \n \treturn hw;\ndiff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c\nindex 07dc2861ad3f..1fa27f4ea538 100644\n--- a/drivers/clk/at91/pmc.c\n+++ b/drivers/clk/at91/pmc.c\n@@ -22,6 +22,7 @@\n #include \"pmc.h\"\n \n #define PMC_MAX_IDS 128\n+#define PMC_MAX_PCKS 8\n \n int of_at91_get_clk_range(struct device_node *np, const char *propname,\n \t\t\t  struct clk_range *range)\n@@ -50,6 +51,7 @@ EXPORT_SYMBOL_GPL(of_at91_get_clk_range);\n static struct regmap *pmcreg;\n \n static u8 registered_ids[PMC_MAX_IDS];\n+static u8 registered_pcks[PMC_MAX_PCKS];\n \n static struct\n {\n@@ -66,8 +68,13 @@ static struct\n \tu32 pcr[PMC_MAX_IDS];\n \tu32 audio_pll0;\n \tu32 audio_pll1;\n+\tu32 pckr[PMC_MAX_PCKS];\n } pmc_cache;\n \n+/*\n+ * As Peripheral ID 0 is invalid on AT91 chips, the identifier is stored\n+ * without alteration in the table, and 0 is for unused clocks.\n+ */\n void pmc_register_id(u8 id)\n {\n \tint i;\n@@ -82,9 +89,28 @@ void pmc_register_id(u8 id)\n \t}\n }\n \n+/*\n+ * As Programmable Clock 0 is valid on AT91 chips, there is an offset\n+ * of 1 between the stored value and the real clock ID.\n+ */\n+void pmc_register_pck(u8 pck)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < PMC_MAX_PCKS; i++) {\n+\t\tif (registered_pcks[i] == 0) {\n+\t\t\tregistered_pcks[i] = pck + 1;\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (registered_pcks[i] == (pck + 1))\n+\t\t\tbreak;\n+\t}\n+}\n+\n static int pmc_suspend(void)\n {\n \tint i;\n+\tu8 num;\n \n \tregmap_read(pmcreg, AT91_PMC_SCSR, &pmc_cache.scsr);\n \tregmap_read(pmcreg, AT91_PMC_PCSR, &pmc_cache.pcsr0);\n@@ -103,6 +129,10 @@ static int pmc_suspend(void)\n \t\tregmap_read(pmcreg, AT91_PMC_PCR,\n \t\t\t    &pmc_cache.pcr[registered_ids[i]]);\n \t}\n+\tfor (i = 0; registered_pcks[i]; i++) {\n+\t\tnum = registered_pcks[i] - 1;\n+\t\tregmap_read(pmcreg, AT91_PMC_PCKR(num), &pmc_cache.pckr[num]);\n+\t}\n \n \treturn 0;\n }\n@@ -119,6 +149,7 @@ static bool pmc_ready(unsigned int mask)\n static void pmc_resume(void)\n {\n \tint i;\n+\tu8 num;\n \tu32 tmp;\n \tu32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA;\n \n@@ -143,6 +174,10 @@ static void pmc_resume(void)\n \t\t\t     pmc_cache.pcr[registered_ids[i]] |\n \t\t\t     AT91_PMC_PCR_CMD);\n \t}\n+\tfor (i = 0; registered_pcks[i]; i++) {\n+\t\tnum = registered_pcks[i] - 1;\n+\t\tregmap_write(pmcreg, AT91_PMC_PCKR(num), pmc_cache.pckr[num]);\n+\t}\n \n \tif (pmc_cache.uckr & AT91_PMC_UPLLEN)\n \t\tmask |= AT91_PMC_LOCKU;\ndiff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h\nindex 858e8ef7e8db..d22b1fa9ecdc 100644\n--- a/drivers/clk/at91/pmc.h\n+++ b/drivers/clk/at91/pmc.h\n@@ -31,8 +31,10 @@ int of_at91_get_clk_range(struct device_node *np, const char *propname,\n \n #ifdef CONFIG_PM\n void pmc_register_id(u8 id);\n+void pmc_register_pck(u8 pck);\n #else\n static inline void pmc_register_id(u8 id) {}\n+static inline void pmc_register_pck(u8 pck) {}\n #endif\n \n #endif /* __PMC_H_ */\n",
    "prefixes": [
        "v3",
        "3/8"
    ]
}