[PATCH 3/3] S3C24xx needs GPIO_TRACK
Werner Almesberger
werner at openmoko.org
Mon Dec 8 17:07:13 CET 2008
s3c_gpiolib_getchip for 24xx assumes that, as far as addressing is
concerned, all ports have 32 pins. However, there are two flaws in
this logic:
1) gpiolib only assigns pin number for real pins (with the
exception of gaps added with CONFIG_S3C_GPIO_SPACE), and
2) not all ports have the same number of pins.
This patch makes 24xx use the more generic platform s3c_gpiolib_getchip,
like we do on 6410.
Signed-off-by: Werner Almesberger <werner at openmoko.org>
---
Index: ktrack/arch/arm/mach-s3c2410/include/mach/gpio-core.h
===================================================================
--- ktrack.orig/arch/arm/mach-s3c2410/include/mach/gpio-core.h 2008-12-08 13:30:30.000000000 -0200
+++ ktrack/arch/arm/mach-s3c2410/include/mach/gpio-core.h 2008-12-08 13:31:03.000000000 -0200
@@ -15,20 +15,7 @@
#ifndef __ASM_ARCH_GPIO_CORE_H
#define __ASM_ARCH_GPIO_CORE_H __FILE__
+/* currently we just include the platform support */
#include <plat/gpio-core.h>
-#include <mach/regs-gpio.h>
-
-extern struct s3c_gpio_chip s3c24xx_gpios[];
-
-static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int pin)
-{
- struct s3c_gpio_chip *chip;
-
- if (pin > S3C2410_GPH10)
- return NULL;
-
- chip = &s3c24xx_gpios[pin/32];
- return (S3C2410_GPIO_OFFSET(pin) > chip->chip.ngpio) ? chip : NULL;
-}
#endif /* __ASM_ARCH_GPIO_CORE_H */
Index: ktrack/arch/arm/plat-s3c24xx/Kconfig
===================================================================
--- ktrack.orig/arch/arm/plat-s3c24xx/Kconfig 2008-12-08 13:30:08.000000000 -0200
+++ ktrack/arch/arm/plat-s3c24xx/Kconfig 2008-12-08 13:30:15.000000000 -0200
@@ -10,6 +10,7 @@
default y
select NO_IOPORT
select ARCH_REQUIRE_GPIOLIB
+ select S3C_GPIO_TRACK
help
Base platform code for any Samsung S3C24XX device
More information about the openmoko-kernel
mailing list