Re: [PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-21 Thread Thomas Abraham
On 21 August 2012 17:35, Linus Walleij  wrote:
> On Wed, Aug 15, 2012 at 9:57 PM, Thomas Abraham
>  wrote:
>
>> 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 
>
>> +#ifdef CONFIG_OF
>
> Wouldn't it be better to use
> #ifdef CONFIG_PINCTRL_SAMSUNG?

Yes, this would be better. I will fix this.

>
> Yours,
> Linus Walleij

Thanks,
Thomas.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-21 Thread Linus Walleij
On Wed, Aug 15, 2012 at 9:57 PM, Thomas Abraham
 wrote:

> 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 

> +#ifdef CONFIG_OF

Wouldn't it be better to use
#ifdef CONFIG_PINCTRL_SAMSUNG?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-21 Thread Thomas Abraham
On 21 August 2012 17:35, Linus Walleij linus.wall...@linaro.org wrote:
 On Wed, Aug 15, 2012 at 9:57 PM, Thomas Abraham
 thomas.abra...@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.

 Acked-by: Grant Likely grant.lik...@secretlab.ca
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org

 +#ifdef CONFIG_OF

 Wouldn't it be better to use
 #ifdef CONFIG_PINCTRL_SAMSUNG?

Yes, this would be better. I will fix this.


 Yours,
 Linus Walleij

Thanks,
Thomas.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-21 Thread Linus Walleij
On Wed, Aug 15, 2012 at 9:57 PM, Thomas Abraham
thomas.abra...@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.

 Acked-by: Grant Likely grant.lik...@secretlab.ca
 Acked-by: Linus Walleij linus.wall...@linaro.org
 Signed-off-by: Thomas Abraham thomas.abra...@linaro.org

 +#ifdef CONFIG_OF

Wouldn't it be better to use
#ifdef CONFIG_PINCTRL_SAMSUNG?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-15 Thread Thomas Abraham
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) {
-- 
1.6.6.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/4] gpio: exynos4: skip gpiolib registration if pinctrl driver is used

2012-08-15 Thread Thomas Abraham
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 grant.lik...@secretlab.ca
Acked-by: Linus Walleij linus.wall...@linaro.org
Signed-off-by: Thomas Abraham thomas.abra...@linaro.org
---
 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) {
-- 
1.6.6.rc2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/