diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-24 15:24:10 +0200 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 16:04:06 +0200 |
commit | feb836992437c9b8b53988da30880e0e6e93ac8b (patch) | |
tree | 1fa88109514310e32112acd017c1c506d13444b5 /include/linux/gpio.h | |
parent | 825de2e9007439977aed63771db570fc2235e8cd (diff) | |
download | talos-op-linux-feb836992437c9b8b53988da30880e0e6e93ac8b.tar.gz talos-op-linux-feb836992437c9b8b53988da30880e0e6e93ac8b.zip |
gpiolib: Ensure struct gpio is always defined
Currently struct gpio is only defined when using gpiolib which makes the
stub gpio_request_array() much less useful in drivers than is ideal as
they can't work with struct gpio. Since there are no other definitions
in kernel instead make the define always available no matter if gpiolib
is selectable or selected, ensuring that drivers can always use the
type.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r-- | include/linux/gpio.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 17b5a0d80e42..38ac48b7d3a8 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h @@ -14,6 +14,18 @@ #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) #define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) +/** + * struct gpio - a structure describing a GPIO with configuration + * @gpio: the GPIO number + * @flags: GPIO configuration as specified by GPIOF_* + * @label: a literal description string of this GPIO + */ +struct gpio { + unsigned gpio; + unsigned long flags; + const char *label; +}; + #ifdef CONFIG_GENERIC_GPIO #include <asm/gpio.h> @@ -24,18 +36,8 @@ #include <linux/errno.h> struct device; -struct gpio; struct gpio_chip; -/* - * Some platforms don't support the GPIO programming interface. - * - * In case some driver uses it anyway (it should normally have - * depended on GENERIC_GPIO), these routines help the compiler - * optimize out much GPIO-related code ... or trigger a runtime - * warning when something is wrongly called. - */ - static inline bool gpio_is_valid(int number) { return false; |