Skip to content

Commit

Permalink
gpio: exynos4: skip gpiolib registration if pinctrl driver is used
Browse files Browse the repository at this point in the history
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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Thomas Abraham authored and Kukjin Kim committed Sep 6, 2012
1 parent 43b169d commit d058662
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions drivers/gpio/gpio-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d058662

Please sign in to comment.