get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819483,
    "url": "http://patchwork.ozlabs.org/api/patches/819483/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170928094627.31017-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": "<20170928094627.31017-4-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-28T09:46:22",
    "name": "[v4,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/20170928094627.31017-4-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 5526,
            "url": "http://patchwork.ozlabs.org/api/series/5526/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=5526",
            "date": "2017-09-28T09:46:23",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/5526/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819483/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819483/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=\"ZnzCov8D\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"AaVYWqOZ\"; 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 3y2qdw4tfXz9t3v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 19:49:08 +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 1dxVRI-0004cu-NV; Thu, 28 Sep 2017 09:49:04 +0000",
            "from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dxVPM-0002S2-O4\n\tfor linux-mtd@lists.infradead.org; Thu, 28 Sep 2017 09:47:13 +0000",
            "by mail-wm0-x244.google.com with SMTP id t69so1049383wmt.2\n\tfor <linux-mtd@lists.infradead.org>;\n\tThu, 28 Sep 2017 02:46:44 -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\tz10sm3272395wre.6.2017.09.28.02.46.41\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 28 Sep 2017 02:46:42 -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=1ng4hsT3hhXQk3vkzi8iDFKO1wl94aTWYgwMHG5Hx4Y=;\n\tb=ZnzCov8D5Uucrmy05w9qlmAKU5\n\tN6AUym98Bx1RlNN3TVm3GmBE4DCYMrrs7H29D2DfmmUsZvKS2tzE8LTLt5b5qaZ7WRiJCC8/9jWDi\n\t+MIUpwjsdAsnTzwGUSGPoGPuRVi6//uA/nvO9RDfe230+G7m8elm970K1sYV3froGlwr9nI4Ghvq2\n\tAKtOk6tcrPfAWTbzwPMcxqJxaUPvTpo6fVYfp0gM5Zj2XoXxi5K+xj2QEcxeF3VJVueLp7pkELlgJ\n\tCQLnM6MCrnvNvM2s4cnBKSDE6U7dAuWkW0PjCH/roUWBPOHFJGENw5vxvgcrWnloxfvg5moOps3k/\n\tLRBEquAg==;",
            "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=5v5OQvNstnVmbIx9/rItx5KKfRrxeaMxdASdro2SAIU=;\n\tb=AaVYWqOZgpYSPJHduUQphRxizm/MZaPT4QHWVxS22dJ8ImjnAyCZgjH/T9pjZn1h9g\n\t12b55Vgrx/GydWKxROh0/Zav4E5XO0MaXAO+k+OEGPmsRZ64eZPDBualdaS+eABvBIu3\n\ttBvO4ie54gZmsAFrUJmy7zbJCaRWho1sJtXKaqIBZutQRxuUId+KDkRMzJmKgmdgVWm1\n\tgh9DrSAq5iwCf9afqhiuNtc3tsBYR4ab5FowWaykGJV1qQPqzAAFIQ6O/SsDhggGXk9S\n\tzbkFux5jXGvnDKWfdN4CcpiIR9GuHD8jLMnuKwFAYVsrm+ObZ5THSfbrsLiiz6ykILXK\n\t1Fng=="
        ],
        "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=5v5OQvNstnVmbIx9/rItx5KKfRrxeaMxdASdro2SAIU=;\n\tb=aBOXVBkWDaO0PUqfzIYNoT1hZ4sEGtx4SOs5diqDFfUzJFhAmz+/oPF6IOjCQPFQB/\n\tQEKpsw5A0H/Yr7bft+jR1s5DHWCTIh2f2b0wlUwU6dIJI5qWH3uFizLwNwPAS2EXFTNC\n\t6+zxr2ekwaiOxezj8E/aqo2kBkt2bAZuWSsYqS2iQhmCigWahzmaothqZdbY1DwtN6fX\n\tvhnuWASjXoixaDuOPT0TGIUA5GVe8hx0VAtpmHeYMYUsvBkiB4g9f14X7tsFd0YWBYvR\n\txEzRamtrWvB4Jo8dF1LXx8QOkwmLa/YnfQfXKNLQrghkCGVLTvZ+UkPtMR0Y0CTwHmUl\n\tEjtw==",
        "X-Gm-Message-State": "AMCzsaXDsoCapmn6orvSBQwJtNmvSurycl18ONmLiin7WfTJhGc78Q3u\n\teCcItw306Ei2h1hLJ/BYzD8=",
        "X-Google-Smtp-Source": "AOwi7QDptAIZ6FV08s0hkDb0KP4Iky1N9uWpZQXNaVwXIQO0s/EB48tfYTNVHvD0phfcwqZmSM5e7Q==",
        "X-Received": "by 10.28.169.140 with SMTP id s134mr526053wme.36.1506592002690; \n\tThu, 28 Sep 2017 02:46:42 -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 v4 3/8] clk: at91: pmc: Support backup for programmable\n\tclocks",
        "Date": "Thu, 28 Sep 2017 11:46:22 +0200",
        "Message-Id": "<20170928094627.31017-4-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170928094627.31017-1-romain.izard.pro@gmail.com>",
        "References": "<20170928094627.31017-1-romain.izard.pro@gmail.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170928_024705_043299_1747F08A ",
        "X-CRM114-Status": "GOOD (  17.10  )",
        "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 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\n\nChanges 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": [
        "v4",
        "3/8"
    ]
}