From patchwork Wed May 23 23:47:37 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: 8937 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 2F91224009 for ; Wed, 23 May 2012 23:52:23 +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 F3342A18379 for ; Wed, 23 May 2012 23:52:22 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so8818115ggn.11 for ; Wed, 23 May 2012 16:52:22 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=JdevSuYVnGcAsfO9ADEY8uboK2DsfuHKLDQ59UogRls=; b=DJecIPVm6KdWQgBW1uOWCghvgwZMLgnGYwrz9uY58Mgv2kbdbmb+KCwxodyW8awcKi E+3DWUg6siMuFKMwpGg7jodqJDDAgM+xWBB1TeZNf9b/qRSv4saXSrCS1waUbAIZin6a yfyf7s9Gxwp6BBdtkTwGoVTkaskinOgjDDHmXiXc4326N2VQ3UnpxAPE+/axdZ665cA/ 1mHbErSoPXTW8s7rN9g1VUaz9wl1Zbqq1CoKF2MRSuZKjJbhShFSb8ZRQDzCi7fdQvS7 DcGqX3MxEvN1LfrBocCzcVqcSpMusboDeV94jt/ho5KOCDr6+RAt+9+HS0OBhmn/IFuR 2tHg== Received: by 10.50.163.99 with SMTP id yh3mr14732478igb.53.1337817142495; Wed, 23 May 2012 16:52:22 -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.231.35.72 with SMTP id o8csp486534ibd; Wed, 23 May 2012 16:52:21 -0700 (PDT) Received: by 10.68.223.35 with SMTP id qr3mr15687179pbc.83.1337817141796; Wed, 23 May 2012 16:52:21 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id on9si4526979pbc.110.2012.05.23.16.52.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 May 2012 16:52:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: by mail-pz0-f50.google.com with SMTP id h15so12387339dan.37 for ; Wed, 23 May 2012 16:52:21 -0700 (PDT) Received: by 10.68.225.9 with SMTP id rg9mr14839700pbc.137.1337817141401; Wed, 23 May 2012 16:52:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ql3sm3373659pbc.72.2012.05.23.16.52.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 May 2012 16:52:20 -0700 (PDT) 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, kgene.kim@samsung.com, kyungmin.park@samsung.com, patches@linaro.org Subject: [PATCH 3/3] gpio: exynos4: skip gpiolib registration if pinctrl driver is used Date: Thu, 24 May 2012 05:17:37 +0530 Message-Id: <1337816857-14694-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1337816857-14694-1-git-send-email-thomas.abraham@linaro.org> References: <1337816857-14694-1-git-send-email-thomas.abraham@linaro.org> X-Gm-Message-State: ALoCoQncFVpyB/neYfH0kAP2qQxArEhvdcOx4ixBS6CytlustPQ6eIqYI3YGf/Z7KBlZAal2jcdI 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 19d6fc0..34a9638 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -2788,6 +2788,27 @@ static __init int samsung_gpiolib_init(void) #ifdef CONFIG_CPU_EXYNOS4210 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) {