From patchwork Wed Aug 15 19:57:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 10760 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3496323F46 for ; Wed, 15 Aug 2012 19:40:39 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id E182DA188D5 for ; Wed, 15 Aug 2012 19:40:38 +0000 (UTC) Received: by ggmi2 with SMTP id i2so2339908ggm.11 for ; Wed, 15 Aug 2012 12:40:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=zbxu//nReSMBW2Ab3kmHmNuzpwAjZCOQavhQdHekJfI=; b=gShSoluXyiSJsP+VjmSx2wV7ASYCslQrFZoQOWktASBaOwR2ZyQdGj1sA4rgKwhZAc YYxGQbEMqPUFb7w/DPWLeizIrwjmyv6cA32IwLbIOhCUFGDW/iBzPxoSgZtKvAOSZBE7 MxK1zwpZygeou1pc8YfECmTF/xP0A9faY+zvU4bpJx20DiKgYSVa233DCjkTRPEVhvj7 KQYu833+hBWuaPrWdY3mw5xvTMe+MW3MZt8GhXtRCHDpy9w1AvZw314gB3eCTax5dfEE fAfPHFIq3/EiaKsIpyPYifQRO2p7Z+MzHupdQ/qwPJ6jEkwwYIBz4WRzs4J8R2ijwG80 hEnA== Received: by 10.42.249.205 with SMTP id ml13mr12678289icb.49.1345059638038; Wed, 15 Aug 2012 12:40:38 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp90473igc; Wed, 15 Aug 2012 12:40:37 -0700 (PDT) Received: by 10.68.213.167 with SMTP id nt7mr27707597pbc.127.1345059637273; Wed, 15 Aug 2012 12:40:37 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id op6si4006197pbc.204.2012.08.15.12.40.36; Wed, 15 Aug 2012 12:40:37 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M8T00MBTANHKYH0@mailout4.samsung.com>; Thu, 16 Aug 2012 04:40:36 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-ad-502bfb33be63 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id B6.0F.18282.33BFB205; Thu, 16 Aug 2012 04:40:35 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M8T009KRANCNZB0@mmp1.samsung.com>; Thu, 16 Aug 2012 04:40:35 +0900 (KST) From: Thomas Abraham To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linus.walleij@linaro.org, grant.likely@secretlab.ca, rob.herring@calxeda.com, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used Date: Thu, 16 Aug 2012 01:27:35 +0530 Message-id: <1345060656-32201-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1345060656-32201-1-git-send-email-thomas.abraham@linaro.org> References: <1345060656-32201-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAV3j39oBBk9+WltM+bOcyWLK4S8s Dkwed67tYQtgjOKySUnNySxLLdK3S+DK+P72HVvBDd6KmSvuMzcw9nJ3MXJySAiYSDTvO8wC YYtJXLi3nq2LkYtDSGARo8Tn/ivMEE4bk8Tuua3sIFVsAgYSjxa+A7NFBBQkNvc+YwUpYhY4 wShxu+8kWEJYIEbi+stZQDYHB4uAqsTtGRkgYV4BT4n3X/8yQmxTktjQe5QJxOYU8JL4PLOT FcQWAqppaz/HOoGRdwEjwypG0dSC5ILipPRcI73ixNzi0rx0veT83E2MYP8/k97BuKrB4hCj AAejEg8vw0GtACHWxLLiytxDjBIczEoivD9OaQcI8aYkVlalFuXHF5XmpBYfYpTmYFES5zXx /uovJJCeWJKanZpakFoEk2Xi4JRqYAzhmjz30GSVzJ9RYTNt3hdl5n+MvJfsWa5+jsN+55xd F122e/IxyZXLPt0YvSYkhjNf8MOcso0/GeWr5kl2Fxc5LqnMexmoMcvbpHmX7RkWJ9/kuH+T J1rFbDTZ1tg8e+8nh0+L/2cdX/zDbuVeiVen357z3u4WvH2mWPvWdi/NFnmvBUXBakosxRmJ hlrMRcWJAC62dND7AQAA X-TM-AS-MML: No X-Gm-Message-State: ALoCoQlxtp7jFuTz+Mgu+Jtwmz5D+NERHBkaIzcpGmQdBMYiEFZmzvoz8tFGqsTepKq9QRrWo6UX Pinctrl driver, when enabled, registers all the gpio pins and hence the registration of gpio pins by this driver can be skipped. Acked-by: Grant Likely Acked-by: Linus Walleij Signed-off-by: Thomas Abraham --- 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 92f7b2b..8e61053 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_OF + /* + * 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 -ENODEV; +#endif + /* gpio part1 */ gpio_base1 = ioremap(EXYNOS4_PA_GPIO1, SZ_4K); if (gpio_base1 == NULL) {