diff options
Diffstat (limited to 'drivers/gpio/gpio-samsung.c')
-rw-r--r-- | drivers/gpio/gpio-samsung.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index a006f0db15af..88f41e51565b 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -2797,27 +2797,6 @@ static __init void exynos4_gpiolib_init(void) | |||
2797 | int group = 0; | 2797 | int group = 0; |
2798 | void __iomem *gpx_base; | 2798 | void __iomem *gpx_base; |
2799 | 2799 | ||
2800 | #ifdef CONFIG_PINCTRL_SAMSUNG | ||
2801 | /* | ||
2802 | * This gpio driver includes support for device tree support and | ||
2803 | * there are platforms using it. In order to maintain | ||
2804 | * compatibility with those platforms, and to allow non-dt | ||
2805 | * Exynos4210 platforms to use this gpiolib support, a check | ||
2806 | * is added to find out if there is a active pin-controller | ||
2807 | * driver support available. If it is available, this gpiolib | ||
2808 | * support is ignored and the gpiolib support available in | ||
2809 | * pin-controller driver is used. This is a temporary check and | ||
2810 | * will go away when all of the Exynos4210 platforms have | ||
2811 | * switched to using device tree and the pin-ctrl driver. | ||
2812 | */ | ||
2813 | struct device_node *pctrl_np; | ||
2814 | const char *pctrl_compat = "samsung,pinctrl-exynos4210"; | ||
2815 | pctrl_np = of_find_compatible_node(NULL, NULL, pctrl_compat); | ||
2816 | if (pctrl_np) | ||
2817 | if (of_device_is_available(pctrl_np)) | ||
2818 | return; | ||
2819 | #endif | ||
2820 | |||
2821 | /* gpio part1 */ | 2800 | /* gpio part1 */ |
2822 | gpio_base1 = ioremap(EXYNOS4_PA_GPIO1, SZ_4K); | 2801 | gpio_base1 = ioremap(EXYNOS4_PA_GPIO1, SZ_4K); |
2823 | if (gpio_base1 == NULL) { | 2802 | if (gpio_base1 == NULL) { |
@@ -3032,6 +3011,28 @@ static __init int samsung_gpiolib_init(void) | |||
3032 | int i, nr_chips; | 3011 | int i, nr_chips; |
3033 | int group = 0; | 3012 | int group = 0; |
3034 | 3013 | ||
3014 | #ifdef CONFIG_PINCTRL_SAMSUNG | ||
3015 | /* | ||
3016 | * This gpio driver includes support for device tree support and there | ||
3017 | * are platforms using it. In order to maintain compatibility with those | ||
3018 | * platforms, and to allow non-dt Exynos4210 platforms to use this | ||
3019 | * gpiolib support, a check is added to find out if there is a active | ||
3020 | * pin-controller driver support available. If it is available, this | ||
3021 | * gpiolib support is ignored and the gpiolib support available in | ||
3022 | * pin-controller driver is used. This is a temporary check and will go | ||
3023 | * away when all of the Exynos4210 platforms have switched to using | ||
3024 | * device tree and the pin-ctrl driver. | ||
3025 | */ | ||
3026 | struct device_node *pctrl_np; | ||
3027 | static const struct of_device_id exynos_pinctrl_ids[] = { | ||
3028 | { .compatible = "samsung,pinctrl-exynos4210", }, | ||
3029 | { .compatible = "samsung,pinctrl-exynos4x12", }, | ||
3030 | }; | ||
3031 | for_each_matching_node(pctrl_np, exynos_pinctrl_ids) | ||
3032 | if (pctrl_np && of_device_is_available(pctrl_np)) | ||
3033 | return -ENODEV; | ||
3034 | #endif | ||
3035 | |||
3035 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); | 3036 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); |
3036 | 3037 | ||
3037 | if (soc_is_s3c24xx()) { | 3038 | if (soc_is_s3c24xx()) { |