aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/omap_gpio.h
diff options
context:
space:
mode:
authorSimon Glass2014-10-22 21:37:09 -0600
committerSimon Glass2014-10-23 19:29:07 -0600
commit5915a2ad0da6086892c587442d4eabd681f987b5 (patch)
tree69b0d10e184029de8606178bc2ec7a82e01e8287 /arch/arm/include/asm/omap_gpio.h
parentd57b61143d8c74dee392fc5be52cb6ec5a15b8fc (diff)
dm: omap: gpio: Support driver model
Add driver model support to this driver, while retaining support for the legacy system. Driver model GPIO support is enabled with CONFIG_DM_GPIO as usual. Since gpio_is_valid() no longer exists, we can use the -EINVAL error returned from gpio_request(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'arch/arm/include/asm/omap_gpio.h')
-rw-r--r--arch/arm/include/asm/omap_gpio.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/include/asm/omap_gpio.h b/arch/arm/include/asm/omap_gpio.h
index 5d25d04c3bf..839af54d482 100644
--- a/arch/arm/include/asm/omap_gpio.h
+++ b/arch/arm/include/asm/omap_gpio.h
@@ -23,6 +23,21 @@
#include <asm/arch/cpu.h>
+enum gpio_method {
+ METHOD_GPIO_24XX = 4,
+};
+
+#ifdef CONFIG_DM_GPIO
+
+/* Information about a GPIO bank */
+struct omap_gpio_platdata {
+ int bank_index;
+ ulong base; /* address of registers in physical memory */
+ enum gpio_method method;
+};
+
+#else
+
struct gpio_bank {
void *base;
int method;
@@ -30,8 +45,6 @@ struct gpio_bank {
extern const struct gpio_bank *const omap_gpio_bank;
-#define METHOD_GPIO_24XX 4
-
/**
* Check if gpio is valid.
*
@@ -39,4 +52,6 @@ extern const struct gpio_bank *const omap_gpio_bank;
* @return 1 if ok, 0 on error
*/
int gpio_is_valid(int gpio);
+#endif
+
#endif /* _GPIO_H_ */