From patchwork Mon Jan 16 06:44:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91530 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290669qgi; Sun, 15 Jan 2017 22:45:39 -0800 (PST) X-Received: by 10.84.212.144 with SMTP id e16mr48162476pli.140.1484549139546; Sun, 15 Jan 2017 22:45:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si20584929pgi.313.2017.01.15.22.45.39; Sun, 15 Jan 2017 22:45:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751412AbdAPGph (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:37 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59749 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbdAPGp2 (ORCPT ); Mon, 16 Jan 2017 01:45:28 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007R21FOAI50@mailout1.w1.samsung.com>; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064524eucas1p223ae7103f4896cc7ef91b250a2b948fe~aLZAhxWz52664726647eucas1p2x; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id A5.77.09557.30C6C785; Mon, 16 Jan 2017 06:45:23 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064523eucas1p18a55f951566df5ddd978364486154931~aLY-5wb7Q0676406764eucas1p1N; Mon, 16 Jan 2017 06:45:23 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-49-587c6c03cd80 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 64.9B.06687.B3C6C785; Mon, 16 Jan 2017 06:46:19 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:23 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 01/12] soc: samsung: pmu: Use common device name to let others to find it easily Date: Mon, 16 Jan 2017 07:44:56 +0100 Message-id: <1484549107-5957-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRmVeSWpSXmKPExsWy7djP87rMOTURBrt+W1tsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlbHvdnzBJ4GKH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WJWIQDOjRMOSXjCH WWACk8TMTw1MIFXCAkkSbe9/gM1lEVCV+NXTwgJi8wq4S/yd84wRYp+cxMljk8FqOAU8JCbu awWrEQKqmfFqKvMERt4FjAyrGEVSS4tz03OLDfWKE3OLS/PS9ZLzczcxAkN+27Gfm3cwXtoY fIhRgINRiYf3x67qCCHWxLLiytxDjBIczEoivG6ZNRFCvCmJlVWpRfnxRaU5qcWHGE2BjprI LCWanA+Mx7ySeEMTQ3NLQyNjCwtzIyMlcd6SD1fChQTSE0tSs1NTC1KLYPqYODilGhi1TzSs PxPxd069zv3QiOtLShWqb1y1m+AUceWy80yHbvWQ5dFtdteDWZ+fuHBfr8Ux1dqps2P5jLfX NuYts7+gfy3hZcrfsP7Z9pfbrO/c600pXLpnOueZlA7jFXopZtfn9gS/OPOS49ye7Es7Twdp cuus26204I6SKMdlnxbHbSln1efHJK1VYinOSDTUYi4qTgQAlG2NNI8CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064523eucas1p18a55f951566df5ddd978364486154931 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064523eucas1p18a55f951566df5ddd978364486154931 X-RootMTR: 20170116064523eucas1p18a55f951566df5ddd978364486154931 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch always set device name to "exynos-pmu" to let other drivers to find PMU device easily. This is done mainly to get regmap to access PMU registers from other drivers. This way it can be avoided to add phandle to the PMU node to almost all drivers in the SoC just to get a regmap access in the drivers. PMU is something like a SoC wide service, so there is no point modeling it as hardware dependency for all devices in device tree. Signed-off-by: Marek Szyprowski --- drivers/soc/samsung/exynos-pmu.c | 1 + include/linux/soc/samsung/exynos-pmu.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 0acdfd82e751..63bb471845cb 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -120,6 +120,7 @@ static int exynos_pmu_probe(struct platform_device *pdev) pmu_context->pmu_data->pmu_init(); platform_set_drvdata(pdev, pmu_context); + dev_set_name(dev, EXYNOS_PMU_DEV_NAME); dev_dbg(dev, "Exynos PMU Driver probe done\n"); return 0; diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h index e2e9de1acc5b..90d9205805ea 100644 --- a/include/linux/soc/samsung/exynos-pmu.h +++ b/include/linux/soc/samsung/exynos-pmu.h @@ -12,6 +12,10 @@ #ifndef __LINUX_SOC_EXYNOS_PMU_H #define __LINUX_SOC_EXYNOS_PMU_H +#include +#include +#include + enum sys_powerdown { SYS_AFTR, SYS_LPA, @@ -21,4 +25,19 @@ enum sys_powerdown { extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +#define EXYNOS_PMU_DEV_NAME "exynos-pmu" + +static inline struct regmap *exynos_get_pmu_regs(void) +{ + struct device *dev = bus_find_device_by_name(&platform_bus_type, NULL, + EXYNOS_PMU_DEV_NAME); + if (dev) { + struct regmap *regs = syscon_node_to_regmap(dev->of_node); + put_device(dev); + if (!IS_ERR(regs)) + return regs; + } + return NULL; +} + #endif /* __LINUX_SOC_EXYNOS_PMU_H */ From patchwork Mon Jan 16 06:44:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91529 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290649qgi; Sun, 15 Jan 2017 22:45:35 -0800 (PST) X-Received: by 10.99.42.78 with SMTP id q75mr7062316pgq.144.1484549135414; Sun, 15 Jan 2017 22:45:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si20584929pgi.313.2017.01.15.22.45.35; Sun, 15 Jan 2017 22:45:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbdAPGpe (ORCPT + 4 others); Mon, 16 Jan 2017 01:45:34 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:19939 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdAPGp2 (ORCPT ); Mon, 16 Jan 2017 01:45:28 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00GMZ1FP0Y50@mailout4.w1.samsung.com>; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064524eucas1p1f314f72d0fbe89e82ff07938145de3c9~aLZBF9OKD0708307083eucas1p1q; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 37.77.09557.40C6C785; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064524eucas1p1fb1b3d080298b895d95bed106879255e~aLZAayF5b0708307083eucas1p1p; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-4d-587c6c047b90 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F5.9B.06687.B3C6C785; Mon, 16 Jan 2017 06:46:19 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 02/12] soc: samsung: pmu: Use of_device_get_match_data helper Date: Mon, 16 Jan 2017 07:44:57 +0100 Message-id: <1484549107-5957-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7djP87osOTURBhfeq1hsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83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pc+/mJBcJpYpI427uKEaSKTcBQouttF1iViEAzo0TD kl4wh1lgApPEzE8NTCBVwgK+Eu9X72QDWcEioCrx/bkUSJhXwF3i5eXPzBDr5CROHpvMCmJz CnhITNzXygJiCwHVzHg1lXkCI+8CRoZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgSG/7djP zTsYL20MPsQowMGoxMP7Y1d1hBBrYllxZe4hRgkOZiURXrfMmggh3pTEyqrUovz4otKc1OJD jKZAN01klhJNzgfGY15JvKGJobmloZGxhYW5kZGSOG/JhyvhQgLpiSWp2ampBalFMH1MHJxS DYx9DZdy5S8adXU9spm3MynK00ipdnHylsuHHLcsOLRyp2rNEc3kjf+K309ksDl27WD7vpPt hVNff3743eHvgeb4NX5JrCeO7lTz/tr9R7Wbm+vzq8gtZ0S1pix6cYovQtr+T2Tp096iuSFh ta6Wm14viwj4biOd89FOTD6DI9llRc9Gi603RXuUWIozEg21mIuKEwHlS/VCjwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064524eucas1p1fb1b3d080298b895d95bed106879255e X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064524eucas1p1fb1b3d080298b895d95bed106879255e X-RootMTR: 20170116064524eucas1p1fb1b3d080298b895d95bed106879255e References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Replace custom code with generic helper to retrieve driver data. Signed-off-by: Marek Szyprowski --- drivers/soc/samsung/exynos-pmu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 63bb471845cb..0f4b4fce9d90 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -94,7 +95,6 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) static int exynos_pmu_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct resource *res; @@ -111,10 +111,7 @@ static int exynos_pmu_probe(struct platform_device *pdev) return -ENOMEM; } pmu_context->dev = dev; - - match = of_match_node(exynos_pmu_of_device_ids, dev->of_node); - - pmu_context->pmu_data = match->data; + pmu_context->pmu_data = of_device_get_match_data(dev); if (pmu_context->pmu_data->pmu_init) pmu_context->pmu_data->pmu_init(); From patchwork Mon Jan 16 06:44:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91531 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290681qgi; Sun, 15 Jan 2017 22:45:41 -0800 (PST) X-Received: by 10.99.127.71 with SMTP id p7mr38001895pgn.125.1484549141053; Sun, 15 Jan 2017 22:45:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si20584929pgi.313.2017.01.15.22.45.40; Sun, 15 Jan 2017 22:45:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbdAPGpj (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:39 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:65352 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbdAPGp3 (ORCPT ); Mon, 16 Jan 2017 01:45:29 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007TC1FQSK50@mailout2.w1.samsung.com>; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064525eucas1p1eb1fabfa555ed26e9bbba94b5fa34737~aLZBvN_lb0708307083eucas1p1u; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 19.77.09557.50C6C785; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064524eucas1p164e0f5bd1252e8599bf2570851772493~aLZBEZ1Tj0673806738eucas1p1a; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-51-587c6c05b952 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 5F.A9.10233.EFB6C785; Mon, 16 Jan 2017 06:45:18 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:24 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 03/12] soc: samsung: pmu: Remove messages for failed memory allocation Date: Mon, 16 Jan 2017 07:44:58 +0100 Message-id: <1484549107-5957-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7djPc7qsOTURBlMe81tsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlfHkzEemgndsFRMb37I2MD5h 7WLk5JAQMJGYsvEBG4QtJnHh3nogm4tDSGApo8Tt5XMZIZzPjBJdj+8wwnS8ursCKrGMUWLx 5xMsEE4Dk8Td59NZQKrYBAwlut52gc0SEWhmlJh5dy87iMMs0Mck8XnzXrBZwgIREjPbNzN3 MXJwsAioSpw6EwAS5hVwlzj9fS4LxDo5iZPHJoMdyyngITFxXyvYNgmBbnaJlp9PWUB6JQRk JTYdYIaod5G4cWYRE4QtLPHq+BZ2CFtG4vLkbqiZ/YwSTa3aEPYMRolzb3khbGuJw8cvgu1i FuCTmLRtOjPEeF6JjjYhiBIPiYWHe5ggwo4Sez7kQ/w+m1Hi/aONzBMYZRYwMqxiFEktLc5N Ty021itOzC0uzUvXS87P3cQIjPPT/45/2sH49YTVIUYBDkYlHt4FO6ojhFgT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jMv+0XNsj5ROUf4QfO8P1Ny d1/W3PrQw4FV08VihlplemuDlZNX/qy2xUosxRmJhlrMRcWJAFoFiCKQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064524eucas1p164e0f5bd1252e8599bf2570851772493 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064524eucas1p164e0f5bd1252e8599bf2570851772493 X-RootMTR: 20170116064524eucas1p164e0f5bd1252e8599bf2570851772493 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Memory subsystem already prints message about failed memory allocation, there is no need to do it in the driver. Signed-off-by: Marek Szyprowski --- drivers/soc/samsung/exynos-pmu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 0f4b4fce9d90..43937a3aea28 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -106,10 +106,8 @@ static int exynos_pmu_probe(struct platform_device *pdev) pmu_context = devm_kzalloc(&pdev->dev, sizeof(struct exynos_pmu_context), GFP_KERNEL); - if (!pmu_context) { - dev_err(dev, "Cannot allocate memory.\n"); + if (!pmu_context) return -ENOMEM; - } pmu_context->dev = dev; pmu_context->pmu_data = of_device_get_match_data(dev); From patchwork Mon Jan 16 06:44:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91533 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290707qgi; Sun, 15 Jan 2017 22:45:46 -0800 (PST) X-Received: by 10.98.85.198 with SMTP id j189mr35506982pfb.182.1484549146613; Sun, 15 Jan 2017 22:45:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si20657547pfe.90.2017.01.15.22.45.46; Sun, 15 Jan 2017 22:45:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbdAPGpo (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:44 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59749 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbdAPGp3 (ORCPT ); Mon, 16 Jan 2017 01:45:29 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV008Q81FRPD50@mailout1.w1.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064526eucas1p17db09bf159e736a626414fedc7b4c71c~aLZCUGFC40673806738eucas1p1e; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 50.87.16908.80C6C785; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064525eucas1p123df65dedceef6e3efe255e9a2ec6d07~aLZBp0SG_0673806738eucas1p1d; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-ae-587c6c0845fc Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 40.B9.10233.FFB6C785; Mon, 16 Jan 2017 06:45:19 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 04/12] pinctrl: samsung: Document Exynos3250 SoC support Date: Mon, 16 Jan 2017 07:44:59 +0100 Message-id: <1484549107-5957-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7djP87ocOTURBr/nylhsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesP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Oes6J/5ibmB8RZHFyMnh4SAiUTH kT3MELaYxIV769m6GLk4hASWMErcmfadGcJpYpJY2djIBFLFJmAo0fW2C6xKRKCZUaJhSS+Y wywwgUli5qcGsCphAQ+JJ2+ugs1lEVCVODh5GyOIzSvgLvH9UDsjxD45iZPHJrOC2JxA9RP3 tbKA2EJANTNeTWWewMi7gJFhFaNIamlxbnpusZFecWJucWleul5yfu4mRmDQbzv2c8sOxq53 wYcYBTgYlXh4F+yojhBiTSwrrsw9xCjBwawkwuuWWRMhxJuSWFmVWpQfX1Sak1p8iNEU6KiJ zFKiyfnAiMwriTc0MTS3NDQytrAwNzJSEued+uFKuJBAemJJanZqakFqEUwfEwenVAPj7gh2 heL0FS9Eg66zFuiuSHz4ouNRb9PfeFapRSIhMj+nt2gJ5P6esP1I8opk1t/u1n86ZpidP84Z 5z/FViTIbnFA/YvQOyo+h1hjWhkrLi7jXTH5wRQlg8PtSQo7kj+1TyjMixX75JLl8G/uwhUX 79rEtK4s6db49Msv0FT9UHKG5b5anlIlluKMREMt5qLiRAAm0naekAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064525eucas1p123df65dedceef6e3efe255e9a2ec6d07 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064525eucas1p123df65dedceef6e3efe255e9a2ec6d07 X-RootMTR: 20170116064525eucas1p123df65dedceef6e3efe255e9a2ec6d07 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add missing compatible id for Exynos3250 SoC to device tree docs. Exynos pin control driver supports it since commit d97f5b9804bfcdc1 ("pinctrl: exynos: Add driver data for Exynos3250"). Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | 1 + 1 file changed, 1 insertion(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index 1baf19eecabf..5e00a21de2bf 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -13,6 +13,7 @@ Required Properties: - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller, - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller, - "samsung,s5pv210-pinctrl": for S5PV210-compatible pin-controller, + - "samsung,exynos3250-pinctrl": for Exynos3250 compatible pin-controller. - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. From patchwork Mon Jan 16 06:45:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91534 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290720qgi; Sun, 15 Jan 2017 22:45:49 -0800 (PST) X-Received: by 10.84.143.68 with SMTP id 62mr48205712ply.63.1484549149269; Sun, 15 Jan 2017 22:45:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si20657547pfe.90.2017.01.15.22.45.49; Sun, 15 Jan 2017 22:45:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbdAPGpr (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:47 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:19939 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbdAPGpa (ORCPT ); Mon, 16 Jan 2017 01:45:30 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00HMJ1FR6550@mailout4.w1.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064526eucas1p2f51d27c4b6c61c7162d1f6364036b7cd~aLZCo8a0Z2654126541eucas1p2F; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 48.E5.17477.60C6C785; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064525eucas1p1556f795af7e2323726ca9a89943c7309~aLZB4ne-l0676406764eucas1p1W; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-1d-587c6c06fc3a Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C6.9B.06687.D3C6C785; Mon, 16 Jan 2017 06:46:21 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:25 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 05/12] pinctrl: samsung: Remove messages for failed memory allocation Date: Mon, 16 Jan 2017 07:45:00 +0100 Message-id: <1484549107-5957-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7psOTURBrdm8ltsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlfH18iXGgs1aFZu63rI2ML5R 6mLk5JAQMJG4eGYOK4QtJnHh3nq2LkYuDiGBpYwSr25cYYVwPjNKXHx5igWm49v541CJZYwS Zy7PYAdJCAk0MEksf2MEYrMJGEp0ve0CGyUi0MwoMfPuXnYQh1mgj0ni8+a9jCBVwgLhEp07 V4F1swioSuz/vQnM5hVwl9iw6gnUOjmJk8cmgx3IKeAhMXFfKwvIIAmBbnaJv43rgRIcQI6s xKYDzBD1LhKbXl9jh7CFJV4d3wJly0h0dhxkgrD7GSWaWrUh7BmMEufe8kLY1hK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WpRTB9TBycUg2MqZen 8zqYLijo9hEUsrZQPiebqWjIfGNum3mly2zugNul3OtquSOvf7R5ItV3Lb33+SyuF2qRN/+3 pPK8r7TP6rJ30HkqsjKo7+CFD0WHmIRnmSzeUXVo4ro3Bx5LBqTo/ZaY2S9kzSX/zUat9Sv3 vbxTPlW+W8+yqP1/X3OsOeTKb4vJW24rsRRnJBpqMRcVJwIAsOoI85ECAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064525eucas1p1556f795af7e2323726ca9a89943c7309 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064525eucas1p1556f795af7e2323726ca9a89943c7309 X-RootMTR: 20170116064525eucas1p1556f795af7e2323726ca9a89943c7309 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Memory subsystem already prints message about failed memory allocation, there is no need to do it in the drivers. Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 8 ++------ drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 12 +++--------- drivers/pinctrl/samsung/pinctrl-samsung.c | 24 ++++++------------------ 3 files changed, 11 insertions(+), 33 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Krzysztof Kozlowski diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 24814db251a7..bf753a596209 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -528,10 +528,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) weint_data = devm_kzalloc(dev, bank->nr_pins * sizeof(*weint_data), GFP_KERNEL); - if (!weint_data) { - dev_err(dev, "could not allocate memory for weint_data\n"); + if (!weint_data) return -ENOMEM; - } for (idx = 0; idx < bank->nr_pins; ++idx) { irq = irq_of_parse_and_map(bank->of_node, idx); @@ -559,10 +557,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) muxed_data = devm_kzalloc(dev, sizeof(*muxed_data) + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL); - if (!muxed_data) { - dev_err(dev, "could not allocate memory for muxed_data\n"); + if (!muxed_data) return -ENOMEM; - } irq_set_chained_handler_and_data(irq, exynos_irq_demux_eint16_31, muxed_data); diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index 4c632812ccff..f17890aa6e25 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c @@ -489,10 +489,8 @@ static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d) data = devm_kzalloc(dev, sizeof(*data) + nr_domains * sizeof(*data->domains), GFP_KERNEL); - if (!data) { - dev_err(dev, "failed to allocate handler data\n"); + if (!data) return -ENOMEM; - } data->drvdata = d; bank = d->pin_banks; @@ -715,10 +713,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d) return -ENODEV; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); - if (!data) { - dev_err(dev, "could not allocate memory for wkup eint data\n"); + if (!data) return -ENOMEM; - } data->drvdata = d; for (i = 0; i < NUM_EINT0_IRQ; ++i) { @@ -751,10 +747,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d) ddata = devm_kzalloc(dev, sizeof(*ddata) + nr_eints, GFP_KERNEL); - if (!ddata) { - dev_err(dev, "failed to allocate domain data\n"); + if (!ddata) return -ENOMEM; - } ddata->bank = bank; bank->irq_domain = irq_domain_add_linear(bank->of_node, diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 3bc925f61b71..b11e67e85460 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -93,10 +93,8 @@ static int reserve_map(struct device *dev, struct pinctrl_map **map, return 0; new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL); - if (!new_map) { - dev_err(dev, "krealloc(map) failed\n"); + if (!new_map) return -ENOMEM; - } memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map)); @@ -133,10 +131,8 @@ static int add_map_configs(struct device *dev, struct pinctrl_map **map, dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs), GFP_KERNEL); - if (!dup_configs) { - dev_err(dev, "kmemdup(configs) failed\n"); + if (!dup_configs) return -ENOMEM; - } (*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP; (*map)[*num_maps].data.configs.group_or_pin = group; @@ -156,10 +152,8 @@ static int add_config(struct device *dev, unsigned long **configs, new_configs = krealloc(*configs, sizeof(*new_configs) * new_num, GFP_KERNEL); - if (!new_configs) { - dev_err(dev, "krealloc(configs) failed\n"); + if (!new_configs) return -ENOMEM; - } new_configs[old_num] = config; @@ -756,10 +750,8 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions( functions = devm_kzalloc(dev, func_cnt * sizeof(*functions), GFP_KERNEL); - if (!functions) { - dev_err(dev, "failed to allocate memory for function list\n"); + if (!functions) return ERR_PTR(-EINVAL); - } func = functions; /* @@ -850,10 +842,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev, pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) * drvdata->nr_pins, GFP_KERNEL); - if (!pindesc) { - dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n"); + if (!pindesc) return -ENOMEM; - } ctrldesc->pins = pindesc; ctrldesc->npins = drvdata->nr_pins; @@ -867,10 +857,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev, */ pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH * drvdata->nr_pins, GFP_KERNEL); - if (!pin_names) { - dev_err(&pdev->dev, "mem alloc for pin names failed\n"); + if (!pin_names) return -ENOMEM; - } /* for each pin, the name of the pin is pin-bank name + pin number */ for (bank = 0; bank < drvdata->nr_banks; bank++) { From patchwork Mon Jan 16 06:45:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91532 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290695qgi; Sun, 15 Jan 2017 22:45:44 -0800 (PST) X-Received: by 10.99.248.17 with SMTP id n17mr37274628pgh.17.1484549144380; Sun, 15 Jan 2017 22:45:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si20657547pfe.90.2017.01.15.22.45.44; Sun, 15 Jan 2017 22:45:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdAPGpl (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:41 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:55474 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdAPGp3 (ORCPT ); Mon, 16 Jan 2017 01:45:29 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00EGP1FRXZ50@mailout3.w1.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064527eucas1p15124572e288748f2167383822ac771e5~aLZDLOSwL1341113411eucas1p1K; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id C9.77.09557.60C6C785; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064526eucas1p1e3064fad71a3ab8de34d306dec531b14~aLZClng4D1341013410eucas1p1G; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-53-587c6c0632e1 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 01.B9.10233.00C6C785; Mon, 16 Jan 2017 06:45:20 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 06/12] pinctrl: samsung: Add missing initconst annotation Date: Mon, 16 Jan 2017 07:45:01 +0100 Message-id: <1484549107-5957-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7djPc7psOTURBt/eGllsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAldF95zFLwWXliqv35rI1MB6T 62Lk5JAQMJH4f/c7O4QtJnHh3nq2LkYuDiGBpYwScyfNYIFwPjNKXHg7hRGmY+vPdkaIxDJG ifdvrkI5DUwSE5c1gs1iEzCU6HrbBTZLRKCZUWLm3b3sIA6zQB+TxOfNe8FmCQt4Siz5Pxco wc7BIqAqcYYPJMor4C6xd+J5FohtchInj01mBbE5BTwkJu5rhYr3s0tMmwRkcwDZshKbDjBD hF0kfnx/yQZhC0u8Or4F6jUZicuTu2FaGSWaWrUh7BmMEufe8kLY1hKHj18EW8UswCcxadt0 ZojxvBIdbUIQJR4SL+89gBrvKNFwtYUd4vXZwNDacIV5AqPMAkaGVYwiqaXFuempxcZ6xYm5 xaV56XrJ+bmbGIFRfvrf8U87GL+esDrEKMDBqMTDu2BHdYQQa2JZcWXuIUYJDmYlEV63zJoI Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4rx7FlwJFxJITyxJzU5NLUgtgskycXBKNTDO2hp5tjh4 1tHkO5M2Oa47sFZucnLP0zelR3r3zps9u3OaaJ1Ikyr3lri7OdkHlvwoXTlD7uITQ8bXWfl7 jLu/zvAVv6qrEHi5dvG1I8FXE9+Z8cbyW0vGOfWfOffz5fVVLbOKCrIT5hSXunveM9r7ZIum Qoo615pQ4x1N3A3MC52P+B7qsjmixFKckWioxVxUnAgAqlk/Tu4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t/xK7oMOTURBlNfyVpsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4zuO49ZCi4rV1y9N5etgfGYXBcjJ4eEgInE 1p/tjBC2mMSFe+vZuhi5OIQEljBKbLr8HcppYpLofrmGHaSKTcBQouttF1hCRKCZUaJhSS+Y wywwgUli5qcGJpAqYQFPiSX/5wJ1sHOwCKhKnOEDifIKuEvsnXieBWKbnMTJY5NZQWxOAQ+J iftaweJCQDUzXk1lnsDIu4CRYRWjSGppcW56brGRXnFibnFpXrpecn7uJkZgyG879nPLDsau d8GHGAU4GJV4eBfsqI4QYk0sK67MPcQowcGsJMLrllkTIcSbklhZlVqUH19UmpNafIjRFOik icxSosn5wHjMK4k3NDE0tzQ0MrawMDcyUhLnnfrhSriQQHpiSWp2ampBahFMHxMHp1QDo/JH ZrOvq7kmzehbWDZfrywt6b5NQfStqzlGsts/xIedd9886Tqn6popid/352gff3buL6dYs1aQ uKBI/tx/HZcWq8q+3+xs9W7GNOU9L6RvLxPw3PhA/IVm+Ym9NqE6Eu7WywJXng46v+P2vqdz Dy3J0Iz99Pvd9T0+aZ8kOKRtLj5KVw7P+qDEUpyRaKjFXFScCACeH1S6jwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064526eucas1p1e3064fad71a3ab8de34d306dec531b14 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064526eucas1p1e3064fad71a3ab8de34d306dec531b14 X-RootMTR: 20170116064526eucas1p1e3064fad71a3ab8de34d306dec531b14 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Exynos5433 support has been added in parallel to adding initconst annotation to most of the init data structures, so add those annotations also to Exynos5433 structures. Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-exynos.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index bf753a596209..70b94ad10cc1 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -1266,7 +1266,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - ALIVE */ -static const struct samsung_pin_bank_data exynos5433_pin_banks0[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst = { EXYNOS5433_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), EXYNOS5433_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), EXYNOS5433_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), @@ -1279,28 +1279,28 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - AUD */ -static const struct samsung_pin_bank_data exynos5433_pin_banks1[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks1[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), EXYNOS5433_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), }; /* pin banks of exynos5433 pin-controller - CPIF */ -static const struct samsung_pin_bank_data exynos5433_pin_banks2[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks2[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00), }; /* pin banks of exynos5433 pin-controller - eSE */ -static const struct samsung_pin_bank_data exynos5433_pin_banks3[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks3[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00), }; /* pin banks of exynos5433 pin-controller - FINGER */ -static const struct samsung_pin_bank_data exynos5433_pin_banks4[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks4[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00), }; /* pin banks of exynos5433 pin-controller - FSYS */ -static const struct samsung_pin_bank_data exynos5433_pin_banks5[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00), EXYNOS5433_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04), EXYNOS5433_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08), @@ -1310,17 +1310,17 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - IMEM */ -static const struct samsung_pin_bank_data exynos5433_pin_banks6[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks6[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00), }; /* pin banks of exynos5433 pin-controller - NFC */ -static const struct samsung_pin_bank_data exynos5433_pin_banks7[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks7[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), }; /* pin banks of exynos5433 pin-controller - PERIC */ -static const struct samsung_pin_bank_data exynos5433_pin_banks8[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00), EXYNOS5433_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04), EXYNOS5433_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08), @@ -1341,7 +1341,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - TOUCH */ -static const struct samsung_pin_bank_data exynos5433_pin_banks9[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks9[] __initconst = { EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), }; @@ -1349,7 +1349,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) * Samsung pinctrl driver data for Exynos5433 SoC. Exynos5433 SoC includes * ten gpio/pin-mux/pinconfig controllers. */ -const struct samsung_pin_ctrl exynos5433_pin_ctrl[] = { +const struct samsung_pin_ctrl exynos5433_pin_ctrl[] __initconst = { { /* pin-controller instance 0 data */ .pin_banks = exynos5433_pin_banks0, From patchwork Mon Jan 16 06:45:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91535 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290741qgi; Sun, 15 Jan 2017 22:45:53 -0800 (PST) X-Received: by 10.98.201.135 with SMTP id l7mr35527213pfk.67.1484549153042; Sun, 15 Jan 2017 22:45:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si16754054pfo.60.2017.01.15.22.45.52; Sun, 15 Jan 2017 22:45:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750980AbdAPGpv (ORCPT + 4 others); Mon, 16 Jan 2017 01:45:51 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:65352 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354AbdAPGpc (ORCPT ); Mon, 16 Jan 2017 01:45:32 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007TE1FSSK50@mailout2.w1.samsung.com>; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064527eucas1p20c8087e786dc6242293d4ded6c35d875~aLZD2zNrn2712827128eucas1p2z; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 94.26.30614.70C6C785; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064526eucas1p150c6653c9f1fac798ea79f6bee5631a1~aLZDEiHUJ1339613396eucas1p1F; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-86-587c6c07762f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id C1.B9.10233.00C6C785; Mon, 16 Jan 2017 06:45:21 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:26 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 07/12] pinctrl: samsung: Remove dead code Date: Mon, 16 Jan 2017 07:45:02 +0100 Message-id: <1484549107-5957-8-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7djP87rsOTURBt8fK1lsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlbF5Q0TBZ56KX7+vsDQwvubq YuTkkBAwkTj3cj4zhC0mceHeerYuRi4OIYGljBKPDz5lgXA+M0rs7rzMCNOx6NtBJhBbSGAZ o8SjT+wQRQ1MEhOXNbKDJNgEDCW63naBjRIRaGaUmHl3L1gVs0Afk8TnzXvBRgkLWEp0dV8D sjk4WARUJW7skgEJ8wq4S7Sv6YG6SU7i5LHJrCA2p4CHxMR9rWAnSQh0s0tsO3eeDaRXQkBW YtMBqHoXiSd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sJZqcD4zFvJJ4QxNDc0tDI2MLC3MjIyVx3qkfroQLCaQnlqRmp6YWpBbB9DFxcEo1MB7Q z9FvnS+iKr2+Pd1gRR6bXXvx8/ZtG6uWhLdZ2C/Y/f+6X7r69GUrjj72/PZuzQOmkCsBEzLM n7+VEm4WuqfyvMu07OrxBRrfzwktrf/PYajBxPLyewuzy+3Gu3YcNrmmTQvrRU4U2nmmL+zY 7yD443tOkLOHgMzc6UK6KSybbi+26V32VomlOCPRUIu5qDgRABA9NCKNAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064526eucas1p150c6653c9f1fac798ea79f6bee5631a1 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064526eucas1p150c6653c9f1fac798ea79f6bee5631a1 X-RootMTR: 20170116064526eucas1p150c6653c9f1fac798ea79f6bee5631a1 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 'enable' parameter has been removed a while ago, so all code for handling it can be simply removed. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index b11e67e85460..7648a280c0f4 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -350,7 +350,7 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata, /* enable or disable a pinmux function */ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector, - unsigned group, bool enable) + unsigned group) { struct samsung_pinctrl_drv_data *drvdata; const struct samsung_pin_bank_type *type; @@ -380,8 +380,7 @@ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector, data = readl(reg + type->reg_offset[PINCFG_TYPE_FUNC]); data &= ~(mask << shift); - if (enable) - data |= func->val << shift; + data |= func->val << shift; writel(data, reg + type->reg_offset[PINCFG_TYPE_FUNC]); spin_unlock_irqrestore(&bank->slock, flags); @@ -392,7 +391,7 @@ static int samsung_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned selector, unsigned group) { - samsung_pinmux_setup(pctldev, selector, group, true); + samsung_pinmux_setup(pctldev, selector, group); return 0; } From patchwork Mon Jan 16 06:45:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91540 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290780qgi; Sun, 15 Jan 2017 22:46:01 -0800 (PST) X-Received: by 10.84.138.3 with SMTP id 3mr48354447plo.108.1484549161470; Sun, 15 Jan 2017 22:46:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g191si20612519pgc.78.2017.01.15.22.46.01; Sun, 15 Jan 2017 22:46:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751321AbdAPGp7 (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:59 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59749 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbdAPGpc (ORCPT ); Mon, 16 Jan 2017 01:45:32 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007R61FSAI50@mailout1.w1.samsung.com>; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064528eucas1p2f38a40e056a14f693f63d5ade44503f3~aLZEDepU52675826758eucas1p2s; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 45.26.30614.70C6C785; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1~aLZDTr1gF1341013410eucas1p1H; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-87-587c6c07d603 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B7.9B.06687.F3C6C785; Mon, 16 Jan 2017 06:46:23 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 08/12] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Mon, 16 Jan 2017 07:45:03 +0100 Message-id: <1484549107-5957-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7rsOTURBl9/aVpsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlbHs9z/2gmO8Fbtn3GBuYNzN 3cXIySEhYCJxdkM3E4QtJnHh3nq2LkYuDiGBpYwSew+9ZIZwPjNKHNnSygzTsfrdcRaIxDJG ic2Hr0K1NDBJHF3ylxGkik3AUKLrbRdYQkSgmVFi5t297CAOs0Afk8TnzXvBqoQFwiTuT5wO tp1FQFXi6IUL7CA2r4C7xLH2AywQ++QkTh6bzApicwp4SEzc1wq2W0Kgn13iwJf9QIM4gBxZ iU0HoO5zkXi8ZAqULSzx6vgWdghbRqKz4yDUp/2MEk2t2hD2DEaJc295IWxricPHL4LtYhbg k5i0bTozxHheiY42IYgSD4mzy+ayQ4QdJeaslYN4fjajxKfG2SwTGGUWMDKsYhRJLS3OTU8t NtIrTswtLs1L10vOz93ECIz00/+Of9zB+P6E1SFGAQ5GJR7eBTuqI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WvD2vdOTZdrDqg6TU88/E6Gxbi8 yVeITTqvc8fBjyce5NVbVWVseGVx8sd8iVQlluKMREMt5qLiRACNtXLekQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 X-RootMTR: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Replace custom code with generic helper. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 7648a280c0f4..86f23842f681 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -955,15 +956,13 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, return 0; } -static const struct of_device_id samsung_pinctrl_dt_match[]; - /* retrieve the soc specific data */ static const struct samsung_pin_ctrl * samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, struct platform_device *pdev) { int id; - const struct of_device_id *match; + const struct samsung_pin_ctrl *match_data; struct device_node *node = pdev->dev.of_node; struct device_node *np; const struct samsung_pin_bank_data *bdata; @@ -978,8 +977,8 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, dev_err(&pdev->dev, "failed to get alias id\n"); return ERR_PTR(-ENOENT); } - match = of_match_node(samsung_pinctrl_dt_match, node); - ctrl = (struct samsung_pin_ctrl *)match->data + id; + match_data = of_device_get_match_data(&pdev->dev); + ctrl = match_data + id; d->suspend = ctrl->suspend; d->resume = ctrl->resume; From patchwork Mon Jan 16 06:45:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91539 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290776qgi; Sun, 15 Jan 2017 22:46:00 -0800 (PST) X-Received: by 10.98.106.132 with SMTP id f126mr7116434pfc.1.1484549160531; Sun, 15 Jan 2017 22:46:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si16754054pfo.60.2017.01.15.22.46.00; Sun, 15 Jan 2017 22:46:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbdAPGp5 (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:57 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:19939 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751358AbdAPGpc (ORCPT ); Mon, 16 Jan 2017 01:45:32 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00FN31FTR450@mailout4.w1.samsung.com>; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064528eucas1p25b291bfbf4f2601d411ee1ede3e2d8b5~aLZElnPxK2654126541eucas1p2H; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id DC.0A.28517.80C6C785; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064527eucas1p1f0f78e9420e7d9d60d94b6e7381caeb1~aLZEBW-Wq1341013410eucas1p1I; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-fd-587c6c08b166 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E2.B9.10233.20C6C785; Mon, 16 Jan 2017 06:45:22 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 09/12] pinctrl: samsung: Add infrastructure for pin-bank retention control Date: Mon, 16 Jan 2017 07:45:04 +0100 Message-id: <1484549107-5957-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87ocOTURBsuaRC02zljPanH+/AZ2 iyl/ljNZbHp8jdVi8/w/jBafe48wWsw4v4/JYu2Ru+wWh9+0s1qs2vWH0YHLY+esu+wem1Z1 snncubaHzWPzknqPvi2rGD0+b5ILYIvisklJzcksSy3St0vgyvjz5hJLwTPNik1/trM2ML5Q 6mLk5JAQMJHYcu0wK4QtJnHh3nq2LkYuDiGBpYwS35pfsUA4nxklLk47zgzTsWnZPKiqZYwS s/e/hnIamCSOLvnLCFLFJmAo0fW2CywhItDMKDHz7l52EIdZoI9J4vPmvWBVwgIxEptfN7KD 2CwCqhI3nzczgdi8Ah4Ssy+sZIHYJydx8thksAs5geIT97VCxbvZJa535nYxcgDZshKbDkCd 5yKxYcFbdghbWOLV8S1QtozE5cndUK39jBJNrdoQ9gxGiXNveSFsa4nDxy+CrWIW4JOYtG06 M8R4XomONiGIEg+Ji1suMUHYjhJLXs9ghnh+NqPEmYUnWCYwyixgZFjFKJJaWpybnlpsolec mFtcmpeul5yfu4kRGOmn/x3/soNx8TGrQ4wCHIxKPLwLdlRHCLEmlhVX5h5ilOBgVhLhdcus iRDiTUmsrEotyo8vKs1JLT7EKM3BoiTOu2fBlXAhgfTEktTs1NSC1CKYLBMHp1QDY0twFm98 blHh9rXGD2JPTDYVUry6r0WM5ZD0YiNZqeYw1U/XV0QGyiydv2TiPb10jeMLp7jbXUm+qu93 b4Ky6mbVa36Kz2tcnyx+7fLANyoxoSbTuCTSbfLbs/4HV89lW5OaPlH6QmNWioDSue1GVS6v DjttENyXM+1S7P6c120rj9kUybQyKrEUZyQaajEXFScCAJb/WZXwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t/xK7pMOTURBpseMVpsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4w/by6xFDzTrNj0ZztrA+MLpS5GTg4JAROJ TcvmsUHYYhIX7q0Hsrk4hASWMEq8eH2fEcJpYpJYfXgOWBWbgKFE19susCoRgWZGiYYlvWAO s8AEJomZnxqYQKqEBWIkNr9uZAexWQRUJW4+bwaL8wp4SMy+sJIFYp+cxMljk1lBbE6g+MR9 rWBxIQF3iRmvpjJPYORdwMiwilEktbQ4Nz232EivODG3uDQvXS85P3cTIzDstx37uWUHY9e7 4EOMAhyMSjy8C3ZURwixJpYVV+YeYpTgYFYS4XXLrIkQ4k1JrKxKLcqPLyrNSS0+xGgKdNRE ZinR5HxgTOaVxBuaGJpbGhoZW1iYGxkpifNO/XAlXEggPbEkNTs1tSC1CKaPiYNTqoHRd8d6 vVULyvs/f33iO+vzaad54Y+OfHttuHCDVdOND93Tj8e287kdlTtW72glvv7X8rX1+nP/xVz0 6VLjWbj1+qz4VzcqOuYcfLSca7+XXG/+2o4jBfscpnI6rlz7qr15BtvP65OSH99ZnPtgYoOJ aYGgVds7t2Rds5lrztr+KrVMVmMv4V+sqcRSnJFoqMVcVJwIAGgs7NCRAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064527eucas1p1f0f78e9420e7d9d60d94b6e7381caeb1 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064527eucas1p1f0f78e9420e7d9d60d94b6e7381caeb1 X-RootMTR: 20170116064527eucas1p1f0f78e9420e7d9d60d94b6e7381caeb1 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Pad retention control after suspend/resume cycle should be done from pin controller driver instead of PMU (power management unit) driver to avoid possible ordering and logical dependencies. Till now it worked fine only because PMU driver registered its sys_ops after pin controller. This patch adds infrastructure to handle pad retention during pin control driver resume. Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 ++++++--- drivers/pinctrl/samsung/pinctrl-samsung.h | 42 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 86f23842f681..95a84086a2e9 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1075,6 +1075,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) ctrl->eint_gpio_init(drvdata); if (ctrl->eint_wkup_init) ctrl->eint_wkup_init(drvdata); + if (ctrl->retention_data && ctrl->retention_data->init) + drvdata->retention_ctrl = ctrl->retention_data->init(drvdata, + ctrl->retention_data); platform_set_drvdata(pdev, drvdata); @@ -1127,15 +1130,15 @@ static void samsung_pinctrl_suspend_dev( if (drvdata->suspend) drvdata->suspend(drvdata); + if (drvdata->retention_ctrl && drvdata->retention_ctrl->on) + drvdata->retention_ctrl->on(drvdata); + } /** * samsung_pinctrl_resume_dev - restore pinctrl state from suspend for a device * * Restore one of the banks that was saved during suspend. - * - * We don't bother doing anything complicated to avoid glitching lines since - * we're called before pad retention is turned off. */ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) { @@ -1174,6 +1177,9 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (widths[type]) writel(bank->pm_save[type], reg + offs[type]); } + + if (drvdata->retention_ctrl && drvdata->retention_ctrl->off) + drvdata->retention_ctrl->off(drvdata); } /** diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index 6f7ce7539a00..6079142422f8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -185,10 +185,48 @@ struct samsung_pin_bank { }; /** + * struct samsung_retention_data: runtime pin-bank retention control data. + * @regs: array of PMU registers to control pad retention. + * @nr_regs: number of registers in @regs array. + * @value: value to store to registers to turn off retention. + * @refcnt: atomic counter if retention control affects more than one bank. + * @priv: retention control code private data + * @on: platform specific callback to enter retention mode. + * @off: platform specific callback to exit retention mode. + **/ +struct samsung_retention_ctrl { + const u32 *regs; + int nr_regs; + u32 value; + atomic_t *refcnt; + void *priv; + void (*on)(struct samsung_pinctrl_drv_data *); + void (*off)(struct samsung_pinctrl_drv_data *); +}; + +/** + * struct samsung_retention_data: represent a pin-bank retention control data. + * @regs: array of PMU registers to control pad retention. + * @nr_regs: number of registers in @regs array. + * @value: value to store to registers to turn off retention. + * @refcnt: atomic counter if retention control affects more than one bank. + * @init: platform specific callback to initialize retention control. + **/ +struct samsung_retention_data { + const u32 *regs; + int nr_regs; + u32 value; + atomic_t *refcnt; + struct samsung_retention_ctrl *(*init)(struct samsung_pinctrl_drv_data *, + const struct samsung_retention_data *); +}; + +/** * struct samsung_pin_ctrl: represent a pin controller. * @pin_banks: list of pin banks included in this controller. * @nr_banks: number of pin banks. * @nr_ext_resources: number of the extra base address for pin banks. + * @retention_data: configuration data for retention control. * @eint_gpio_init: platform specific callback to setup the external gpio * interrupts for the controller. * @eint_wkup_init: platform specific callback to setup the external wakeup @@ -198,6 +236,7 @@ struct samsung_pin_ctrl { const struct samsung_pin_bank_data *pin_banks; u32 nr_banks; int nr_ext_resources; + const struct samsung_retention_data *retention_data; int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); @@ -219,6 +258,7 @@ struct samsung_pin_ctrl { * @nr_function: number of such pin functions. * @pin_base: starting system wide pin number. * @nr_pins: number of pins supported by the controller. + * @retention_ctrl: retention control runtime data. */ struct samsung_pinctrl_drv_data { struct list_head node; @@ -238,6 +278,8 @@ struct samsung_pinctrl_drv_data { unsigned int pin_base; unsigned int nr_pins; + const struct samsung_retention_ctrl *retention_ctrl; + void (*suspend)(struct samsung_pinctrl_drv_data *); void (*resume)(struct samsung_pinctrl_drv_data *); }; From patchwork Mon Jan 16 06:45:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91537 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290768qgi; Sun, 15 Jan 2017 22:45:59 -0800 (PST) X-Received: by 10.98.14.84 with SMTP id w81mr26758952pfi.168.1484549159029; Sun, 15 Jan 2017 22:45:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si16754054pfo.60.2017.01.15.22.45.58; Sun, 15 Jan 2017 22:45:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdAPGpx (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:53 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:19939 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbdAPGpf (ORCPT ); Mon, 16 Jan 2017 01:45:35 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00HMM1FT6550@mailout4.w1.samsung.com>; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064529eucas1p215d5813263b43bd175b0554c7719c983~aLZFO94cB2664326643eucas1p2-; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 41.87.16908.B0C6C785; Mon, 16 Jan 2017 06:45:31 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064528eucas1p207c927835e33568e447c5a42ad18d0a7~aLZEe4A1_1219312193eucas1p2d; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-b4-587c6c0b3382 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B3.B9.10233.20C6C785; Mon, 16 Jan 2017 06:45:22 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 10/12] pinctrl: samsung: Move retention control from mach-exynos to the pinctrl driver Date: Mon, 16 Jan 2017 07:45:05 +0100 Message-id: <1484549107-5957-11-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsWy7djPc7rcOTURBgtmqFpsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlfHszEXGgofVFU3H57I3MO7O 6GLk5JAQMJF4umkJM4QtJnHh3no2EFtIYBmjRO9umS5GLiD7M6PE1NutTF2MHGAN0/4FQcSB ak5+v8EI4TQwSTxuO88C0s0mYCjR9baLDSQhItDMKDHz7l52EIdZoI9J4vPmvYwgVcICGRIb DrwBs1kEVCUebX4HtoJXwEPi0HtJiJPkJE4em8wKYnMChSfua2UBmSMhMJld4taMRywQJ8lK bDoA9YKLxIcZc9khbGGJV8e3QNkyEpcnd7NA2P2MEk2t2hD2DEaJc295IWxricPHL4LtYhbg k5i0bTozxHheiY42IQjTQ2LttmgI01Hi23cPiNdnM0r86TjKOIFRZgEjwypGkdTS4tz01GJD veLE3OLSvHS95PzcTYzACD/97/j7HYxPm0MOMQpwMCrx8C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+mYQuiOmWrh+cXXZH8WqTBYyOecs1oW H35qfli2E7+ajc+a4rqIv+azxPlKF/k8mPFyyWUlluKMREMt5qLiRACQJI16jwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064528eucas1p207c927835e33568e447c5a42ad18d0a7 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064528eucas1p207c927835e33568e447c5a42ad18d0a7 X-RootMTR: 20170116064528eucas1p207c927835e33568e447c5a42ad18d0a7 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This patch moves pad retention control from PMU driver to Exynos pin controller driver. This helps to avoid possible ordering and logical dependencies between machine, PMU and pin control code. Till now it worked fine only because sys_ops for PMU and pin controller were called in registration order. This is also a preparation for adding new features to Exynos pin controller driver, like runtime power management and suspending individual pin controllers, which might be a part of some power domain. Signed-off-by: Marek Szyprowski --- arch/arm/mach-exynos/suspend.c | 64 ------------- drivers/pinctrl/samsung/pinctrl-exynos.c | 149 +++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 64 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 25e7c5326259..312d3a886e92 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -57,7 +57,6 @@ struct exynos_wkup_irq { struct exynos_pm_data { const struct exynos_wkup_irq *wkup_irq; unsigned int wake_disable_mask; - const unsigned int *release_ret_regs; void (*pm_prepare)(void); void (*pm_resume_prepare)(void); @@ -95,47 +94,6 @@ struct exynos_pm_data { { /* sentinel */ }, }; -static const unsigned int exynos_release_ret_regs[] = { - S5P_PAD_RET_MAUDIO_OPTION, - S5P_PAD_RET_GPIO_OPTION, - S5P_PAD_RET_UART_OPTION, - S5P_PAD_RET_MMCA_OPTION, - S5P_PAD_RET_MMCB_OPTION, - S5P_PAD_RET_EBIA_OPTION, - S5P_PAD_RET_EBIB_OPTION, - REG_TABLE_END, -}; - -static const unsigned int exynos3250_release_ret_regs[] = { - S5P_PAD_RET_MAUDIO_OPTION, - S5P_PAD_RET_GPIO_OPTION, - S5P_PAD_RET_UART_OPTION, - S5P_PAD_RET_MMCA_OPTION, - S5P_PAD_RET_MMCB_OPTION, - S5P_PAD_RET_EBIA_OPTION, - S5P_PAD_RET_EBIB_OPTION, - S5P_PAD_RET_MMC2_OPTION, - S5P_PAD_RET_SPI_OPTION, - REG_TABLE_END, -}; - -static const unsigned int exynos5420_release_ret_regs[] = { - EXYNOS_PAD_RET_DRAM_OPTION, - EXYNOS_PAD_RET_MAUDIO_OPTION, - EXYNOS_PAD_RET_JTAG_OPTION, - EXYNOS5420_PAD_RET_GPIO_OPTION, - EXYNOS5420_PAD_RET_UART_OPTION, - EXYNOS5420_PAD_RET_MMCA_OPTION, - EXYNOS5420_PAD_RET_MMCB_OPTION, - EXYNOS5420_PAD_RET_MMCC_OPTION, - EXYNOS5420_PAD_RET_HSI_OPTION, - EXYNOS_PAD_RET_EBIA_OPTION, - EXYNOS_PAD_RET_EBIB_OPTION, - EXYNOS5420_PAD_RET_SPI_OPTION, - EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION, - REG_TABLE_END, -}; - static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) { const struct exynos_wkup_irq *wkup_irq; @@ -441,15 +399,6 @@ static int exynos5420_pm_suspend(void) return 0; } -static void exynos_pm_release_retention(void) -{ - unsigned int i; - - for (i = 0; (pm_data->release_ret_regs[i] != REG_TABLE_END); i++) - pmu_raw_writel(EXYNOS_WAKEUP_FROM_LOWPWR, - pm_data->release_ret_regs[i]); -} - static void exynos_pm_resume(void) { u32 cpuid = read_cpuid_part(); @@ -457,9 +406,6 @@ static void exynos_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - if (cpuid == ARM_CPU_PART_CORTEX_A9) scu_enable(S5P_VA_SCU); @@ -481,9 +427,6 @@ static void exynos3250_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION); if (call_firmware_op(resume) == -ENOSYS @@ -521,9 +464,6 @@ static void exynos5420_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3); early_wakeup: @@ -636,7 +576,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos3250_pm_data = { .wkup_irq = exynos3250_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos3250_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos3250_pm_resume, .pm_prepare = exynos3250_pm_prepare, @@ -646,7 +585,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos4_pm_data = { .wkup_irq = exynos4_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos_pm_resume, .pm_prepare = exynos_pm_prepare, @@ -656,7 +594,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos5250_pm_data = { .wkup_irq = exynos5250_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos_pm_resume, .pm_prepare = exynos_pm_prepare, @@ -666,7 +603,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos5420_pm_data = { .wkup_irq = exynos5250_wkup_irq, .wake_disable_mask = (0x7F << 7) | (0x1F << 1), - .release_ret_regs = exynos5420_release_ret_regs, .pm_resume_prepare = exynos5420_prepare_pm_resume, .pm_resume = exynos5420_pm_resume, .pm_suspend = exynos5420_pm_suspend, diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 70b94ad10cc1..652d3eabe1e5 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -28,7 +28,10 @@ #include #include #include +#include #include +#include +#include #include "pinctrl-samsung.h" #include "pinctrl-exynos.h" @@ -690,6 +693,58 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }, }; +/* Pad retention control code for accessing PMU regmap */ +static atomic_t exynos_shared_retention_refcnt; + +static void exynos_retention_on(struct samsung_pinctrl_drv_data *drvdata) +{ + if (drvdata->retention_ctrl->refcnt) + atomic_inc(drvdata->retention_ctrl->refcnt); +} + +static void exynos_retention_off(struct samsung_pinctrl_drv_data *drvdata) +{ + struct regmap *pmu_regs = drvdata->retention_ctrl->priv; + int i; + + if (drvdata->retention_ctrl->refcnt && + !atomic_dec_and_test(drvdata->retention_ctrl->refcnt)) + return; + + for (i = 0; i < drvdata->retention_ctrl->nr_regs; i++) + regmap_write(pmu_regs, drvdata->retention_ctrl->regs[i], + drvdata->retention_ctrl->value); +} + +static struct samsung_retention_ctrl * +exynos_retention_init(struct samsung_pinctrl_drv_data *drvdata, + const struct samsung_retention_data *data) +{ + struct samsung_retention_ctrl *ctrl; + struct regmap *pmu_regs; + + ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return NULL; + + pmu_regs = exynos_get_pmu_regs(); + if (!pmu_regs) { + dev_err(drvdata->dev, + "failed to lookup PMU regmap, no support for pad retention\n"); + return NULL; + } + + ctrl->priv = pmu_regs; + ctrl->regs = data->regs; + ctrl->nr_regs = data->nr_regs; + ctrl->value = data->value; + ctrl->refcnt = data->refcnt; + ctrl->on = exynos_retention_on; + ctrl->off = exynos_retention_off; + + return ctrl; +} + /* pin banks of exynos3250 pin-controller 0 */ static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), @@ -722,6 +777,30 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* + * PMU pad retention groups for Exynos3250 doesn't match pin banks, so handle + * them all together + */ +static const u32 exynos3250_retention_regs[] = { + S5P_PAD_RET_MAUDIO_OPTION, + S5P_PAD_RET_GPIO_OPTION, + S5P_PAD_RET_UART_OPTION, + S5P_PAD_RET_MMCA_OPTION, + S5P_PAD_RET_MMCB_OPTION, + S5P_PAD_RET_EBIA_OPTION, + S5P_PAD_RET_EBIB_OPTION, + S5P_PAD_RET_MMC2_OPTION, + S5P_PAD_RET_SPI_OPTION, +}; + +static const struct samsung_retention_data exynos3250_retention_data __initconst = { + .regs = exynos3250_retention_regs, + .nr_regs = ARRAY_SIZE(exynos3250_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + +/* * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes * two gpio/pin-mux/pinconfig controllers. */ @@ -733,6 +812,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos3250_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos3250_pin_banks1, @@ -741,6 +821,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos3250_retention_data, }, }; @@ -793,6 +874,36 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"), }; +/* PMU pad retention groups registers for Exynos4 (without audio) */ +static const u32 exynos4_retention_regs[] = { + S5P_PAD_RET_GPIO_OPTION, + S5P_PAD_RET_UART_OPTION, + S5P_PAD_RET_MMCA_OPTION, + S5P_PAD_RET_MMCB_OPTION, + S5P_PAD_RET_EBIA_OPTION, + S5P_PAD_RET_EBIB_OPTION, +}; + +static const struct samsung_retention_data exynos4_retention_data __initconst = { + .regs = exynos4_retention_regs, + .nr_regs = ARRAY_SIZE(exynos4_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + +/* PMU retention control for audio pins can be tied to audio pin bank */ +static const u32 exynos4_audio_retention_regs[] = { + S5P_PAD_RET_MAUDIO_OPTION, +}; + +static const struct samsung_retention_data exynos4_audio_retention_data __initconst = { + .regs = exynos4_audio_retention_regs, + .nr_regs = ARRAY_SIZE(exynos4_audio_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .init = exynos_retention_init, +}; + /* * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes * three gpio/pin-mux/pinconfig controllers. @@ -805,6 +916,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos4210_pin_banks1, @@ -813,10 +925,12 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos4210_pin_banks2, .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2), + .retention_data = &exynos4_audio_retention_data, }, }; @@ -890,6 +1004,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos4x12_pin_banks1, @@ -898,6 +1013,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos4x12_pin_banks2, @@ -905,6 +1021,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_audio_retention_data, }, { /* pin-controller instance 3 data */ .pin_banks = exynos4x12_pin_banks3, @@ -984,6 +1101,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5250_pin_banks1, @@ -991,6 +1109,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5250_pin_banks2, @@ -1005,6 +1124,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_audio_retention_data, }, }; @@ -1231,6 +1351,30 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), }; +/* PMU pad retention groups registers for Exynos5420 (without audio) */ +static const u32 exynos5420_retention_regs[] = { + EXYNOS_PAD_RET_DRAM_OPTION, + EXYNOS_PAD_RET_JTAG_OPTION, + EXYNOS5420_PAD_RET_GPIO_OPTION, + EXYNOS5420_PAD_RET_UART_OPTION, + EXYNOS5420_PAD_RET_MMCA_OPTION, + EXYNOS5420_PAD_RET_MMCB_OPTION, + EXYNOS5420_PAD_RET_MMCC_OPTION, + EXYNOS5420_PAD_RET_HSI_OPTION, + EXYNOS_PAD_RET_EBIA_OPTION, + EXYNOS_PAD_RET_EBIB_OPTION, + EXYNOS5420_PAD_RET_SPI_OPTION, + EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION, +}; + +static const struct samsung_retention_data exynos5420_retention_data __initconst = { + .regs = exynos5420_retention_regs, + .nr_regs = ARRAY_SIZE(exynos5420_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + /* * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes * four gpio/pin-mux/pinconfig controllers. @@ -1242,26 +1386,31 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0), .eint_gpio_init = exynos_eint_gpio_init, .eint_wkup_init = exynos_eint_wkup_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5420_pin_banks1, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5420_pin_banks2, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 3 data */ .pin_banks = exynos5420_pin_banks3, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 4 data */ .pin_banks = exynos5420_pin_banks4, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos4_audio_retention_data, }, }; From patchwork Mon Jan 16 06:45:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91538 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290773qgi; Sun, 15 Jan 2017 22:46:00 -0800 (PST) X-Received: by 10.98.14.84 with SMTP id w81mr26758996pfi.168.1484549159961; Sun, 15 Jan 2017 22:45:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si16754054pfo.60.2017.01.15.22.45.59; Sun, 15 Jan 2017 22:45:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbdAPGp5 (ORCPT + 4 others); Mon, 16 Jan 2017 01:45:57 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:65352 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbdAPGpd (ORCPT ); Mon, 16 Jan 2017 01:45:33 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV00BMV1FUCZ50@mailout2.w1.samsung.com>; Mon, 16 Jan 2017 06:45:30 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064529eucas1p19dd6771a2d3a49843f76fa70bea9a9e9~aLZFcy9eJ1339613396eucas1p1J; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id F1.87.16908.B0C6C785; Mon, 16 Jan 2017 06:45:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064528eucas1p13b12a28ae9737404d38b3f794e8c23fd~aLZEuVaIn1341013410eucas1p1L; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-b5-587c6c0b5f17 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 88.9B.06687.04C6C785; Mon, 16 Jan 2017 06:46:24 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 11/12] pinctrl: samsung: Move retention control from mach-s5pv210 to the pinctrl driver Date: Mon, 16 Jan 2017 07:45:06 +0100 Message-id: <1484549107-5957-12-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7djP87rcOTURBr9OGFtsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlXG49ydzwR3Fisf/whsYl8t0 MXJySAiYSLy9tJANwhaTuHBvPZgtJLCMUWLtnPIuRi4g+zOjRMeiP6wwDdd7+5khEkBFR19c ZYdwGpgkHredZwGpYhMwlOh628UGkhARaGaUmHl3L1gVs0Afk8TnzXsZQaqEBTIl7m/4zAxi swioSvSc6QXr5hXwkNjevpAFYp+cxMljk8F2cwLFJ+5rZQEZJCHQzS7xaN5MoKkcQI6sxKYD zBD1LhItBz5C9QpLvDq+hR3ClpHo7DjIBGH3M0o0tWpD2DMYJc695YWwrSUOH78ItotZgE9i 0rbpzBDjeSU62oQgSjwk7vVvh1rlKPHo9zqo72czSlx/NZtxAqPMAkaGVYwiqaXFuempxYZ6 xYm5xaV56XrJ+bmbGIFxfvrf8fc7GJ82hxxiFOBgVOLhXbCjOkKINbGsuDL3EKMEB7OSCK9b Zk2EEG9KYmVValF+fFFpTmrxIUZpDhYlcd69C66ECwmkJ5akZqemFqQWwWSZODilGhhnX1m9 dJ349fOfY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S X-CMS-MailID: 20170116064528eucas1p13b12a28ae9737404d38b3f794e8c23fd X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064528eucas1p13b12a28ae9737404d38b3f794e8c23fd X-RootMTR: 20170116064528eucas1p13b12a28ae9737404d38b3f794e8c23fd References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch moves pad retention control from S5PV210 machine code to Exynos pin controller driver. This helps to avoid possible ordering and logical dependencies between machine and pin control code. Till now it worked fine only because sys_ops for machine code and pin controller were called in registration order. Signed-off-by: Marek Szyprowski --- arch/arm/mach-s5pv210/pm.c | 7 ---- arch/arm/mach-s5pv210/regs-clock.h | 4 --- drivers/pinctrl/samsung/pinctrl-exynos.c | 56 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 11 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 21b4b13c5ab7..7d69666de5ba 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -155,13 +155,6 @@ static void s5pv210_suspend_finish(void) */ static void s5pv210_pm_resume(void) { - u32 tmp; - - tmp = __raw_readl(S5P_OTHERS); - tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF |\ - S5P_OTHERS_RET_MMC | S5P_OTHERS_RET_UART); - __raw_writel(tmp , S5P_OTHERS); - s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); } diff --git a/arch/arm/mach-s5pv210/regs-clock.h b/arch/arm/mach-s5pv210/regs-clock.h index 4640f0f03c12..fb3eb77412db 100644 --- a/arch/arm/mach-s5pv210/regs-clock.h +++ b/arch/arm/mach-s5pv210/regs-clock.h @@ -188,10 +188,6 @@ #define S5P_SLEEP_CFG_USBOSC_EN (1 << 1) /* OTHERS Resgister */ -#define S5P_OTHERS_RET_IO (1 << 31) -#define S5P_OTHERS_RET_CF (1 << 30) -#define S5P_OTHERS_RET_MMC (1 << 29) -#define S5P_OTHERS_RET_UART (1 << 28) #define S5P_OTHERS_USB_SIG_MASK (1 << 16) /* S5P_DAC_CONTROL */ diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 652d3eabe1e5..fdadc9cbcfce 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -643,6 +644,60 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) exynos_pinctrl_resume_bank(drvdata, bank); } +/* Retention control for S5PV210 are located at the end of clock controller */ +#define S5P_OTHERS 0xE000 + +#define S5P_OTHERS_RET_IO (1 << 31) +#define S5P_OTHERS_RET_CF (1 << 30) +#define S5P_OTHERS_RET_MMC (1 << 29) +#define S5P_OTHERS_RET_UART (1 << 28) + +static void s5pv210_retention_off(struct samsung_pinctrl_drv_data *drvdata) +{ + void *clk_base = drvdata->retention_ctrl->priv; + u32 tmp; + + tmp = __raw_readl(clk_base + S5P_OTHERS); + tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF | S5P_OTHERS_RET_MMC | + S5P_OTHERS_RET_UART); + __raw_writel(tmp, clk_base + S5P_OTHERS); +} + +static struct samsung_retention_ctrl * +s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, + const struct samsung_retention_data *data) +{ + struct samsung_retention_ctrl *ctrl; + struct device_node *np; + void *clk_base; + + ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return NULL; + + np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock"); + if (!np) { + pr_err("%s: failed to find clock controller DT node\n", + __func__); + return NULL; + } + + clk_base = of_iomap(np, 0); + if (!clk_base) { + pr_err("%s: failed to map clock registers\n", __func__); + return NULL; + } + + ctrl->priv = clk_base; + ctrl->off = s5pv210_retention_off; + + return ctrl; +} + +static const struct samsung_retention_data s5pv210_retention_data __initconst = { + .init = s5pv210_retention_init, +}; + /* pin banks of s5pv210 pin-controller */ static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), @@ -690,6 +745,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &s5pv210_retention_data, }, }; From patchwork Mon Jan 16 06:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91536 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1290742qgi; Sun, 15 Jan 2017 22:45:53 -0800 (PST) X-Received: by 10.98.81.199 with SMTP id f190mr35384708pfb.180.1484549153348; Sun, 15 Jan 2017 22:45:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si16754054pfo.60.2017.01.15.22.45.53; Sun, 15 Jan 2017 22:45:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751361AbdAPGpv (ORCPT + 13 others); Mon, 16 Jan 2017 01:45:51 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59749 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751402AbdAPGpe (ORCPT ); Mon, 16 Jan 2017 01:45:34 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007R81FUAI50@mailout1.w1.samsung.com>; Mon, 16 Jan 2017 06:45:30 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064529eucas1p16019d23f76c5fc4845422fc01fb65593~aLZFxjc_30708307083eucas1p14; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id A2.87.16908.C0C6C785; Mon, 16 Jan 2017 06:45:32 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064529eucas1p15b04f901b17dfa2b02fd04745cbe3f17~aLZFOE5s01339613396eucas1p1I; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-b6-587c6c0ca52f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B9.9B.06687.14C6C785; Mon, 16 Jan 2017 06:46:25 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:29 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH 12/12] pinctrl: samsung: Replace syscore ops with standard platform device pm_ops Date: Mon, 16 Jan 2017 07:45:07 +0100 Message-id: <1484549107-5957-13-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87o8OTURBjsec1tsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlXHwaBt7Qb96xZ17y1kaGM8p dDFyckgImEg87pzFBmGLSVy4tx7I5uIQEljGKPHp2AkWCOczo8T9L0fYYTrW7b/MCFfVefQK E4TTwCRx5fgBsCo2AUOJrrddYLNEBJoZJWbe3csO4jAL9DFJfN68lxGkSlggWeLU+j4mEJtF QFVi7f+XzF2MHBy8Ah4S/yd7Q6yTkzh5bDIriM0JFJ64rxXsJgmBfnaJJ9NnsoHUSwjISmw6 wAxR7yLReG0LlC0s8er4FqizZSQ6Ow4yQdj9jBJNrdoQ9gxGiXNveSFsa4nDxy+C7WIW4JOY tG06M8R4XomONiGIEg+JHW+3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UHw9e1JxlvC7Rq7F02pPvJrzcEKjkt8YvkPkgQaVgYITy/8 rj3VxeHSqiyenBOH0rvXcf/UDcnr4G+uKvh69KiwlUd12kbhha4Mhkv/7g8K81TW1Ki4s7BC foFd0P3p6UtreBL2q0T8NG/dx218V8RLv0CJpTgj0VCLuag4EQC5nBShkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064529eucas1p15b04f901b17dfa2b02fd04745cbe3f17 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064529eucas1p15b04f901b17dfa2b02fd04745cbe3f17 X-RootMTR: 20170116064529eucas1p15b04f901b17dfa2b02fd04745cbe3f17 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Once the dependency on PMU driver (for pad retention control) has been removed, there is no reason to use syscore_ops based suspend/resume. This patch replaces it with standard platform device pm_ops based solution. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 72 ++++++------------------------- 1 file changed, 13 insertions(+), 59 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 95a84086a2e9..48acf5908b84 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "../core.h" #include "pinctrl-samsung.h" @@ -49,9 +48,6 @@ { "samsung,pin-val", PINCFG_TYPE_DAT }, }; -/* Global list of devices (struct samsung_pinctrl_drv_data) */ -static LIST_HEAD(drvdata_list); - static unsigned int pin_base; static int samsung_get_group_count(struct pinctrl_dev *pctldev) @@ -1081,22 +1077,18 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, drvdata); - /* Add to the global list */ - list_add_tail(&drvdata->node, &drvdata_list); - return 0; } #ifdef CONFIG_PM - /** - * samsung_pinctrl_suspend_dev - save pinctrl state for suspend for a device + * samsung_pinctrl_suspend - save pinctrl state for suspend * * Save data for all banks handled by this device. */ -static void samsung_pinctrl_suspend_dev( - struct samsung_pinctrl_drv_data *drvdata) +static int samsung_pinctrl_suspend(struct device *dev) { + struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev); int i; for (i = 0; i < drvdata->nr_banks; i++) { @@ -1133,15 +1125,17 @@ static void samsung_pinctrl_suspend_dev( if (drvdata->retention_ctrl && drvdata->retention_ctrl->on) drvdata->retention_ctrl->on(drvdata); + return 0; } /** - * samsung_pinctrl_resume_dev - restore pinctrl state from suspend for a device + * samsung_pinctrl_resume - restore pinctrl state from suspend * * Restore one of the banks that was saved during suspend. */ -static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) +static int samsung_pinctrl_resume(struct device *dev) { + struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev); int i; if (drvdata->resume) @@ -1180,48 +1174,10 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (drvdata->retention_ctrl && drvdata->retention_ctrl->off) drvdata->retention_ctrl->off(drvdata); -} - -/** - * samsung_pinctrl_suspend - save pinctrl state for suspend - * - * Save data for all banks across all devices. - */ -static int samsung_pinctrl_suspend(void) -{ - struct samsung_pinctrl_drv_data *drvdata; - - list_for_each_entry(drvdata, &drvdata_list, node) { - samsung_pinctrl_suspend_dev(drvdata); - } - return 0; } - -/** - * samsung_pinctrl_resume - restore pinctrl state for suspend - * - * Restore data for all banks across all devices. - */ -static void samsung_pinctrl_resume(void) -{ - struct samsung_pinctrl_drv_data *drvdata; - - list_for_each_entry_reverse(drvdata, &drvdata_list, node) { - samsung_pinctrl_resume_dev(drvdata); - } -} - -#else -#define samsung_pinctrl_suspend NULL -#define samsung_pinctrl_resume NULL #endif -static struct syscore_ops samsung_pinctrl_syscore_ops = { - .suspend = samsung_pinctrl_suspend, - .resume = samsung_pinctrl_resume, -}; - static const struct of_device_id samsung_pinctrl_dt_match[] = { #ifdef CONFIG_PINCTRL_EXYNOS { .compatible = "samsung,exynos3250-pinctrl", @@ -1263,25 +1219,23 @@ static void samsung_pinctrl_resume(void) }; MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match); +static const struct dev_pm_ops samsung_pinctrl_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend, + samsung_pinctrl_resume) +}; + static struct platform_driver samsung_pinctrl_driver = { .probe = samsung_pinctrl_probe, .driver = { .name = "samsung-pinctrl", .of_match_table = samsung_pinctrl_dt_match, .suppress_bind_attrs = true, + .pm = &samsung_pinctrl_pm_ops, }, }; static int __init samsung_pinctrl_drv_register(void) { - /* - * Register syscore ops for save/restore of registers across suspend. - * It's important to ensure that this driver is running at an earlier - * initcall level than any arch-specific init calls that install syscore - * ops that turn off pad retention (like exynos_pm_resume). - */ - register_syscore_ops(&samsung_pinctrl_syscore_ops); - return platform_driver_register(&samsung_pinctrl_driver); } postcore_initcall(samsung_pinctrl_drv_register);