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@linaro.org X-Patchwork-Id: 10898 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 31F7423E53 for ; Thu, 23 Aug 2012 10:58:05 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B0BF5A18FA4 for ; Thu, 23 Aug 2012 10:57:50 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j38so1043505iad.11 for ; Thu, 23 Aug 2012 03:58:04 -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=Jn1cULSwGTwjNYvW4bTmV8iKj5yIOy1meOegInWT3NU=; b=etFQLdek28yvlOAT37VQdM1AKXfFvLgpaRbRC/mzsErdtqGgCtN3inHc+5HgtI058E hNfzvHxvBJPbtxQZUe46mjHr2qTDt/Xr0i+r8xn2f4uAvjqFRLEdVCWwAAQDlCGzvlA7 QajXOnV2nE/JRN6Bfha/k4Rik+9GP6/XOv6mHG5BgYj59X/DvdPmfR3MIjvCZgxk1WkF l/6SUIFnPuTZcITHl//tcnZ0Ec1W11zIPB3PPk8CUoFTxd3aQ6o3f4GEq9kTbI4Z1Gn4 +7JHdXHQtugzw2koGrP2pE2lNRU1Mu7LNJ9kNexDbRYVcV6yoxaKOo72nM0WuYQVT7hF XoPw== Received: by 10.50.207.106 with SMTP id lv10mr1090894igc.0.1345719484588; Thu, 23 Aug 2012 03:58:04 -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.232 with SMTP id ex8csp252617igc; Thu, 23 Aug 2012 03:58:04 -0700 (PDT) Received: by 10.68.239.164 with SMTP id vt4mr3674299pbc.118.1345719483930; Thu, 23 Aug 2012 03:58:03 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id px6si12491260pbc.154.2012.08.23.03.58.03; Thu, 23 Aug 2012 03:58:03 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.33 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 (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M97003IJFSF99A0@mailout3.samsung.com>; Thu, 23 Aug 2012 19:58:02 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-c4-50360cb9d332 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 8B.C3.18282.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>; Thu, 23 Aug 2012 19:58:01 +0900 (KST) From: Thomas Abraham To: linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.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, dong.aisheng@linaro.org, swarren@wwwdotorg.org, patches@linaro.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+NgFnrDJMWRmVeSWpSXmKPExsVy+t9jQd1dPGYBBgefs1gsO9fDajHlz3Im iymHv7A4MHvcubaHLYAxissmJTUnsyy1SN8ugSvjW+ct1oK7vBUtJz8wNzBO5u5i5OSQEDCR uLf9NRuELSZx4d56IJuLQ0hgOqPE7dPvGEESQgJtTBLr7saC2GwCBhKPFr5jB7FFBFwljr84 ywjSwCzwi1Hi9ZZNTCAJYYEYiY5Ni1i7GDk4WARUJebcNQEJ8wp4Slx5cYEdYpmSxIbeo2Dl nAJeEru+rmKG2OUpsXrrOZYJjLwLGBlWMYqmFiQXFCel5xrpFSfmFpfmpesl5+duYgSHwTPp HYyrGiwOMQpwMCrx8AbcMw0QYk0sK67MPcQowcGsJMLrxWkWIMSbklhZlVqUH19UmpNafIhR moNFSZyXv88wQEggPbEkNTs1tSC1CCbLxMEp1cC4cPoUhehIjz+BSfV/u8K36Ynyu0Tq1c9c mbiK///Mv7PmSf9Z88Tz3CODn2cvm53X23Ggp6HoVO29lEnzo0MvX9+vcn2rDecXtrRr6jG9 W7k4rdVTJryraLaxcDr9xX9PUIbgHQ+d1O0nhZa5PGXn0hN6/WaLs2bmfy6nsj/Cd7+98faZ 2V2vxFKckWioxVxUnAgAAJmJD/8BAAA= X-TM-AS-MML: No X-Gm-Message-State: ALoCoQmD2Ct+Jh8TgYjAHNk4grFOvHR5+9uXhAyefefjcorL1RkOVEuhsZDNLqB4BoGigsdzbuqC 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) {