aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/gpio.c
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 /drivers/of/gpio.c
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 'drivers/of/gpio.c')
-rw-r--r--drivers/of/gpio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
index 3007662ac614..ef0105fa52b1 100644
--- a/drivers/of/gpio.c
+++ b/drivers/of/gpio.c
@@ -127,8 +127,8 @@ EXPORT_SYMBOL(of_gpio_count);
127 * gpio chips. This function performs only one sanity check: whether gpio 127 * gpio chips. This function performs only one sanity check: whether gpio
128 * is less than ngpios (that is specified in the gpio_chip). 128 * is less than ngpios (that is specified in the gpio_chip).
129 */ 129 */
130static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, 130int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
131 const void *gpio_spec, u32 *flags) 131 const void *gpio_spec, u32 *flags)
132{ 132{
133 const __be32 *gpio = gpio_spec; 133 const __be32 *gpio = gpio_spec;
134 const u32 n = be32_to_cpup(gpio); 134 const u32 n = be32_to_cpup(gpio);
@@ -152,6 +152,7 @@ static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
152 152
153 return n; 153 return n;
154} 154}
155EXPORT_SYMBOL(of_gpio_simple_xlate);
155 156
156/** 157/**
157 * of_mm_gpiochip_add - Add memory mapped GPIO chip (bank) 158 * of_mm_gpiochip_add - Add memory mapped GPIO chip (bank)