Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814291/?format=api
{ "id": 814291, "url": "http://patchwork.ozlabs.org/api/patches/814291/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/patch/20170915140411.31716-4-romain.izard.pro@gmail.com/", "project": { "id": 38, "url": "http://patchwork.ozlabs.org/api/projects/38/?format=api", "name": "Linux PWM development", "link_name": "linux-pwm", "list_id": "linux-pwm.vger.kernel.org", "list_email": "linux-pwm@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170915140411.31716-4-romain.izard.pro@gmail.com>", "list_archive_url": null, "date": "2017-09-15T14:04:05", "name": "[v2,3/9] clk: at91: pmc: Support backup for programmable clocks", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3e25566e4e60d8b35d20cb04ed047026eb4b47b5", "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-pwm/patch/20170915140411.31716-4-romain.izard.pro@gmail.com/mbox/", "series": [ { "id": 3315, "url": "http://patchwork.ozlabs.org/api/series/3315/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pwm/list/?series=3315", "date": "2017-09-15T14:04:06", "name": "Various patches for SAMA5D2 backup mode", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/3315/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814291/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814291/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-pwm-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-pwm-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"juBwY/T+\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xtxzN11X8z9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 00:06:56 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751563AbdIOOE7 (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 15 Sep 2017 10:04:59 -0400", "from mail-wr0-f196.google.com ([209.85.128.196]:37385 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751509AbdIOOE4 (ORCPT\n\t<rfc822; linux-pwm@vger.kernel.org>); Fri, 15 Sep 2017 10:04:56 -0400", "by mail-wr0-f196.google.com with SMTP id u48so1368770wrf.4;\n\tFri, 15 Sep 2017 07:04:55 -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\t55sm1399225wrw.60.2017.09.15.07.04.51\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 07:04:54 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=tcS6Herze/XO57KCIuaC04ZS3Cd91y6u2sAFJ0Y0QYc=;\n\tb=juBwY/T+1sZCvqvkfvLxBJvFOWd40tjGXaZi1QP6UEZ7XihOq3awXva745BYAnl6S1\n\tza6HmrH7esfL1xNR4UeB5ah0uKbFRip34RxtaFxrRoExUDXLOaZwbICCbZxchKnX/rVQ\n\tCyc6hW18SxyP076+bWcUi1RUiOXq2Hz2SpQn/e/0nat18/M9oqLoDUYekkgJaVfTaHr/\n\t1RVYpBm8S+GZOr04SRJ58HXaE82/Or13BmUPN9BoFn0+lkNYniU+PtQSGs4xGa89nh3z\n\tmCKyfkZMk0Te9OMdGFvtozWmk09YhAZmiNyWLlOKfRPb5+Cjlsm4j3FLyMy/412uVVF/\n\tAHeg==", "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=tcS6Herze/XO57KCIuaC04ZS3Cd91y6u2sAFJ0Y0QYc=;\n\tb=e0Zd5PucH5v0Trjt6yeE0BSdOJa97wmMQfTQQXt7Or3neOL/Lqhbr56Siq0SEEI/rd\n\tr8hPYmnqP01ajK7XfNj7L1lsgkSc6o+FTwNqn9ZMOtajY07sR6suKJ19TULlzUlBy7MF\n\tXXzPstVHpkFgOJjKJuX1iyL2mFI868GnCrRL7ix6JVgtl/knX5/1ejXFr7T2MlxkYuMO\n\t5urh2esU5AyB8Tserg4cDSl5nTRcdXhqfunyjkZ91F1SsUnRcLoxasVBPH5L042y4cF8\n\thDsHT20Bwva/JLoc7GUsToQHXc9hc8tCCSQ8FIghe1ANQ98MdjUXFA8uvzvKKxQq6Ok0\n\t7OxA==", "X-Gm-Message-State": "AHPjjUh08sjOCCyBBK8mwvZYcYV2bg1qMt0jGyB8KR+LfTIvSsUKOzcA\n\t4/3TVnMdXifnCg==", "X-Google-Smtp-Source": "ADKCNb7vZvs7t42OlzdTuEKE7RoeAicJOZpG8jluqnP2AmAADxLIQUkMncYgW6RKRl4mrb33pibNoQ==", "X-Received": "by 10.223.164.13 with SMTP id d13mr23475824wra.48.1505484294860; \n\tFri, 15 Sep 2017 07:04:54 -0700 (PDT)", "From": "Romain Izard <romain.izard.pro@gmail.com>", "To": "Nicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>,\n\tBoris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>,\n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>,\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\tAlan Stern <stern@rowland.harvard.edu>", "Cc": "linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org, linux-pwm@vger.kernel.org,\n\tlinux-serial@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tRomain Izard <romain.izard@mobile-devices.fr>,\n\tRomain Izard <romain.izard.pro@gmail.com>", "Subject": "[PATCH v2 3/9] clk: at91: pmc: Support backup for programmable\n\tclocks", "Date": "Fri, 15 Sep 2017 16:04:05 +0200", "Message-Id": "<20170915140411.31716-4-romain.izard.pro@gmail.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20170915140411.31716-1-romain.izard.pro@gmail.com>", "References": "<20170915140411.31716-1-romain.izard.pro@gmail.com>", "Sender": "linux-pwm-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-pwm.vger.kernel.org>", "X-Mailing-List": "linux-pwm@vger.kernel.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>\n---\nChanges in v2:\n* register PCKs on clock startup\n\n drivers/clk/at91/clk-programmable.c | 2 ++\n drivers/clk/at91/pmc.c | 27 +++++++++++++++++++++++++++\n drivers/clk/at91/pmc.h | 2 ++\n 3 files changed, 31 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..3910b7537152 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,10 @@ 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+/* Clock ID 0 is invalid */\n void pmc_register_id(u8 id)\n {\n \tint i;\n@@ -82,6 +86,21 @@ void pmc_register_id(u8 id)\n \t}\n }\n \n+/* Programmable Clock 0 is valid */\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@@ -103,6 +122,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\tu8 num = 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@@ -143,6 +166,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\tu8 num = 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": [ "v2", "3/9" ] }