ARM: S3C244X: fix gpiolib port J support
authorVasily Khoruzhick <anarsoul@gmail.com>
Wed, 12 May 2010 07:22:41 +0000 (10:22 +0300)
committerBen Dooks <ben-linux@fluff.org>
Tue, 18 May 2010 10:06:15 +0000 (19:06 +0900)
Increase GPIOs number for S3C244X, and make S3C_GPIO_END
point to BANKJ end, otherwise gpiolib refuses to register
BANKJ

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
[ben-linux@fluff.org: Move pm fix to new patch]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
arch/arm/mach-s3c2410/include/mach/gpio-track.h
arch/arm/mach-s3c2410/include/mach/gpio.h

index acb2591..6371eaa 100644 (file)
@@ -23,7 +23,7 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
 {
        struct s3c_gpio_chip *chip;
 
-       if (pin > S3C2410_GPG(10))
+       if (pin > S3C_GPIO_END)
                return NULL;
 
        chip = &s3c24xx_gpios[pin/32];
index 15f0b3e..b649bf2 100644 (file)
  * devices that need GPIO.
  */
 
+#ifdef CONFIG_CPU_S3C244X
+#define ARCH_NR_GPIOS  (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+#else
 #define ARCH_NR_GPIOS  (256 + CONFIG_S3C24XX_GPIO_EXTRA)
+#endif
 
 #include <asm-generic/gpio.h>
 #include <mach/gpio-nrs.h>
 #include <mach/gpio-fns.h>
 
+#ifdef CONFIG_CPU_S3C24XX
+#define S3C_GPIO_END   (S3C2410_GPIO_BANKJ + 32)
+#else
 #define S3C_GPIO_END   (S3C2410_GPIO_BANKH + 32)
+#endif