From patchwork Thu Jan 19 13:48:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91890 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp278160obz; Thu, 19 Jan 2017 05:49:39 -0800 (PST) X-Received: by 10.55.215.129 with SMTP id t1mr7486805qkt.274.1484833779929; Thu, 19 Jan 2017 05:49:39 -0800 (PST) Return-Path: Received: from bombadil.infradead.org ([65.50.211.133]) by mx.google.com with ESMTPS id t73si2632585qke.263.2017.01.19.05.49.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 05:49:39 -0800 (PST) Received-SPF: neutral (google.com: 65.50.211.133 is neither permitted nor denied by best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org) client-ip=65.50.211.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.50.211.133 is neither permitted nor denied by best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cUD5u-0004br-9g; Thu, 19 Jan 2017 13:49:38 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cUD5o-0004Tk-Gx for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2017 13:49:34 +0000 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 <0OK100GH851TDE70@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2017 13:49:05 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170119134905eucas1p209417b3b5be9f213474f6aa256b1d8d6~bMGyaM-k40537905379eucas1p2Y; Thu, 19 Jan 2017 13:49:05 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 92.6F.28517.0D3C0885; Thu, 19 Jan 2017 13:49:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170119134904eucas1p153a1d5b2ff9826c88293b6a8fe5140bc~bMGxvHTcb0980309803eucas1p1U; Thu, 19 Jan 2017 13:49:04 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-d1-5880c3d02e58 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A0.31.06687.A04C0885; Thu, 19 Jan 2017 13:50:02 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OK100BYG51LGB30@eusync1.samsung.com>; Thu, 19 Jan 2017 13:49:04 +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 Subject: [PATCH v3 01/13] soc: samsung: pmu: Provide global function to get PMU regmap Date: Thu, 19 Jan 2017 14:48:41 +0100 Message-id: <1484833733-16082-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484833733-16082-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7djP87oXDjdEGFz+amaxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn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//pZIGwxiQv31rN1MXJxCAksYZQ4t2wrM4TTxCRx+fY1VpAqNgFDia63XWBVIgLNjBINS3rB HGaBCUwSMz81MHUxcnAIC0RIHNxZBdLAIqAqsXRnJzuIzSvgIbFl8X02iHVyEiePTQYbying KTF1ThNYXAioZsnSi6wTGHkXMDKsYhRJLS3OTc8tNtQrTswtLs1L10vOz93ECAz5bcd+bt7B eGlj8CFGAQ5GJR7ejqL6CCHWxLLiytxDjBIczEoivDZ7GyKEeFMSK6tSi/Lji0pzUosPMZoC HTWRWUo0OR8Yj3kl8YYmhuaWhkbGFhbmRkZK4rwlH66ECwmkJ5akZqemFqQWwfQxcXBKNTDy 58xY8jRVSmn6A6njc6ySMq9m/BE88NkqIK/rgTBL160VrknPtzaJ971cxLH74WyJfY/M/0pk idcoPTJ92F32/NNNk5NB9aeXfL305uFC1XiRttvyeqvDY6+9U0u71jKrIVPS4mx2gQAf71Tf GUIeR0Q5ru+tae98+n5b2rxTHwP2rvQwN5yixFKckWioxVxUnAgAS6kz7Y8CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170119134904eucas1p153a1d5b2ff9826c88293b6a8fe5140bc 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: 20170119134904eucas1p153a1d5b2ff9826c88293b6a8fe5140bc X-RootMTR: 20170119134904eucas1p153a1d5b2ff9826c88293b6a8fe5140bc References: <1484833733-16082-1-git-send-email-m.szyprowski@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170119_054932_720381_A4E147E7 X-CRM114-Status: GOOD ( 16.92 ) X-Spam-Score: -10.1 (----------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-10.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.11 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.11 listed in wl.mailspike.net] -3.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Linus Walleij , Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org PMU is something like a SoC wide service, so add a helper function to get PMU regmap. This will be used by other Exynos device drivers. This way it can be avoided to model this dependency in device tree (as phandles to PMU node) for almost every device in the SoC. Signed-off-by: Marek Szyprowski Reviewed-by: Tomasz Figa --- drivers/soc/samsung/exynos-pmu.c | 11 +++++++++++ include/linux/soc/samsung/exynos-pmu.h | 10 ++++++++++ 2 files changed, 21 insertions(+) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 0acdfd82e751..5c269bf23210 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -92,6 +93,16 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) { /*sentinel*/ }, }; +struct regmap *exynos_get_pmu_regmap(void) +{ + struct device_node *np = of_find_matching_node(NULL, + exynos_pmu_of_device_ids); + if (np) + return syscon_node_to_regmap(np); + return ERR_PTR(-ENODEV); +} +EXPORT_SYMBOL_GPL(exynos_get_pmu_regmap); + static int exynos_pmu_probe(struct platform_device *pdev) { const struct of_device_id *match; diff --git a/include/linux/soc/samsung/exynos-pmu.h b/include/linux/soc/samsung/exynos-pmu.h index e2e9de1acc5b..e57eb4b6cc5a 100644 --- a/include/linux/soc/samsung/exynos-pmu.h +++ b/include/linux/soc/samsung/exynos-pmu.h @@ -12,6 +12,8 @@ #ifndef __LINUX_SOC_EXYNOS_PMU_H #define __LINUX_SOC_EXYNOS_PMU_H +struct regmap; + enum sys_powerdown { SYS_AFTR, SYS_LPA, @@ -20,5 +22,13 @@ enum sys_powerdown { }; extern void exynos_sys_powerdown_conf(enum sys_powerdown mode); +#ifdef CONFIG_EXYNOS_PMU +extern struct regmap *exynos_get_pmu_regmap(void); +#else +static inline struct regmap *exynos_get_pmu_regmap(void) +{ + return ERR_PTR(-ENODEV); +} +#endif #endif /* __LINUX_SOC_EXYNOS_PMU_H */