From patchwork Tue Jan 17 12:44:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91626 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470182qgi; Tue, 17 Jan 2017 04:45:39 -0800 (PST) X-Received: by 10.98.159.141 with SMTP id v13mr43234749pfk.50.1484657139382; Tue, 17 Jan 2017 04:45:39 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id d70si6933724pfg.280.2017.01.17.04.45.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 04:45:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) 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 1cTT8r-00014L-Sx; Tue, 17 Jan 2017 12:45:37 +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 1cTT8c-00080B-0q for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:45:23 +0000 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 <0OJX005Y1CQY0E60@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:44:58 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124457eucas1p29f6b3ace9833bdacb6a66d21f858b58b~aj8OfNp2k0762907629eucas1p25; Tue, 17 Jan 2017 12:44:57 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 07.66.17477.9C11E785; Tue, 17 Jan 2017 12:44:57 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124456eucas1p1d42d11aa2117caed8d89faa8c09e6218~aj8Nyod_02833328333eucas1p1h; Tue, 17 Jan 2017 12:44:56 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-75-587e11c979fe Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F0.A5.06687.1021E785; Tue, 17 Jan 2017 12:45:53 +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 <0OJX00GNRCQPHB20@eusync2.samsung.com>; Tue, 17 Jan 2017 12:44:56 +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 v2 01/13] soc: samsung: pmu: Provide global function to get PMU regmap Date: Tue, 17 Jan 2017 13:44:32 +0100 Message-id: <1484657084-26227-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484657084-26227-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7onBesiDJZfEbDYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7Tzmqxat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PiAt4uRk0NCwERi 5q+DLBC2mMSFe+vZuhi5OIQEljBK3HqxhQXCaWKSeLvzCytIFZuAoUTX2y6wKhGBZkaJhiW9 YA6zwAQmiZmfGphAqoQFIiTmXX3DDmKzCKhK/Dh0hA3E5hXwkNg+7wwjxD45iZPHJoNN5RTw lPjxcz1YrxBQzfn7+1gnMPIuYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERj224793LyD 8dLG4EOMAhyMSjy8DrdrIoRYE8uKK3MPMUpwMCuJ8M4VqIsQ4k1JrKxKLcqPLyrNSS0+xGgK dNREZinR5HxgTOaVxBuaGJpbGhoZW1iYGxkpifOWfLgSLiSQnliSmp2aWpBaBNPHxMEp1cDI Uckm8TGNa0vym3krPAwEfmSYnOyKeV511mC2zQ3r/62lB4QWaUU+Nf9ZafNWeA6XQiLDFOW9 0W7h/5tN7xS9X+i4bOHSdsacB5xbM5Zu++/asN5i4lOf6tDAirkWaXoXvsgI8mSeUkn4GOkV finOLb31Vm+qBtfJ8CkHjjjmFCSfX2uVVabEUpyRaKjFXFScCABBUSftkQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124456eucas1p1d42d11aa2117caed8d89faa8c09e6218 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: 20170117124456eucas1p1d42d11aa2117caed8d89faa8c09e6218 X-RootMTR: 20170117124456eucas1p1d42d11aa2117caed8d89faa8c09e6218 References: <1484657084-26227-1-git-send-email-m.szyprowski@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170117_044522_217732_749DB783 X-CRM114-Status: GOOD ( 16.05 ) 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 --- drivers/soc/samsung/exynos-pmu.c | 11 +++++++++++ include/linux/soc/samsung/exynos-pmu.h | 7 +++++++ 2 files changed, 18 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..2a841a474684 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 +#include + enum sys_powerdown { SYS_AFTR, SYS_LPA, @@ -20,5 +22,10 @@ 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 NULL; } +#endif #endif /* __LINUX_SOC_EXYNOS_PMU_H */