diff options
| -rw-r--r-- | drivers/of/gpio.c | 5 | ||||
| -rw-r--r-- | include/linux/of_gpio.h | 9 |
2 files changed, 12 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 | */ |
| 130 | static int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np, | 130 | int 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 | } |
| 155 | EXPORT_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) |
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, | |||
| 57 | extern void of_gpiochip_add(struct gpio_chip *gc); | 57 | extern void of_gpiochip_add(struct gpio_chip *gc); |
| 58 | extern void of_gpiochip_remove(struct gpio_chip *gc); | 58 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
| 59 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); | 59 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); |
| 60 | extern 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 | ||
| 77 | static 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 | |||
| 75 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } | 84 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } |
| 76 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | 85 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } |
| 77 | 86 | ||
