From patchwork Thu Aug 23 11:15:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 1366411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4BBC03FC66 for ; Thu, 23 Aug 2012 11:01:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4V7B-0005rg-Gm; Thu, 23 Aug 2012 10:58:17 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4V6w-0005qR-W0 for linux-arm-kernel@lists.infradead.org; Thu, 23 Aug 2012 10:58:04 +0000 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M9700LXIFSICG00@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 23 Aug 2012 19:58:02 +0900 (KST) X-AuditID: cbfee61a-b7fc66d0000043b7-d8-50360cb9ab7b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 97.D7.17335.9BC06305; Thu, 23 Aug 2012 19:58:02 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9700JY7FS8WS20@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 23 Aug 2012 19:58:01 +0900 (KST) From: Thomas Abraham To: linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH v3 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used Date: Thu, 23 Aug 2012 16:45:28 +0530 Message-id: <1345720529-32315-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1345720529-32315-1-git-send-email-thomas.abraham@linaro.org> References: <1345720529-32315-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIJMWRmVeSWpSXmKPExsVy+t9jQd1dPGYBBpOfsVhsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6Mb523WAvu8la0nPzA3MA4mbuLkZNDQsBEYtPiz6wQtpjEhXvr 2UBsIYHpjBI7p5p2MXIB2euZJF5cm8MEkmATMJB4tPAdO4gtIuAqcfzFWUaQImaBX4wSr7ds AisSFoiR6Ni0CGgqBweLgKrEnLsmIGFeAU+JKy8usEMsU5LY0HsUrJxTwEti19dVzBCLPSVW bz3HMoGRdwEjwypG0dSC5ILipPRcQ73ixNzi0rx0veT83E2MYI8/k9rBuLLB4hCjAAejEg9v RqxpgBBrYllxZe4hRgkOZiURXi9OswAh3pTEyqrUovz4otKc1OJDjNIcLErivPx9hgFCAumJ JanZqakFqUUwWSYOTqkGxuKHjV1vZqj9DfysM+ne/XO72CJnSt5PVOSfHHtuWsqdT58b9rfm h1k8ZHtQfNb/slvsctaeyW9PyXrFOn/2XPxVYG2rzX8hTZn5l74sEC5rcmBu2lF9XOuVmerm d7enneF0Or7F83qKlGHjjrBZ3KejTj7Xz5f4y+V2L4Vjf855FoW/Lht6cpVYijMSDbWYi4oT AelFvcX0AQAA X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.25 listed in list.dnswl.org] 0.0 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -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] Cc: kgene.kim@samsung.com, swarren@wwwdotorg.org, linus.walleij@linaro.org, patches@linaro.org, rob.herring@calxeda.com, grant.likely@secretlab.ca, linux-samsung-soc@vger.kernel.org, dong.aisheng@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Pinctrl driver, when enabled, registers all the gpio pins and hence the registration of gpio pins by this driver can be skipped. Signed-off-by: Thomas Abraham Acked-by: Grant Likely Acked-by: Linus Walleij --- drivers/gpio/gpio-samsung.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index ba126cc..41ab7f6 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -2734,6 +2734,27 @@ static __init void exynos4_gpiolib_init(void) int group = 0; void __iomem *gpx_base; +#ifdef CONFIG_PINCTRL_SAMSUNG + /* + * This gpio driver includes support for device tree support and + * there are platforms using it. In order to maintain + * compatibility with those platforms, and to allow non-dt + * Exynos4210 platforms to use this gpiolib support, a check + * is added to find out if there is a active pin-controller + * driver support available. If it is available, this gpiolib + * support is ignored and the gpiolib support available in + * pin-controller driver is used. This is a temporary check and + * will go away when all of the Exynos4210 platforms have + * switched to using device tree and the pin-ctrl driver. + */ + struct device_node *pctrl_np; + const char *pctrl_compat = "samsung,pinctrl-exynos4210"; + pctrl_np = of_find_compatible_node(NULL, NULL, pctrl_compat); + if (pctrl_np) + if (of_device_is_available(pctrl_np)) + return; +#endif + /* gpio part1 */ gpio_base1 = ioremap(EXYNOS4_PA_GPIO1, SZ_4K); if (gpio_base1 == NULL) {