gpio: samsung: Fix off-by-one bug in gpio addresses
authorSean Paul <seanpaul@chromium.org>
Fri, 20 Jul 2012 18:19:31 +0000 (11:19 -0700)
committerGerrit <chrome-bot@google.com>
Sat, 21 Jul 2012 02:17:08 +0000 (19:17 -0700)
Move gpc4 to the end of the automatically processed gpio controllers so
we don't taint the automatic offset calculation.

This bug caused all controllers coming after gpc4 to map to the
incorrect address. The result is <&gpd1 0 0 0 0> would actually map to
GPIO 0 in gpd0.

BUG=None
TEST=Tested on snow, verified correct addresses for the controllers

Change-Id: Ia41b9a28c7dd6c06147ac5329462be1e3c3a0381
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28031
Reviewed-by: Doug Anderson <dianders@chromium.org>
drivers/gpio/gpio-samsung.c

index e20043a..b759837 100644 (file)
@@ -2452,12 +2452,6 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
                        .ngpio  = EXYNOS5_GPIO_C3_NR,
                        .label  = "GPC3",
                },
-       }, {
-               .chip   = {
-                       .base   = EXYNOS5_GPC4(0),
-                       .ngpio  = EXYNOS5_GPIO_C4_NR,
-                       .label  = "GPC4",
-               },
        }, {
                .chip   = {
                        .base   = EXYNOS5_GPD0(0),
@@ -2512,6 +2506,12 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
                        .ngpio  = EXYNOS5_GPIO_Y6_NR,
                        .label  = "GPY6",
                },
+       }, {
+               .chip   = {
+                       .base   = EXYNOS5_GPC4(0),
+                       .ngpio  = EXYNOS5_GPIO_C4_NR,
+                       .label  = "GPC4",
+               },
        }, {
                .config = &samsung_gpio_cfgs[9],
                .irq_base = IRQ_EINT(0),
@@ -2892,7 +2892,7 @@ static __init int samsung_gpiolib_init(void)
                }
 
                /* need to set base address for gpc4 */
-               exynos5_gpios_1[11].base = gpio_base1 + 0x2E0;
+               exynos5_gpios_1[20].base = gpio_base1 + 0x2E0;
 
                /* need to set base address for gpx */
                chip = &exynos5_gpios_1[21];