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/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PdvFesBSsFKrp/nmVvYHzA 28XIySEhYCLRve49I4QtJnHh3nq2LkYuDiGBpYwSnzY9Y4RwPgM5Lb/YYDpm/jrIApFYxijx fuZfJgingUni4v7d7CBVbAKGEl1vu8BmiQg0M0rMvLuXHcRhFuhjkvi8eS/YRmGBCInGHx1g NouAqsSPQ0fAdvAKeEhsn3cG6io5iZPHJrOC2JwCnhI/fq4HWych0M8usfn+RaAEB5AjK7Hp ADNEvYvE/0O3WCBsYYlXx7ewQ9gyEp0dB5kg7H5GiaZWbQh7BqPEubfQ0LCWOHz8ItguZgE+ iUnbpjNDjOeV6GgTgijxkLj8/D8TRNhRYv+7EIjn5zBK3P1/mWUCo8wCRoZVjCKppcW56anF pnrFibnFpXnpesn5uZsYgZF++t/xrzsYlx6zOsQowMGoxMPrcLsmQog1say4MvcQowQHs5II 70vuuggh3pTEyqrUovz4otKc1OJDjNIcLErivHsWXAkXEkhPLEnNTk0tSC2CyTJxcEo1MGaw znuS0LFsNkeNa6VqVFfFswMviqRYK+fnfNx7r7Dl/8rDszQmqjSv5XvC9WzxnKcXOS019+Te TJh9p1zb2unAn5UcpkGLntxZsTky33YTg8S1JHf2m8lH2q8xnT3nctOPUeaES9xpr4cP3fKa d+kI3868atb6dP8xgSNviz+dqWnqbueaLKfEUpyRaKjFXFScCAADTg+x8AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t/xK7qMQnURBg3flS02zljPanH+/AZ2 iyl/ljNZbHp8jdVi8/w/jBafe48wWsw4v4/JYu2Ru+wWh9+0s1qs2vWH0YHLY+esu+wem1Z1 snncubaHzWPzknqPvi2rGD0+b5ILYItys8lITUxJLVJIzUvOT8nMS7dVCg1x07VQUshLzE21 VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW8a6ea9YC1YKVHT/PMvewPiAt4uRk0NCwERi 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 */ From patchwork Tue Jan 17 12:44:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91628 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470393qgi; Tue, 17 Jan 2017 04:46:07 -0800 (PST) X-Received: by 10.98.100.69 with SMTP id y66mr42788306pfb.174.1484657167427; Tue, 17 Jan 2017 04:46:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si24853363ply.163.2017.01.17.04.46.07; Tue, 17 Jan 2017 04:46:07 -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 S1751035AbdAQMqF (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:05 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:63732 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbdAQMqC (ORCPT ); Tue, 17 Jan 2017 07:46:02 -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 <0OJX009PSCQZH360@mailout3.w1.samsung.com>; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124458eucas1p2987386e1f498ff6bd75a9b8f56bcbb63~aj8PjoXJv0755807558eucas1p2D; Tue, 17 Jan 2017 12:44:58 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 0C.B6.30614.AC11E785; Tue, 17 Jan 2017 12:44:58 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124457eucas1p120dac823e1cd08421cb8d7411a9eebbd~aj8O3ICTo2826728267eucas1p1c; Tue, 17 Jan 2017 12:44:57 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-24-587e11ca334f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D2.E4.10233.4C11E785; Tue, 17 Jan 2017 12:44:52 +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:57 +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 v2 02/13] soc: samsung: pmu: Use of_device_get_match_data helper Date: Tue, 17 Jan 2017 13:44:33 +0100 Message-id: <1484657084-26227-3-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7qnBOsiDGYdkLTYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK6N/7QTWgm+cFU8Wv2FpYNzK 0cXIySEhYCJxfdYuVghbTOLCvfVsXYxcHEICSxkl5l+/zQzhfGaUmHDkCwtMx5mbk6CqljFK fNx4H6qqgUli7YdFbCBVbAKGEl1vu8CqRASaGSVm3t3LDuIwC/QxSXzevJcRpEpYIEhixccP 7CA2i4CqRNvRo2CX8Ap4SHRt64faJydx8thksDingKfEj5/rmUAGSQj0s0vc3jQHyOEAcmQl Nh1ghqh3kZi1YzY7hC0s8er4FihbRuLy5G6omf2MEk2t2hD2DEaJc295IWxricPHL4LtYhbg k5i0bTozxHheiY42IYgSD4n/66YyQdiOEsvWHgN7WEhgDqPErTUSExhlFjAyrGIUSS0tzk1P LTbSK07MLS7NS9dLzs/dxAiM9NP/jn/cwfj+hNUhRgEORiUeXofbNRFCrIllxZW5hxglOJiV RHjnCtRFCPGmJFZWpRblxxeV5qQWH2KU5mBREufds+BKuJBAemJJanZqakFqEUyWiYNTqoGR +cnJFWfNO4Jak6u3O8nMyrf+bWj/8lKASbxr9NVNUnUrNXpYZiSEb0yQTnu6f8Z9o2LWCKF/ S2PjStSSLq0/rFTgtWfp1XhzK+Goj4c0Dz42z3+5g7nvb8rd7mkPNlUueDDly5SIOZfP5t49 dXP79vmaLBvWmz3f8OVDg0uk2QzrHWcurWL6osRSnJFoqMVcVJwIADRV8bXwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t/xK7pHBOsiDNa8EbXYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhn9ayewFnzjrHiy+A1LA+NWji5GTg4JAROJ MzcnsUHYYhIX7q0Hsrk4hASWMErcPNLPDpIQEmhikphyUB3EZhMwlOh62wVWJCLQzCjRsKQX zGEWmMAkMfNTA1MXIweHsECAxIYDtSANLAKqEm1Hj7KC2LwCHhJd2/pZILbJSZw8Nhkszing KfHj53omiGUeEufv72OdwMi7gJFhFaNIamlxbnpusZFecWJucWleul5yfu4mRmDIbzv2c8sO xq53wYcYBTgYlXh4nW7XRAixJpYVV+YeYpTgYFYS4Z0rUBchxJuSWFmVWpQfX1Sak1p8iNEU 6KiJzFKiyfnAeMwriTc0MTS3NDQytrAwNzJSEued+uFKuJBAemJJanZqakFqEUwfEwenVAPj UmOmpEqViBvvn3b9uNKwJijCaBvPeaf9pvkV1x5+eLr5w7aNQskbNXl602uVOv5Jr8p95pbx VWWqzC37lq22ab9Oc1gVf4x1Ns7mdFqR4TPRs85n69rlzK1LmX3k2H0qBKKinE6+ylypGWKm 1/lNtn1Rd/f1mVmuXMvvcv7c+ChPLkuNM1OJpTgj0VCLuag4EQDK5A6gjwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124457eucas1p120dac823e1cd08421cb8d7411a9eebbd 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: 20170117124457eucas1p120dac823e1cd08421cb8d7411a9eebbd X-RootMTR: 20170117124457eucas1p120dac823e1cd08421cb8d7411a9eebbd References: <1484657084-26227-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 5c269bf23210..1f914e63dcc6 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -105,7 +106,6 @@ struct regmap *exynos_get_pmu_regmap(void) static int exynos_pmu_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct resource *res; @@ -122,10 +122,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 Tue Jan 17 12:44:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91627 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470312qgi; Tue, 17 Jan 2017 04:45:57 -0800 (PST) X-Received: by 10.84.179.194 with SMTP id b60mr59008841plc.147.1484657157152; Tue, 17 Jan 2017 04:45:57 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id c16si24843059pfc.102.2017.01.17.04.45.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 04:45:57 -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 1cTT99-0001U7-PF; Tue, 17 Jan 2017 12:45:55 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTT8d-0007tf-Ui for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:45:25 +0000 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 <0OJX007PXCQZ8V60@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p2b16d2abc1b23b6cccbe75fec71fdea5d~aj8P8C9xa2589225892eucas1p26; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id B5.F7.09557.AC11E785; Tue, 17 Jan 2017 12:44:58 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124458eucas1p10463c19d77a501284c7302c3b848fecc~aj8PNCJm82811028110eucas1p1S; Tue, 17 Jan 2017 12:44:58 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-ca-587e11cac53d Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B5.A5.06687.2021E785; Tue, 17 Jan 2017 12:45:55 +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:58 +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 03/13] soc: samsung: pmu: Remove messages for failed memory allocation Date: Tue, 17 Jan 2017 13:44:34 +0100 Message-id: <1484657084-26227-4-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+NgFrrFIsWRmVeSWpSXmKPExsWy7djPc7qnBOsiDP43GVtsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlXHxUyNTwTu2ihVHOpgaGJ+w djFyckgImEg8vXuYBcIWk7hwbz1bFyMXh5DAUkaJOftOMkM4nxkljv09B5ThAOvoaAiCiC9j lLh8/QkjhNPAJLHsxDN2kFFsAoYSXW+7wEaJCDQzSsy8u5cdxGEW6GOS+Lx5LyNIlbBAtMTH yRfAlrMIqEoc3/kI7CheAQ+Jies/MUMcJSdx8thksDingKfEj5/rmSDi3ewS3695QZwkK7Hp AFS5i8SrzTugfhOWeHV8CzuELSPR2XEQqrWfUaKpVRvCnsEoce4tL4RtLXH4+EWwXmYBPolJ 26YzQ4znlehoE4IwPST2r4yCqHaU2Pl9KtgjQgJzGCX+HWWbwCizgJFhFaNIamlxbnpqsbFe cWJucWleul5yfu4mRmCMn/53/NMOxq8nrA4xCnAwKvHwzrhbEyHEmlhWXJl7iFGCg1lJhHeu QF2EEG9KYmVValF+fFFpTmrxIUZpDhYlcd49C66ECwmkJ5akZqemFqQWwWSZODilGhhXTv93 4Ieu+uLblneKej8/Z3/1tdapvy9+2+qHrMZe8untSt3K/SmTk0qOVfacbHFc8t7mucr6YtsD gusrm7/PSRAWcPj/LvZ1kMBb+/acZ9sZfZLmPJHbdVJ11aypsbO2zDx6LHPV13ubWDz5bPi2 TP3EnVNZFvPwi+bKnomf8/PDXIUXX6pUYinOSDTUYi4qTgQA8rLlOu0CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRmVeSWpSXmKPExsVy+t/xK7rMQnURBnvbGC02zljPanH+/AZ2 iyl/ljNZbHp8jdVi8/w/jBafe48wWsw4v4/JYu2Ru+wWh9+0s1qs2vWH0YHLY+esu+wem1Z1 snncubaHzWPzknqPvi2rGD0+b5ILYItys8lITUxJLVJIzUvOT8nMS7dVCg1x07VQUshLzE21 VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW8bFT41MBe/YKlYc6WBqYHzC2sXIwSEhYCLR 0RDUxcgJZIpJXLi3ng3EFhJYwiixZaEuhN3EJDF5RzqIzSZgKNH1tguohotDRKCZUaJhSS+Y wywwgUli5qcGJpAqYYFoiVMv/jGD2CwCqhLHdz5iBbF5BTwkJq7/xAyxTU7i5LHJYHFOAU+J Hz/XM0Fs85A4f38f6wRG3gWMDKsYRVJLi3PTc4sN9YoTc4tL89L1kvNzNzECA37bsZ+bdzBe 2hh8iFGAg1GJh9fhdk2EEGtiWXFl7iFGCQ5mJRHeuQJ1EUK8KYmVValF+fFFpTmpxYcYTYGO msgsJZqcD4zGvJJ4QxNDc0tDI2MLC3MjIyVx3pIPV8KFBNITS1KzU1MLUotg+pg4OKUaGOfx 5vE9+qEQmWpa8vbkuQL19+f1eTS2G029Fr5HrMznGKNeg5YA75YGKYYbc98tXlYdPfmdG5eT jm2uDavT67UyHXmqJ9h0+1wO75x1TVlS1qMvqeug/Ja/s6QXSu4TLDq568EHl3c9V6z0Fr8r szgY8WjGu48BarNCnvTa7e+2u8v8Xod9pRJLcUaioRZzUXEiAADyinqOAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124458eucas1p10463c19d77a501284c7302c3b848fecc 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: 20170117124458eucas1p10463c19d77a501284c7302c3b848fecc X-RootMTR: 20170117124458eucas1p10463c19d77a501284c7302c3b848fecc 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_044524_151672_94F5A003 X-CRM114-Status: GOOD ( 12.86 ) 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 ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.12 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.12 listed in list.dnswl.org] -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 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 _______________________________________________ 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 1f914e63dcc6..813df6e7292d 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -117,10 +117,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 Tue Jan 17 12:44:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91629 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470424qgi; Tue, 17 Jan 2017 04:46:11 -0800 (PST) X-Received: by 10.98.23.207 with SMTP id 198mr33596995pfx.103.1484657171432; Tue, 17 Jan 2017 04:46:11 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.11; Tue, 17 Jan 2017 04:46:11 -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 S1751033AbdAQMqJ (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:09 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:27653 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbdAQMqC (ORCPT ); Tue, 17 Jan 2017 07:46:02 -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 <0OJX005XYCR0LS60@mailout4.w1.samsung.com>; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p2be1ce1edf5e0159f2df95d1fa2fc2146~aj8QlfRc30762507625eucas1p2-; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 86.F7.09557.BC11E785; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p10fbae533e4900439b9a5aa32fc94182c~aj8P7veZd1115811158eucas1p1H; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-cd-587e11cb716c Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 54.E4.10233.5C11E785; Tue, 17 Jan 2017 12:44: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:58 +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 v2 04/13] pinctrl: samsung: Document Exynos3250 SoC support Date: Tue, 17 Jan 2017 13:44:35 +0100 Message-id: <1484657084-26227-5-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87qnBesiDP7tVrDYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK6P/ditbwWKuiudrN7A2MHZy djFyckgImEicvvWAFcIWk7hwbz0biC0ksJRRYtNauS5GLiD7M6PE5Nk3WGEabn39wgSRWMYo seP6JRYIp4FJYtmJZ+wgVWwChhJdb7vYQBIiAs2MEjPv7mUHcZgF+pgkPm/eywhSJSzgLdH2 p5EJxGYRUJU4s+ENC4jNK+Ah8fv1JxaIfXISJ49NBtvNKeAp8ePnerDdEgL97BJLf00HcjiA HFmJTQeYIepdJC7Peg7VKyzx6vgWdghbRuLy5G6oeD+jRFOrNoQ9g1Hi3FteCNta4vDxi2C7 mAX4JCZtm84MMZ5XoqNNCKLEQ2LLzSY2CNtRYkbXMUaI7+cwSsyfeZZpAqPMAkaGVYwiqaXF uempxcZ6xYm5xaV56XrJ+bmbGIGRfvrf8U87GL+esDrEKMDBqMTDO+NuTYQQa2JZcWXuIUYJ DmYlEd65AnURQrwpiZVVqUX58UWlOanFhxilOViUxHn3LLgSLiSQnliSmp2aWpBaBJNl4uCU amBctkSkps+qm6kz7hrHsheSZ+Yl5Wffsm78LSxgWFhWoHqk7abFAV/3jj212xstftv2afkV 7vnp7P276XT7+8zkkFM55aEudjYzUqzM2Vl2pixZW7mbW8BsqU7dcx2l5IvPS8z/h/xLWDu9 qVN44473T+ycTu69FXRU9PbhTHsutZD1K/OEJymxFGckGmoxFxUnAgBzvlf58AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7pHBesiDFYdkrfYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhn9t1vZChZzVTxfu4G1gbGTs4uRk0NCwETi 1tcvTBC2mMSFe+vZuhi5OIQEljBKvH6wgB0kISTQxCQxeUc6iM0mYCjR9bYLrEhEoJlRomFJ L5jDLDCBSWLmpwawUcIC3hJtfxrBbBYBVYkzG96wgNi8Ah4Sv19/YoFYJydx8thkVhCbU8BT 4sfP9UwQ2zwkzt/fxzqBkXcBI8MqRpHU0uLc9NxiI73ixNzi0rx0veT83E2MwKDfduznlh2M Xe+CDzEKcDAq8fA63a6JEGJNLCuuzD3EKMHBrCTCO1egLkKINyWxsiq1KD++qDQntfgQoynQ UROZpUST84ERmVcSb2hiaG5paGRsYWFuZKQkzjv1w5VwIYH0xJLU7NTUgtQimD4mDk6pBkbz GU5Vq0sVI7M2LS8MP32a+4bYK41bVUbHn+ksj/so4aGduN8l2fngV4Pog/YNHXrfGA59EXdb yfrnM+dXnhyp67cUSjgqapf/yokLledw71H/+3fN9KSEaacYObLyww95rA02e9GWOKF6+5RD qz7kBKU4POXTaytolQzYfnHN2WfvDGtWxSmxFGckGmoxFxUnAgAdEndakAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124459eucas1p10fbae533e4900439b9a5aa32fc94182c 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: 20170117124459eucas1p10fbae533e4900439b9a5aa32fc94182c X-RootMTR: 20170117124459eucas1p10fbae533e4900439b9a5aa32fc94182c References: <1484657084-26227-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 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 Reviewed-by: Krzysztof Kozlowski --- 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-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/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 Tue Jan 17 12:44:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91638 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470598qgi; Tue, 17 Jan 2017 04:46:31 -0800 (PST) X-Received: by 10.84.241.203 with SMTP id t11mr58690900plm.18.1484657191484; Tue, 17 Jan 2017 04:46:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.31; Tue, 17 Jan 2017 04:46:31 -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 S1751213AbdAQMqa (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:30 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:15426 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbdAQMqE (ORCPT ); Tue, 17 Jan 2017 07:46:04 -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 <0OJX0041LCR0ZE70@mailout2.w1.samsung.com>; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p2bb60bd198a1b223439eda867bb2c9304~aj8Qrf3Av0756707567eucas1p2H; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id A6.EB.28517.BC11E785; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p160494d6c7509e0d24bfcc73087492430~aj8QFKBtz1114911149eucas1p1_; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-c0-587e11cb824f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 76.A5.06687.4021E785; Tue, 17 Jan 2017 12:45:56 +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:59 +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 v2 05/13] pinctrl: samsung: Remove messages for failed memory allocation Date: Tue, 17 Jan 2017 13:44:36 +0100 Message-id: <1484657084-26227-6-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: H4sIAAAAAAAAAzWRfUgTcRjH+93ddrfl7DpH/TL1jw0jjHyBgUdWNBK6oCCDUpSslceUnMpu To3QkebLqikZdc5M0SxZ5GqzVb6ETplNoxmYFTqNJAxLKGaQJpHb1X+fh+fzPA9fHgKlprFI Iq/AwOoLNPkKsRRzeVZ8u8c3l2ckvm/eQT/m7SLa53uE0zfW7iO0Y35KRDtb1wAduDYCaN73 AqEfjvhxevhbjYi29a6BA1LmudWPMw5bnZiZmeoXM867FYylxwaYgCPmmDhTujeHzc8zsvqE /WekuTUT77CihbjSheUFzASalWZAEJBUwcbqMDOQrOMWODFrF5uBlKDITgD5VS8abFBkAMAf v9MESQXvmFr+SfcAdNptIqEwIfDTg15R0BKTSdC8ZA5ZcrISwCb/AB4sUNKCwIBzAAStCDIT djUMhiYwMhbOrfYhQZaRDGyyNImFezHQ62kMORLyMPy1YkeCiyB5BYeuDyOIECIaOgZRwU+F 1vZeTOAIuDjagwscBetqhxCB6wG8dHmXwDyAr5dkAqfA4dE3oVsoGQ6vu26hwnoZrK2mBGTg 4qRRsNXwS9UTIIS/DeCYpRtvAFFtYIMNyNliTqdlOVU8p9FxxQXa+HOFOgdYf/n4n9HlZ6DD s8cNSAIowmS8/2IGJdIYuTKdG0ACVchlLWR5BiXL0ZRdYPWFp/XF+SznBtsJTLFV1t82mU6R Wo2BPc+yRaz+fxchJJEm0CGvMqcO8DPdcY0SVeLcZ6+jfuPxkxGZ42Nz2RYLpU7+eGQIby5x 3wy3eNvbv2afUCcrK7piZ9RkSQm/KbpTmWt9etWz+l2R0/pz205DQr92nz3hUEoN4EvnDw46 EINVnZT2yjgmnU6f0DuzdMq+rNlh16lK1Bg4O/Ty7VEFxuVqkuJQPaf5CxbzSGHuAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7osQnURBle+MllsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4z2C9dZCp5rVTz/8pylgXG2chcjJ4eEgInE vIa5bBC2mMSFe+vBbCGBJYwSSzebdjFyAdlNTBJNM/cwgyTYBAwlut52sYEkRASaGSUalvSC OcwCE5gkZn5qYAKpEhaIkrh5ZRNYB4uAqsT9X7vB4rwCHhIz+2ZCrZOTOHlsMiuIzSngKfHj 53omiNUeEufv72OdwMi7gJFhFaNIamlxbnpusaFecWJucWleul5yfu4mRmDQbzv2c/MOxksb gw8xCnAwKvHwOtyuiRBiTSwrrsw9xCjBwawkwjtXoC5CiDclsbIqtSg/vqg0J7X4EKMp0FET maVEk/OBEZlXEm9oYmhuaWhkbGFhbmSkJM5b8uFKuJBAemJJanZqakFqEUwfEwenVANj0vPV wR/eT/fZ9nbK5n3lX9but5/6/ttxHVuZ6OkfMtcW8T6YmPKsYAmH0qftqsLvnZSm3+S0epG6 /t7CKc+am2rVyqIPvI3P2POnxnIhD1+S09EXkx0Uv033ZSk0l5Z5/jFy8vXc1F7N5afmcZv3 7Z9x8EvppovtU2RKDUWm/m6x1F1uO9f3ihJLcUaioRZzUXEiAAf653iQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124459eucas1p160494d6c7509e0d24bfcc73087492430 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: 20170117124459eucas1p160494d6c7509e0d24bfcc73087492430 X-RootMTR: 20170117124459eucas1p160494d6c7509e0d24bfcc73087492430 References: <1484657084-26227-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 Memory subsystem already prints message about failed memory allocation, there is no need to do it in the drivers. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski --- 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-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-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 Tue Jan 17 12:44:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91632 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470460qgi; Tue, 17 Jan 2017 04:46:17 -0800 (PST) X-Received: by 10.84.241.203 with SMTP id t11mr58689446plm.18.1484657177402; Tue, 17 Jan 2017 04:46:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.17; Tue, 17 Jan 2017 04:46:17 -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 S1751235AbdAQMqO (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:14 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:63732 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdAQMqE (ORCPT ); Tue, 17 Jan 2017 07:46:04 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJX007W0CR1GA60@mailout3.w1.samsung.com>; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124500eucas1p10fd52f7da1f2722379eaef7513bbe360~aj8RXXrFa2603126031eucas1p1r; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id CD.B6.30614.CC11E785; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124459eucas1p1ead13705d84054c1d69b5d7a9795f0e9~aj8Qtr2nL2981029810eucas1p1V; Tue, 17 Jan 2017 12:44:59 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-2b-587e11cce9c3 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A5.E4.10233.6C11E785; Tue, 17 Jan 2017 12:44:54 +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:59 +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 v2 06/13] pinctrl: samsung: Fix samsung_pinctrl_create_functions return value Date: Tue, 17 Jan 2017 13:44:37 +0100 Message-id: <1484657084-26227-7-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7pnBOsiDGb8ELTYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PVjP2MBb9ZK762/WRuYOxi 7WLk5JAQMJH4e201G4QtJnHh3nogm4tDSGApo8T5xftYIZzPjBJzW1vgOp61vYNKLGOUmLL6 MpTTwCTxaPUusCo2AUOJrrddYLNEBJoZJWbe3csO4jAL9DFJfN68l7GLkYNDWCBeYvVifpAG FgFViS+Pf4E18wp4SPze9xzqKDmJk8cmg8U5BTwlfvxczwQyR0Kgn11i+aEnLCBzJARkJTYd YIaod5G4OWc3lC0s8er4FnYIW0bi8uRuFgi7n1GiqVUbwp7BKHHuLS+EbS1x+PhFsF3MAnwS k7ZNZ4YYzyvR0SYEUeIhsfnEIqjTHCV2beplgnh+DqPEqw+/2SYwyixgZFjFKJJaWpybnlps pFecmFtcmpeul5yfu4kRGOmn/x3/uIPx/QmrQ4wCHIxKPLwOt2sihFgTy4orcw8xSnAwK4nw zhWoixDiTUmsrEotyo8vKs1JLT7EKM3BoiTOu2fBlXAhgfTEktTs1NSC1CKYLBMHp1QD47VV ta49+3V17wb3XhJwi7xTWFikIjK5/cf9t06xP7hTgjZNNpILV2nLfyqcaVR5cr+S3ct30TVn BMtvXxPiNfh+Ztr0hhIPVTmPbq9W4bXHV6mUptpnbfykecj8cP8PFrW5uXrFc2OF9sx5M/OZ hkt41jFNrWYGA/Z5ImEmURc7Raf8WGqpxFKckWioxVxUnAgAhSZrHPACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t/xK7rHBOsiDFY+FLXYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhmrZuxnLPjNWvG17SdzA2MXaxcjJ4eEgInE s7Z3ULaYxIV769lAbCGBJYwSO7eldjFyAdlNTBJNM/cwgyTYBAwlut52sYEkRASaGSUalvSC OcwCE5gkZn5qYOpi5OAQFoiXWL2YH6SBRUBV4svjX2AbeAU8JH7ve84GsU1O4uSxyWBxTgFP iR8/1zNBbPaQOH9/H+sERt4FjAyrGEVSS4tz03OLjfSKE3OLS/PS9ZLzczcxAkN+27GfW3Yw dr0LPsQowMGoxMPrdLsmQog1say4MvcQowQHs5II71yBuggh3pTEyqrUovz4otKc1OJDjKZA R01klhJNzgfGY15JvKGJobmloZGxhYW5kZGSOO/UD1fChQTSE0tSs1NTC1KLYPqYODilGhgP 1uj9FQ+bkvC8IWl9P0ta6Yuvxk2nBHnrIg1V26bOf/1SJ12/51HdGZmUaYstU+/seWcr9t9U p9+qq+j59xmTdgfzHVjTpPEn+E77G6k49ZuskeeD1skXLD7IoDj3zoO6HL57Uue4hGIvsxt7 uFxgdDt7c01K0o0oC16H9WcEJmZ0iz55tEWJpTgj0VCLuag4EQAyI4FwjwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124459eucas1p1ead13705d84054c1d69b5d7a9795f0e9 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: 20170117124459eucas1p1ead13705d84054c1d69b5d7a9795f0e9 X-RootMTR: 20170117124459eucas1p1ead13705d84054c1d69b5d7a9795f0e9 References: <1484657084-26227-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 Return proper error code in case of memory allocation failure. Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index b11e67e85460..10b3fd826231 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -751,7 +751,7 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions( functions = devm_kzalloc(dev, func_cnt * sizeof(*functions), GFP_KERNEL); if (!functions) - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOMEM); func = functions; /* From patchwork Tue Jan 17 12:44:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91630 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470428qgi; Tue, 17 Jan 2017 04:46:12 -0800 (PST) X-Received: by 10.99.44.3 with SMTP id s3mr45987004pgs.148.1484657172396; Tue, 17 Jan 2017 04:46:12 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.12; Tue, 17 Jan 2017 04:46:12 -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 S1750922AbdAQMqK (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:10 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:15426 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdAQMqF (ORCPT ); Tue, 17 Jan 2017 07:46:05 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJX0042NCR1QH70@mailout2.w1.samsung.com>; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p18e7046c86f8974b67065960d29628e5f~aj8RyyoKO2982329823eucas1p1R; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 2B.F7.09557.CC11E785; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124500eucas1p1b61ec676f421eae7d28d750a0746a813~aj8ROWT1_1115411154eucas1p1B; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-d2-587e11cc2593 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A6.E4.10233.6C11E785; Tue, 17 Jan 2017 12:44:54 +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:45:00 +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 v2 07/13] pinctrl: samsung: Add missing initconst annotation Date: Tue, 17 Jan 2017 13:44:38 +0100 Message-id: <1484657084-26227-8-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+NgFrrFIsWRmVeSWpSXmKPExsWy7djP87pnBOsiDN5eNLLYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK6P7zmOWgsvKFVfvzWVrYDwm 18XIySEhYCJx6UYXO4QtJnHh3nq2LkYuDiGBpYwSJz9dYwNJCAl8ZpT48EwFpmFm4wNWiKJl jBLHlu5jgXAamCRWzzrGBFLFJmAo0fW2C2yUiEAzo8TMu3vZQRxmgT4mic+b9zJ2MXJwCAv4 SGydkQtisgioSuz85wbSyyvgIbHjbAsLxDY5iZPHJrOC2JwCnhI/fq5nAhkjIdDPLrFz1k8m kF4JAVmJTQeYIUwXieaDIRCtwhKvjm+B+kxG4vLkbqiR/YwSTa3aEPYMRolzb3khbGuJw8cv gq1iFuCTmLRtOtRIXomONiGIEg+JP7s7oEY6Six49Rjq9TmMEu+2HmWdwCizgJFhFaNIamlx bnpqsbFecWJucWleul5yfu4mRmCMn/53/NMOxq8nrA4xCnAwKvHwzrhbEyHEmlhWXJl7iFGC g1lJhHeuQF2EEG9KYmVValF+fFFpTmrxIUZpDhYlcd49C66ECwmkJ5akZqemFqQWwWSZODil Ghjtfs202RnQL6/lM/n/vJXaYbGvzvmqKd8OcIu2refs12cWCDydLy78NdpqntqZ8z/MCzIf nGS8IDDh2wW5wLyHq99eX/NbcNJ0+8ctPBbBbzvu1G9NC9mfseFskk2NomDEdJl9p+c4xq1o u7E7klVo8krD0zKd7zttXx3VsJ/XO608YvJn1UdKLMUZiYZazEXFiQCm0dVq7QIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t/xK7rHBOsiDHY+MLPYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhnddx6zFFxWrrh6by5bA+MxuS5GTg4JAROJ mY0PWCFsMYkL99azdTFycQgJLGGUaG29zw7hNDFJ/D8/gxGkik3AUKLrbRdYlYhAM6NEw5Je MIdZYAKTxMxPDUxdjBwcwgI+Eltn5IKYLAKqEjv/uYH08gp4SOw428ICsU1O4uSxyWCbOQU8 JX78XM8EYgsB1Zy/v491AiPvAkaGVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIEhv+3Yzy07 GLveBR9iFOBgVOLhdbpdEyHEmlhWXJl7iFGCg1lJhHeuQF2EEG9KYmVValF+fFFpTmrxIUZT oJsmMkuJJucD4zGvJN7QxNDc0tDI2MLC3MhISZx36ocr4UIC6YklqdmpqQWpRTB9TBycUg2M fs9N6jgN5D2bOjv+ya4xv3e7zI7B89urxAsG77eIPzRb+Ov8u06hloZV5qxdl9aLRLXzPBJe xr22234ji11CSVJF10OzKQciI0J+Zdaf4v+xqOfAOYnjN0/J7ZuznfeOemNKhbj+lJ+n39/h 8MvceP4at5fdpGWWls6bmHiDD+gfWMG+7HODEktxRqKhFnNRcSIAm8l8NY8CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124500eucas1p1b61ec676f421eae7d28d750a0746a813 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: 20170117124500eucas1p1b61ec676f421eae7d28d750a0746a813 X-RootMTR: 20170117124500eucas1p1b61ec676f421eae7d28d750a0746a813 References: <1484657084-26227-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 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-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/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 Tue Jan 17 12:44:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91636 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470561qgi; Tue, 17 Jan 2017 04:46:28 -0800 (PST) X-Received: by 10.98.201.135 with SMTP id l7mr42918107pfk.67.1484657188149; Tue, 17 Jan 2017 04:46:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.27; Tue, 17 Jan 2017 04:46:28 -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 S1751192AbdAQMqZ (ORCPT + 13 others); Tue, 17 Jan 2017 07:46:25 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:63732 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbdAQMqH (ORCPT ); Tue, 17 Jan 2017 07:46:07 -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 <0OJX003D0CR1OO70@mailout3.w1.samsung.com>; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p2ce6a5c74ee6387c9f2bdd08e9cb4a93a~aj8STo9wV2594725947eucas1p2P; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 2F.B6.30614.DC11E785; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124500eucas1p265447c459ad0ac0a79dc3d3c833d09f6~aj8RpcZm02588425884eucas1p2J; Tue, 17 Jan 2017 12:45:00 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-32-587e11cdf232 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 77.E4.10233.7C11E785; Tue, 17 Jan 2017 12:44:55 +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:45:00 +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 v2 08/13] pinctrl: samsung: Remove dead code Date: Tue, 17 Jan 2017 13:44:39 +0100 Message-id: <1484657084-26227-9-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+NgFrrDIsWRmVeSWpSXmKPExsWy7djPc7pnBesiDD63iFtsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlfHg+B6mgs88FQ829jI1ML7m 6mLk5JAQMJFYf2gRC4QtJnHh3nq2LkYODiGBpYwSJ3W6GLmAzM+MEluWtbLC1P9+MoURIrGM UaJ74lFWCKeBSWL1rGNMIFVsAoYSXW+72EASIgLNjBIz7+5lB3GYBfqYJD5v3ssIUiUsYCMx 6/wyZhCbRUBV4uS3r2wgNq+Ah8Sy7VeZIfbJSZw8NhlsN6eAp8SPn+uZQAZJCPSzS/RvmskC cqyEgKzEpgNQ9S4SzQsamSBsYYlXx7ewQ9gyEpcnd0P92c8o0dSqDWHPYJQ495YXwraWOHz8 ItguZgE+iUnbpjNDjOeV6GgTgijxkPjw8x7UGEeJG5O7oEExh1HizJfNzBMYZRYwMqxiFEkt Lc5NTy020itOzC0uzUvXS87P3cQIjPPT/45/3MH4/oTVIUYBDkYlHl6H2zURQqyJZcWVuYcY JTiYlUR45wrURQjxpiRWVqUW5ccXleakFh9ilOZgURLn3bPgSriQQHpiSWp2ampBahFMlomD U6qBccqt0yxRT89smnui9sWnuD/ZOiVX/uZN2lkcw309KfX60T9CnyKas543rp/4xkosYBqn uNH9WRpCNw9q2C0SnmtiHLyr4i3r0lbG788Mfe/LV9isCY/+tTvU0O/5jP7Z0/nPd2TqrbQr 6Pa7f51No6UwbVvcwS/7znSvV/v9hN9czm3+pJknmZVYijMSDbWYi4oTAbX82qXvAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t/xK7rHBesiDBY/EbXYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhkPju9hKvjMU/FgYy9TA+Nrri5GTg4JAROJ 30+mMELYYhIX7q1n62Lk4hASWMIosWdHFwuE08Qk8f/8DLAqNgFDia63XWBVIgLNjBINS3rB HGaBCUwSMz81MIFUCQvYSMw6v4wZxGYRUJU4+e0rG4jNK+AhsWz7VWaIfXISJ49NZgWxOQU8 JX78XA/WKwRUc/7+PtYJjLwLGBlWMYqklhbnpucWG+kVJ+YWl+al6yXn525iBIb9tmM/t+xg 7HoXfIhRgINRiYfX6XZNhBBrYllxZe4hRgkOZiUR3rkCdRFCvCmJlVWpRfnxRaU5qcWHGE2B jprILCWanA+MybySeEMTQ3NLQyNjCwtzIyMlcd6pH66ECwmkJ5akZqemFqQWwfQxcXBKNTCW Xn0yRfd9Ntti//MhRzZV/z1vKDeh5qXituse0yZLyma/kVtkdny60u+S1We1mrmVXtc87hfL 9F/jE/Ltybaon6bXPn+J/qnEOCVuc3i5V1Hqs2hfkZ/eF+IuaKmv23eo9WuJtfWUw3GLFx14 fK8l65trvk7udEn3STs/MbE/KWSYpfF3yuVdSizFGYmGWsxFxYkA3SJoe5ECAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124500eucas1p265447c459ad0ac0a79dc3d3c833d09f6 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: 20170117124500eucas1p265447c459ad0ac0a79dc3d3c833d09f6 X-RootMTR: 20170117124500eucas1p265447c459ad0ac0a79dc3d3c833d09f6 References: <1484657084-26227-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 '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-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 10b3fd826231..2803ae57f373 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 Tue Jan 17 12:44:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91631 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470451qgi; Tue, 17 Jan 2017 04:46:16 -0800 (PST) X-Received: by 10.84.217.216 with SMTP id d24mr58351422plj.101.1484657176395; Tue, 17 Jan 2017 04:46:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.16; Tue, 17 Jan 2017 04:46:16 -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 S1751194AbdAQMqM (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:12 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:27653 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbdAQMqE (ORCPT ); Tue, 17 Jan 2017 07:46:04 -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 <0OJX005Y0CR2DW60@mailout4.w1.samsung.com>; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p1bc0f107ebfb82aad9b51159f81d588fb~aj8ShS3QH2650526505eucas1p1l; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id E8.66.17477.DC11E785; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p101d1468371db26b0244854e36281b9c9~aj8R7DJD71175611756eucas1p1V; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-83-587e11cd0d98 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E8.A5.06687.6021E785; Tue, 17 Jan 2017 12:45:58 +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:45:01 +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 v2 09/13] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Tue, 17 Jan 2017 13:44:40 +0100 Message-id: <1484657084-26227-10-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7pnBesiDFomq1psnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5fAlTHnxirmglbeik8bDBsYm7i7 GDk5JARMJNo+/WSCsMUkLtxbz9bFyMUhJLCUUeLNhdWMEM5nRolffVNYYTpWHT7ECpFYxihx 6sIXZgingUli17Uf7CBVbAKGEl1vu8BmiQg0M0rMvLuXHcRhFuhjkvi8eS8jSJWwQKTEpYYd YHNZBFQlDr6ZAWbzCnhK/D+8iBFin5zEyWOTweKcQPEfP9czgQySEOhml9jbNB8owQHkyEps OsAMUe8i0f7yERuELSzx6vgWdghbRqKz4yDUp/2MEk2t2hD2DEaJc295IWxricPHL4LtYhbg k5i0bTozxHheiY42IYgSD4mJ03dBg8JRom1uHzvE93MYJd5O/848gVFmASPDKkaR1NLi3PTU YlO94sTc4tK8dL3k/NxNjMBIP/3v+NcdjEuPWR1iFOBgVOLhdbhdEyHEmlhWXJl7iFGCg1lJ hPcld12EEG9KYmVValF+fFFpTmrxIUZpDhYlcd49C66ECwmkJ5akZqemFqQWwWSZODilGhiV uzqvbW5/Ha1w9Y3Tkf9Lrtr1vT9apffMmWmlEZNHtJSxn7nHHWa31ZNYfnM5Lth2Su//Wwm9 lDeX44OYfGdumqS3XXrlHAn7ivVhhZ4b0laK8joZBl9s68ndcX7DfrH0hUd+Bcn5cEm1vJhW OonxzxHdQC3ttZXxVx55sF3e6rO40IerS02JpTgj0VCLuag4EQCuHTCm8AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7psQnURBodvMFpsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4w5N1YxF7TyVnzaYNjA2MTdxcjJISFgIrHq 8CFWCFtM4sK99WxdjFwcQgJLGCUe3DvLCuE0MUncOL+DHaSKTcBQouttF1iViEAzo0TDkl4w h1lgApPEzE8NTCBVwgKREpcadoDNZRFQlTj4ZgaYzSvgKfH/8CJGiH1yEiePTQaLcwLFf/xc D9YrJOAhcf7+PtYJjLwLGBlWMYqklhbnpucWG+oVJ+YWl+al6yXn525iBAb9tmM/N+9gvLQx +BCjAAejEg+vw+2aCCHWxLLiytxDjBIczEoivHMF6iKEeFMSK6tSi/Lji0pzUosPMZoCHTWR WUo0OR8YkXkl8YYmhuaWhkbGFhbmRkZK4rwlH66ECwmkJ5akZqemFqQWwfQxcXBKNTD2HTj/ wDp+6v7He82Cm99lKmvHnZq6/oOZqGuNfceDzn6zi+eSL0dVcogltGYu2RrKVPbJVioxZcp1 1xip3Q/8lsT/evVVazubt5Sxd4uY9OPoGRM8te7lbJox6dyDPyFLai5bBm/e4p+ps9OWM2DH 7gn+x5vZnptp6BV3zrS11JI+O6te/qASS3FGoqEWc1FxIgCTfKctkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 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: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 X-RootMTR: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 References: <1484657084-26227-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 Replace custom code with generic helper. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 8 +++----- 1 file changed, 3 insertions(+), 5 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 2803ae57f373..59f99ea7e65b 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,12 @@ 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; struct device_node *node = pdev->dev.of_node; struct device_node *np; const struct samsung_pin_bank_data *bdata; @@ -978,8 +976,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; + ctrl = of_device_get_match_data(&pdev->dev); + ctrl += id; d->suspend = ctrl->suspend; d->resume = ctrl->resume; From patchwork Tue Jan 17 12:44: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: 91633 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470470qgi; Tue, 17 Jan 2017 04:46:18 -0800 (PST) X-Received: by 10.98.211.220 with SMTP id z89mr42734386pfk.3.1484657178636; Tue, 17 Jan 2017 04:46:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.18; Tue, 17 Jan 2017 04:46:18 -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 S1751243AbdAQMqQ (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:16 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:10134 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdAQMqE (ORCPT ); Tue, 17 Jan 2017 07:46:04 -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 <0OJX0042DCR08K70@mailout1.w1.samsung.com>; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124502eucas1p13653b5e70e7b281465aea7dbed4acca0~aj8TJnhpR2980229802eucas1p1b; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id E8.EB.28517.EC11E785; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p2ab3ec2a1dee18486878733826037d071~aj8SkrloW2594725947eucas1p2R; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-cb-587e11ce61b0 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 98.E4.10233.8C11E785; Tue, 17 Jan 2017 12:44:56 +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:45:01 +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 v2 10/13] pinctrl: samsung: Add infrastructure for pin-bank retention control Date: Tue, 17 Jan 2017 13:44:41 +0100 Message-id: <1484657084-26227-11-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+NgFrrNIsWRmVeSWpSXmKPExsWy7djP87rnBOsiDKYeELTYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK6OpZzNrwUX1ii07tjA1MLYp djFyckgImEic+fGbBcIWk7hwbz1bFyMXh5DAUkaJzub3rBDOZ0aJGZ9eMcJ0nGo/yQyRWMYo sXvjFqiqBiaJXdd+sINUsQkYSnS97QKbJSLQzCgx8+5edhCHWaCPSeLz5r1Aszg4hAXiJRZ+ TABpYBFQlbhz+zlYM6+Ap8SjhQuZIdbJSZw8NpkVxOYEiv/4uZ4JIt7PLtGw1hNkjISArMSm A8wQpovEv/fcEBXCEq+Ob2GHsGUkLk/uhnqzn1GiqVUbwp7BKHHuLS+EbS1x+PhFsE3MAnwS k7ZNhxrJK9HRJgRR4iHx9fwFqAMcJfZPXswI8focRokFXzazTGCUWcDIsIpRJLW0ODc9tdhE rzgxt7g0L10vOT93EyMwyk//O/5lB+PiY1aHGAU4GJV4eGfcrYkQYk0sK67MPcQowcGsJMI7 V6AuQog3JbGyKrUoP76oNCe1+BCjNAeLkjjvngVXwoUE0hNLUrNTUwtSi2CyTBycUg2MpltC D27JXf4saMFJkUeCK5gzGF4pfTP6+VxfQv1vdG2KpWjK5odrrJpP/FrMfmxbs7OPdKtI/ubc KZJ6rlOnTlXeyrZBIyZVtP+hO1Os3y2fs+vmlEwRPOm2ekrIk66uf6I1/y52ZpxlOnlYdXOf j4z73oaSv7NW96y803jyVU++7/9Nly7YKLEUZyQaajEXFScCAIh6x9nuAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7onBOsiDCbMEbXYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhlNPZtZCy6qV2zZsYWpgbFNsYuRk0NCwETi VPtJZghbTOLCvfVsXYxcHEICSxglDnXugnKamCRunN/BDlLFJmAo0fW2CywhItDMKNGwpBfM YRaYwCQx81MDUxcjB4ewQLzEwo8JIA0sAqoSd24/B2vmFfCUeLRwIdQ6OYmTxyazgticQPEf P9czgdhCAh4S5+/vY53AyLuAkWEVo0hqaXFuem6xkV5xYm5xaV66XnJ+7iZGYNBvO/Zzyw7G rnfBhxgFOBiVeHidbtdECLEmlhVX5h5ilOBgVhLhnStQFyHEm5JYWZValB9fVJqTWnyI0RTo qInMUqLJ+cCIzCuJNzQxNLc0NDK2sDA3MlIS55364Uq4kEB6YklqdmpqQWoRTB8TB6dUA2Pa Qtmr686mXw2akPU68bBgg/eKq/0C3LtCmzaaGU8LqVmfZOn26LGeysE/HewXJ3hWLp0ndn1i 5oITB+LOfzQ/dsvTS5P7ZJEyl/YCrzyJAj3OzTufbX+YJzwn+9rGfzyrTS0U3k37L/wxxWDF ZIPg0w0Lrh3//fLVzqeOKhsb/r/cznrIw/qJEktxRqKhFnNRcSIAdSUtR5ACAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124501eucas1p2ab3ec2a1dee18486878733826037d071 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: 20170117124501eucas1p2ab3ec2a1dee18486878733826037d071 X-RootMTR: 20170117124501eucas1p2ab3ec2a1dee18486878733826037d071 References: <1484657084-26227-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 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 Reviewed-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 +++++++++ drivers/pinctrl/samsung/pinctrl-samsung.h | 42 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) -- 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 59f99ea7e65b..021abd7221f8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1060,6 +1060,13 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) if (res) drvdata->irq = res->start; + if (ctrl->retention_data) { + drvdata->retention_ctrl = ctrl->retention_data->init(drvdata, + ctrl->retention_data); + if (IS_ERR(drvdata->retention_ctrl)) + return PTR_ERR(drvdata->retention_ctrl); + } + ret = samsung_gpiolib_register(pdev, drvdata); if (ret) return ret; @@ -1126,6 +1133,8 @@ static void samsung_pinctrl_suspend_dev( if (drvdata->suspend) drvdata->suspend(drvdata); + if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable) + drvdata->retention_ctrl->enable(drvdata); } /** @@ -1173,6 +1182,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->disable) + drvdata->retention_ctrl->disable(drvdata); } /** diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index 6f7ce7539a00..5ebbf4137a06 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 (*enable)(struct samsung_pinctrl_drv_data *); + void (*disable)(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 Tue Jan 17 12:44:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91635 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470551qgi; Tue, 17 Jan 2017 04:46:26 -0800 (PST) X-Received: by 10.98.207.193 with SMTP id b184mr43841268pfg.12.1484657186272; Tue, 17 Jan 2017 04:46:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.26; Tue, 17 Jan 2017 04:46:26 -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 S1750924AbdAQMqX (ORCPT + 13 others); Tue, 17 Jan 2017 07:46:23 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:27653 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdAQMqH (ORCPT ); Tue, 17 Jan 2017 07:46:07 -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 <0OJX005Y2CR3LS60@mailout4.w1.samsung.com>; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124502eucas1p2c95a775ceb6ff68d1ae6439795c88f67~aj8TgHxKC0763607636eucas1p25; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id D6.57.16908.1D11E785; Tue, 17 Jan 2017 12:45:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124502eucas1p131b3b424454ee380b0c93899989a51f6~aj8S0oAkU1114911149eucas1p1C; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-9b-587e11d10567 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 1A.A5.06687.6021E785; Tue, 17 Jan 2017 12:45:58 +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:45:02 +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 v2 11/13] pinctrl: samsung: Move retention control from mach-exynos to the pinctrl driver Date: Tue, 17 Jan 2017 13:44:42 +0100 Message-id: <1484657084-26227-12-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87oXBesiDD4f57XYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK+P+9ZVMBdurK55MbmRrYFye 0cXIySEhYCLx5MN5dghbTOLCvfVsXYxcHEICyxglpl1cwg7hfGaU2PjhOWsXIwdYx/U2Q7ii 5/9nsUI4DUwSP7Y1sICMYhMwlOh62wU2SkSgmVFi5t29YKOYBfqYJD5v3ssIUiUskC1xqu8s mM0ioCqxd89bsEN4BTwlWhsOQx0lJ3Hy2GRWEJsTKP7j53omkEESAv3sEosvtbBA3CQrsekA M0S9i8S9Bx1MELawxKvjW6DmyEh0dhyEivczSjS1akPYMxglzr3lhbCtJQ4fvwi2i1mAT2LS tunMEON5JTrahCBKPCS6dn1lhbAdJfb13WeC+H4Oo8SdaXfYJzDKLGBkWMUoklpanJueWmyo V5yYW1yal66XnJ+7iREY6af/HX+/g/Fpc8ghRgEORiUeXofbNRFCrIllxZW5hxglOJiVRHhf ctdFCPGmJFZWpRblxxeV5qQWH2KU5mBREufdu+BKuJBAemJJanZqakFqEUyWiYNTqoHR6k1c dkh61PW1bP5Hoi6qq7+tWhoRuHCToZZmbu8OrxkZnzi+ndVNrSp7JnpS5Vtq/71JBv8WzDN8 zvjx9SQpqRs+0WwzEozaJ/6uq/oQba3+OUlw+ivnBZu+rlf/uvnZ7a08+ysL5d9u/uk85/6C hO/MEdIV9i7t//f+X+AoeN9B6av3n0MJSizFGYmGWsxFxYkAJB41BfACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7psQnURBi+W2VhsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4z711cyFWyvrngyuZGtgXF5RhcjB4eEgInE 9TbDLkZOIFNM4sK99WxdjFwcQgJLGCWWzn7EDOE0MUn0bT7LCFLFJmAo0fW2C6xKRKCZUaJh SS+YwywwgUli5qcGJpAqYYFsiVN9EB0sAqoSe/e8ZQexeQU8JVobDrND7JOTOHlsMiuIzQkU //FzPVivkICHxPn7+1gnMPIuYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERj024793LyD 8dLG4EOMAhyMSjy8DrdrIoRYE8uKK3MPMUpwMCuJ8M4VqIsQ4k1JrKxKLcqPLyrNSS0+xGgK dNREZinR5HxgROaVxBuaGJpbGhoZW1iYGxkpifOWfLgSLiSQnliSmp2aWpBaBNPHxMEp1cDY tfpeZ2zCVLfSoh0Wc0R2r45pLRB/b1LxndOIb77CF9GrB++2a89UWWqaHyrX8oF1urLSTen0 b526T72MOPNXnFJKVprprLF61tX3xkbK/f7nxTvrdxquK08yE1xgK6h/aEP230/vbE4fNHq/ 8vm0yt3Ttj+rX72RcbLto4o0xfnMMpI7bSuVWIozEg21mIuKEwH5UxxYkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124502eucas1p131b3b424454ee380b0c93899989a51f6 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: 20170117124502eucas1p131b3b424454ee380b0c93899989a51f6 X-RootMTR: 20170117124502eucas1p131b3b424454ee380b0c93899989a51f6 References: <1484657084-26227-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 | 146 +++++++++++++++++++++++++++++++ 2 files changed, 146 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..7beb0d4d2f20 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,55 @@ 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_enable(struct samsung_pinctrl_drv_data *drvdata) +{ + if (drvdata->retention_ctrl->refcnt) + atomic_inc(drvdata->retention_ctrl->refcnt); +} + +static void exynos_retention_disable(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 ERR_PTR(-ENOMEM); + + pmu_regs = exynos_get_pmu_regmap(); + if (IS_ERR(pmu_regs)) + return ERR_CAST(pmu_regs); + + ctrl->priv = pmu_regs; + ctrl->regs = data->regs; + ctrl->nr_regs = data->nr_regs; + ctrl->value = data->value; + ctrl->refcnt = data->refcnt; + ctrl->enable = exynos_retention_enable; + ctrl->disable = exynos_retention_disable; + + 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 +774,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 +809,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 +818,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 +871,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 +913,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 +922,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 +1001,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 +1010,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 +1018,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 +1098,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 +1106,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 +1121,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 +1348,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 +1383,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 Tue Jan 17 12:44:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91634 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470482qgi; Tue, 17 Jan 2017 04:46:20 -0800 (PST) X-Received: by 10.84.215.194 with SMTP id g2mr58619216plj.16.1484657180266; Tue, 17 Jan 2017 04:46:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.20; Tue, 17 Jan 2017 04:46:20 -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 S1751047AbdAQMqS (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:18 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:63732 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbdAQMqI (ORCPT ); Tue, 17 Jan 2017 07:46:08 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJX009PWCR1H360@mailout3.w1.samsung.com>; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124503eucas1p2d95239cdfb1a14b7bf86e5c9911eae92~aj8T69tRm0762907629eucas1p2D; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 4A.EB.28517.FC11E785; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124502eucas1p19ce0cd772fc4295b207b20cdad30485e~aj8TUilHJ1116311163eucas1p11; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-cf-587e11cfc631 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DA.A5.06687.7021E785; Tue, 17 Jan 2017 12:45:59 +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:45:02 +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 v2 12/13] pinctrl: samsung: Move retention control from mach-s5pv210 to the pinctrl driver Date: Tue, 17 Jan 2017 13:44:43 +0100 Message-id: <1484657084-26227-13-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+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87rnBesiDN78Z7PYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PDpO3MBT1KFV8XTGZtYLwu 08XIySEhYCIx6dhaFghbTOLCvfVsXYxcHEICSxklnh3YwgrhfGaU2P+sjwmmo2HzQXaIxDJG idfbZkM5DUwSP7Y1gM1iEzCU6HrbBTZLRKCZUWLm3b1gVcwCfUwSnzfvZQSpEhbIkXjw9AUr iM0ioCqxfEIr2A5eAU+JV8/uskHsk5M4eWwyWA0nUPzHz/VQd3SzS7RMq+ti5ACyZSU2HWCG CLtILDl/A8oWlnh1fAs7hC0j0dlxEKq1n1GiqVUbwp7BKHHuLS+EbS1x+PhFsFXMAnwSk7ZN Z4YYzyvR0SYEUeIh8XX6bmh4OUpMnD2dCeL5OYwSGxbNZZ/AKLOAkWEVo0hqaXFuemqxiV5x Ym5xaV66XnJ+7iZGYKSf/nf8yw7GxcesDjEKcDAq8fDOuFsTIcSaWFZcmXuIUYKDWUmEd65A XYQQb0piZVVqUX58UWlOavEhRmkOFiVx3j0LroQLCaQnlqRmp6YWpBbBZJk4OKUaGGsS7776 It4yfd4ncfFb0le/nI4rDtvvN1145toqFSPBppN39yvvifvaFl+mXLz13PzXE58ffHnTa7bn /7qPVj4qMkb/vnrMzq4v+WDzcnae/r/5F/oTmW2kpjqIhCZtfXw1aL3s7t1tB79NZlA+KGuf v1t56UY+J6XEBa8/++fsTTwj4v/u7yElluKMREMt5qLiRACrBNlY8AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsVy+t/xK7rsQnURBpNnKVhsnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBblZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4wNk7YzF/QoVXxdMJm1gfG6TBcjJ4eEgIlE w+aD7BC2mMSFe+vZuhi5OIQEljBKXNn9lAnCaWKS6Nt8lhGkik3AUKLrbRdYlYhAM6NEw5Je MIdZYAKTxMxPDUwgVcICORIPnr5gBbFZBFQllk9oBYvzCnhKvHp2lw1in5zEyWOTwWo4geI/ fq4HqxES8JA4f38f6wRG3gWMDKsYRVJLi3PTc4sN9YoTc4tL89L1kvNzNzECw37bsZ+bdzBe 2hh8iFGAg1GJh9fhdk2EEGtiWXFl7iFGCQ5mJRHeuQJ1EUK8KYmVValF+fFFpTmpxYcYTYGO msgsJZqcD4zJvJJ4QxNDc0tDI2MLC3MjIyVx3pIPV8KFBNITS1KzU1MLUotg+pg4OKUaGM32 7ct4E7hN4mYOqwj3hwaLuNM1tgE9dgsUb/NMMa5INRU/GXnntbHb4sgDT5/qs2Xd2pK/KShd wCVc5eQExx112TFs75zSvBtbIlkLmHyYb1t1K8yd/21Kkan3+6XrcoN5Hlxk+D+5lWXrnuIv oROX87o9kK9ZFW/vYbVllvopzVNnpdcKKLEUZyQaajEXFScCABZgWuKRAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124502eucas1p19ce0cd772fc4295b207b20cdad30485e 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: 20170117124502eucas1p19ce0cd772fc4295b207b20cdad30485e X-RootMTR: 20170117124502eucas1p19ce0cd772fc4295b207b20cdad30485e References: <1484657084-26227-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 7beb0d4d2f20..675a38e956f8 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_disable(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 ERR_PTR(-ENOMEM); + + 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 ERR_PTR(-ENODEV); + } + + clk_base = of_iomap(np, 0); + if (!clk_base) { + pr_err("%s: failed to map clock registers\n", __func__); + return ERR_PTR(-EINVAL); + } + + ctrl->priv = clk_base; + ctrl->disable = s5pv210_retention_disable; + + 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 Tue Jan 17 12:44:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91637 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470580qgi; Tue, 17 Jan 2017 04:46:29 -0800 (PST) X-Received: by 10.98.207.193 with SMTP id b184mr43841510pfg.12.1484657189351; Tue, 17 Jan 2017 04:46:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.29; Tue, 17 Jan 2017 04:46:29 -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 S1751186AbdAQMq1 (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:27 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:10134 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750984AbdAQMqG (ORCPT ); Tue, 17 Jan 2017 07:46:06 -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 <0OJX0045CCR48M70@mailout1.w1.samsung.com>; Tue, 17 Jan 2017 12:45:04 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170117124503eucas1p27fa1e3703f16a2f55326c805bb3fc1d2~aj8UboRT70769107691eucas1p2i; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 2C.F7.09557.FC11E785; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124503eucas1p1f63d709d794c82dcea8082dbb9c0fb3f~aj8T0xUGi2982729827eucas1p1Z; Tue, 17 Jan 2017 12:45:03 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-d9-587e11cf1cbc Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8B.A5.06687.8021E785; Tue, 17 Jan 2017 12:46:00 +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:45:03 +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 v2 13/13] pinctrl: samsung: Replace syscore ops with standard platform device pm_ops Date: Tue, 17 Jan 2017 13:44:44 +0100 Message-id: <1484657084-26227-14-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: H4sIAAAAAAAAAzWRUUhTYRTH++7ddq/DxXVK+zCVNggscSrt4aISCT3cAqGXaPaSl7zpyKns qmWJDcWmkzSyco3Z9lCaq1hu00pUclOnCS7BVrGmiNDS8sVlzFjWtjvffv/v/M//nMOHo+IA Lx1X1dQzmhq6WiYQ8kZnd7253pQWZf4XZzY5bLDxSa/3FUbejwwipH3dxycd5gggQ3emAWnw TiLky+kARrp/6vikdSwCTgmpt8YARtmtnQLqq29cQDme3KK6nVZAhexZ5wQXhcUVTLWqkdHk nSwXVn3fnELq5rKv6/qm+FqwLtWDJBwSCvh5x41yfAh+WLEJ9ECIi4mnAPbbPAgnQgAOmcKC /Y7l4REsxmJiAMCVIMqZtAjUbjyORwmIAqjf0sej0og2AB8FJrCYQIluBIYcEyDmSiWuwA73 bryDRxyF4eBinEXEGRhs/YRw47Lg/GwvP8ZJ0ffwri2+EyS6MDjQvR4VeFRkQvu7xBGn4drI UmLVVLjpcWIcZ8DOjqlEZg+Are05HBsAXNwScVwE3Z6l+CyUOAjvjfahXLwIdtwWcxYKbv7q SUSWQMeyHnDXmwD0+ObRuyDDAg5YQRrTwKorGfaEnKXVbENNpfxyrdoOop++sOfZfgN25gpd gMCBLFlkCDQrxXy6kW1SuwDEUVmaqJ9oUYpFFXTTDUZTe0nTUM2wLnAY58kkonHL8gUxUUnX M1cZpo7R7FcRPCldC1Jyi9ukvUXlOQs5ulS5yWl4b7R4fGvj/3KTn9dJjDe/RZpf+2e28917 TGbpWSDX+aUPz1te1KrYsFHlmjFLHPPIxtqkUq3cKSwDUoV3qE03FpSnzCkk+iOrXaPwz18/ VXit5UGe6WPp4LNV2Q/tseF2HzD7FbT5d1mJjMdW0QXHUQ1L/wflE2xV8AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xK7ocQnURBt2TWCw2zljPanH+/AZ2 iyl/ljNZbHp8jdVi8/w/jBafe48wWsw4v4/JYu2Ru+wWh9+0s1qs2vWH0YHLY+esu+wem1Z1 snncubaHzWPzknqPvi2rGD0+b5ILYItys8lITUxJLVJIzUvOT8nMS7dVCg1x07VQUshLzE21 VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW8aLVweZCk5oVLRPP8jawPhYsYuRk0NCwETi ysat7BC2mMSFe+vZQGwhgSWMEu9vRHQxcgHZTUwSR44uYAZJsAkYSnS97WIDSYgINDNKNCzp BXOYBSYwScz81MAEUiUskCaxe1Mn2FgWAVWJH8/PgXXzCnhKPG+6zgSxTk7i5LHJrCA2J1D8 x8/1TBCrPSTO39/HOoGRdwEjwypGkdTS4tz03GJDveLE3OLSvHS95PzcTYzAoN927OfmHYyX NgYfYhTgYFTi4XW4XRMhxJpYVlyZe4hRgoNZSYR3rkBdhBBvSmJlVWpRfnxRaU5q8SFGU6Cj JjJLiSbnAyMyryTe0MTQ3NLQyNjCwtzISEmct+TDlXAhgfTEktTs1NSC1CKYPiYOTqkGxmgp uejdOivNrzkek/jcm2m/8vC3ZemBLn+zb2Y++Mg1/2mj6Lve9bdZ+RbKdnw6svrWf6WSS/rf L8WV320U6mHsW+q5nidN2GJayPy/H95anBdLZnR27N3l8KvpYGbB3qj45+utHJLSNh7TuShp VSlrvyJfNWyOzoFXPWtT/dk7V/at8/4WqcRSnJFoqMVcVJwIAAlASbKQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124503eucas1p1f63d709d794c82dcea8082dbb9c0fb3f 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: 20170117124503eucas1p1f63d709d794c82dcea8082dbb9c0fb3f X-RootMTR: 20170117124503eucas1p1f63d709d794c82dcea8082dbb9c0fb3f References: <1484657084-26227-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 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, 14 insertions(+), 58 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/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 021abd7221f8..d79eadad6c5f 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) @@ -1084,22 +1080,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++) { @@ -1135,18 +1127,21 @@ static void samsung_pinctrl_suspend_dev( drvdata->suspend(drvdata); if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable) drvdata->retention_ctrl->enable(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. * * 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) +static int samsung_pinctrl_resume(struct device *dev) { + struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev); int i; if (drvdata->resume) @@ -1185,48 +1180,11 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (drvdata->retention_ctrl && drvdata->retention_ctrl->disable) drvdata->retention_ctrl->disable(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", @@ -1268,25 +1226,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);