From patchwork Wed Oct 24 14:37:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1638751 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 BA95A3FD4E for ; Wed, 24 Oct 2012 14:40:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TR26E-0004Zn-AY; Wed, 24 Oct 2012 14:38:26 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TR25m-0004TB-0P for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 14:37:59 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MCE00DXSJB0FWD0@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 23:37:56 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-cc-5087fd449708 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 2B.39.12699.44DF7805; Wed, 24 Oct 2012 23:37:56 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MCE008EXJASPN20@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2012 23:37:56 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] gpio: samsung: Skip registration if pinctrl driver is present on Exynos4x12 Date: Wed, 24 Oct 2012 16:37:35 +0200 Message-id: <1351089457-8205-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1351089457-8205-1-git-send-email-t.figa@samsung.com> References: <1351089457-8205-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jAV2Xv+0BBgefWVhsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MW+92MhX0S1Q0LJ3G3MB4SbiLkZNDQsBEYnnPDCYIW0ziwr31 bF2MXBxCAosYJf7OWcMK4Wxmkli48yQLSBWbgJrE54ZHbCC2iICGxJSux+wgRcwCk5kkjv4/ xQ6SEBZIklh46iOYzSKgKtH/vhWsgVfAUaJz/SVWiHXyEk/v94HFOQWcJG7fXQK2QAio5sis TWwTGHkXMDKsYhRNLUguKE5KzzXSK07MLS7NS9dLzs/dxAj2+jPpHYyrGiwOMQpwMCrx8Cae aAsQYk0sK67MPcQowcGsJMI7+UF7gBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeZo+UACGB9MSS 1OzU1ILUIpgsEwenVAOjguH83wr++w60OPEe50o3y1h/Ye2PhTwKas+M4nedSdx1oCg3YMY5 jobnriGKxp+nnJnb8U7ZKkr2fuI9CVVL+1NfxbTZe2sD2liU7f/UhU/5dWlq4tYP6zx4PWfw r1rJtt6Pg3WT8/rJ+m2Lp9d15Yaqr5CMOye9YOXHQ/WMTi0tG/1+6nUqsRRnJBpqMRcVJwIA B86llvYBAAA= X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.6 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.6 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] 3.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 -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linus.walleij@linaro.org, kgene.kim@samsung.com, swarren@wwwdotorg.org, t.figa@samsung.com, tomasz.figa@gmail.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, thomas.abraham@linaro.org, devicetree-discuss@lists.ozlabs.org, m.szyprowski@samsung.com 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 This patch modifies the Samsung GPIO driver to check for pinctrl driver presence earlier and use generic matching instead of a single compatible value. This allows us to fix warning about unrecognized SoC in case of Exynos4x12, which is not supported by this driver. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park Acked-by: Linus Walleij --- drivers/gpio/gpio-samsung.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 43c4595..01f7fe9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -2796,27 +2796,6 @@ 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) { @@ -3031,6 +3010,28 @@ static __init int samsung_gpiolib_init(void) int i, nr_chips; int group = 0; +#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; + static const struct of_device_id exynos_pinctrl_ids[] = { + { .compatible = "samsung,pinctrl-exynos4210", }, + { .compatible = "samsung,pinctrl-exynos4x12", }, + }; + for_each_matching_node(pctrl_np, exynos_pinctrl_ids) + if (pctrl_np && of_device_is_available(pctrl_np)) + return -ENODEV; +#endif + samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); if (soc_is_s3c24xx()) {