All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Thomas Abraham <thomas.abraham@linaro.org>, linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linus.walleij@linaro.org,
	kgene.kim@samsung.com, kyungmin.park@samsung.com,
	patches@linaro.org
Subject: Re: [PATCH 3/3] gpio: exynos4: skip gpiolib registration if pinctrl driver is used
Date: Fri, 25 May 2012 18:44:09 -0600	[thread overview]
Message-ID: <20120526004409.A59FD3E1E15@localhost> (raw)
In-Reply-To: <1337816857-14694-4-git-send-email-thomas.abraham@linaro.org>

On Thu, 24 May 2012 05:17:37 +0530, Thomas Abraham <thomas.abraham@linaro.org> wrote:
> 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 <thomas.abraham@linaro.org>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  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) {
> -- 
> 1.6.6.rc2
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

WARNING: multiple messages have this Message-ID (diff)
From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] gpio: exynos4: skip gpiolib registration if pinctrl driver is used
Date: Fri, 25 May 2012 18:44:09 -0600	[thread overview]
Message-ID: <20120526004409.A59FD3E1E15@localhost> (raw)
In-Reply-To: <1337816857-14694-4-git-send-email-thomas.abraham@linaro.org>

On Thu, 24 May 2012 05:17:37 +0530, Thomas Abraham <thomas.abraham@linaro.org> wrote:
> 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 <thomas.abraham@linaro.org>

Acked-by: Grant Likely <grant.likely@secretlab.ca>

> ---
>  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) {
> -- 
> 1.6.6.rc2
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

  reply	other threads:[~2012-05-26  0:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 23:47 [PATCH 0/3] pinctrl: add support for samsung pinctrl driver Thomas Abraham
2012-05-23 23:47 ` Thomas Abraham
2012-05-23 23:47 ` [PATCH 1/3] pinctrl: add samsung pinctrl and gpiolib driver Thomas Abraham
2012-05-23 23:47   ` Thomas Abraham
2012-06-01  1:36   ` Linus Walleij
2012-06-01  1:36     ` Linus Walleij
2012-06-01  1:58     ` Thomas Abraham
2012-06-01  1:58       ` Thomas Abraham
2012-06-08 12:32     ` Tony Lindgren
2012-06-08 12:32       ` Tony Lindgren
2012-05-23 23:47 ` [PATCH 2/3] pinctrl: add exynos4210 specific driver data for samsung pinctrl driver Thomas Abraham
2012-05-23 23:47   ` Thomas Abraham
2012-06-01  1:37   ` Linus Walleij
2012-06-01  1:37     ` Linus Walleij
2012-05-23 23:47 ` [PATCH 3/3] gpio: exynos4: skip gpiolib registration if pinctrl driver is used Thomas Abraham
2012-05-23 23:47   ` Thomas Abraham
2012-05-26  0:44   ` Grant Likely [this message]
2012-05-26  0:44     ` Grant Likely
2012-06-05 12:46   ` Linus Walleij
2012-06-05 12:46     ` Linus Walleij
2012-06-01  1:40 ` [PATCH 0/3] pinctrl: add support for samsung pinctrl driver Linus Walleij
2012-06-01  1:40   ` Linus Walleij
2012-06-01  2:06   ` Thomas Abraham
2012-06-01  2:06     ` Thomas Abraham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120526004409.A59FD3E1E15@localhost \
    --to=grant.likely@secretlab.ca \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=thomas.abraham@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.