aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_gpio.h
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-07-28 11:25:41 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-07-28 18:19:22 -0400
commit3038bbdf7404ae3948385cbde30df946579d4e3a (patch)
tree808e8eebc52995ab6e414e74adb44cf2890fcff9 /include/linux/of_gpio.h
parent95b6886526bb510b8370b625a49bc0ab3b8ff10f (diff)
of/gpio: export of_gpio_simple_xlate
Allow GPIO drivers to use of_gpio_simple_xlate. This is useful for the generic GPIO driver for example where gpio_chip is embedded in bgpio_chip and doesn't need of_mm_gpio_chip but has a simple 1:1 GPIO mapping. Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/of_gpio.h')
-rw-r--r--include/linux/of_gpio.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index aec8025c786a..52280a2b5e63 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -57,6 +57,8 @@ extern int of_mm_gpiochip_add(struct device_node *np,
57extern void of_gpiochip_add(struct gpio_chip *gc); 57extern void of_gpiochip_add(struct gpio_chip *gc);
58extern void of_gpiochip_remove(struct gpio_chip *gc); 58extern void of_gpiochip_remove(struct gpio_chip *gc);
59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); 59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
61 const void *gpio_spec, u32 *flags);
60 62
61#else /* CONFIG_OF_GPIO */ 63#else /* CONFIG_OF_GPIO */
62 64
@@ -72,6 +74,13 @@ static inline unsigned int of_gpio_count(struct device_node *np)
72 return 0; 74 return 0;
73} 75}
74 76
77static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
78 struct device_node *np,
79 const void *gpio_spec, u32 *flags)
80{
81 return -ENOSYS;
82}
83
75static inline void of_gpiochip_add(struct gpio_chip *gc) { } 84static inline void of_gpiochip_add(struct gpio_chip *gc) { }
76static inline void of_gpiochip_remove(struct gpio_chip *gc) { } 85static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
77 86