aboutsummaryrefslogtreecommitdiff
path: root/include/asm-generic/gpio.h
diff options
context:
space:
mode:
authorTom Rini2014-09-02 08:22:26 -0400
committerTom Rini2014-09-02 08:22:26 -0400
commit141e1faec2cd594dafb2edad6da8baa6a681cf37 (patch)
tree940ba96697a799caaee3bd6281242ec738f694b1 /include/asm-generic/gpio.h
parent3400655e0f3cb6a8ca2b486137e96f576c9cd2fc (diff)
parent4bc9a19324ba27eb867316d2ea0d55bba95e8724 (diff)
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r--include/asm-generic/gpio.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index a6e52a0de63..60539d8a9d2 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -79,11 +79,15 @@ int gpio_get_value(unsigned gpio);
*/
int gpio_set_value(unsigned gpio, int value);
-/* State of a GPIO, as reported by get_state() */
+/* State of a GPIO, as reported by get_function() */
enum {
GPIOF_INPUT = 0,
GPIOF_OUTPUT,
- GPIOF_UNKNOWN,
+ GPIOF_UNUSED, /* Not claimed */
+ GPIOF_UNKNOWN, /* Not known */
+ GPIOF_FUNC, /* Not used as a GPIO */
+
+ GPIOF_COUNT,
};
struct udevice;
@@ -123,6 +127,13 @@ struct dm_gpio_ops {
int value);
int (*get_value)(struct udevice *dev, unsigned offset);
int (*set_value)(struct udevice *dev, unsigned offset, int value);
+ /**
+ * get_function() Get the GPIO function
+ *
+ * @dev: Device to check
+ * @offset: GPIO offset within that device
+ * @return current function - GPIOF_...
+ */
int (*get_function)(struct udevice *dev, unsigned offset);
int (*get_state)(struct udevice *dev, unsigned offset, char *state,
int maxlen);