aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c/include
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-10-31 16:14:32 +0000
committerBen Dooks <ben-linux@fluff.org>2008-12-15 23:33:42 +0000
commit8a53bdb907cb924ed30f79bcfe7f4f15ff7de15e (patch)
treee2bca4f6a4988f4eeb79ff18ac782b2383d1cf92 /arch/arm/plat-s3c/include
parent[ARM] S3C: Move common GPIO code from plat-s3c24xx (diff)
downloadlinux-dev-8a53bdb907cb924ed30f79bcfe7f4f15ff7de15e.tar.xz
linux-dev-8a53bdb907cb924ed30f79bcfe7f4f15ff7de15e.zip
[ARM] S3C: Add GPIO chip tracking
The gpiolib driver keeps its chip array to itself and having a separate array for s3c-only gpios stops any non-s3c gpio being used in one of the s3c specific configuration calls. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c/include')
-rw-r--r--arch/arm/plat-s3c/include/plat/gpio-core.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-s3c/include/plat/gpio-core.h
index 3cb9105c4811..ad68b32a7f9d 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-core.h
+++ b/arch/arm/plat-s3c/include/plat/gpio-core.h
@@ -47,3 +47,26 @@ static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc)
* other parts of the system.
*/
extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip);
+
+
+/* CONFIG_S3C_GPIO_TRACK enables the tracking of the s3c specific gpios
+ * for use with the configuration calls, and other parts of the s3c gpiolib
+ * support code.
+ *
+ * Not all s3c support code will need this, as some configurations of cpu
+ * may only support one or two different configuration options and have an
+ * easy gpio to s3c_gpio_chip mapping function. If this is the case, then
+ * the machine support file should provide its own s3c_gpiolib_getchip()
+ * and any other necessary functions.
+ */
+
+#ifdef CONFIG_S3C_GPIO_TRACK
+extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
+
+static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int chip)
+{
+ return s3c_gpios[chip];
+}
+#else
+static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { }
+#endif