aboutsummaryrefslogtreecommitdiff
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-10-31 16:17:37 +0000
commitc7eadfe16948bb86f7554115d075881ced10783d (patch)
tree514dc1e4b5ae695456bfd93f98a24004d996c2ab /arch/arm/plat-s3c/include
parent2146a45af67dc326b004b759bd08174c38d70d7a (diff)
[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 3cb9105c481..ad68b32a7f9 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