1 Add gpio_is_valid() for bcm47xx
2 --- a/arch/mips/bcm47xx/gpio.c
3 +++ b/arch/mips/bcm47xx/gpio.c
4 @@ -77,3 +77,15 @@ int bcm47xx_gpio_direction_output(unsign
6 EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_output);
8 +int bcm47xx_gpio_is_valid(int gpio)
10 + if (ssb_bcm47xx.chipco.dev) {
11 + if (gpio >= 0 && gpio < BCM47XX_CHIPCO_GPIO_LINES)
13 + } else if (ssb_bcm47xx.extif.dev) {
14 + if (gpio >= 0 && gpio < BCM47XX_EXTIF_GPIO_LINES)
19 +EXPORT_SYMBOL_GPL(bcm47xx_gpio_is_valid);
20 --- a/include/asm-mips/mach-bcm47xx/gpio.h
21 +++ b/include/asm-mips/mach-bcm47xx/gpio.h
22 @@ -17,6 +17,7 @@ extern int bcm47xx_gpio_get_value(unsign
23 extern void bcm47xx_gpio_set_value(unsigned gpio, int value);
24 extern int bcm47xx_gpio_direction_input(unsigned gpio);
25 extern int bcm47xx_gpio_direction_output(unsigned gpio, int value);
26 +extern int bcm47xx_gpio_is_valid(int gpio);
28 static inline int gpio_request(unsigned gpio, const char *label)
30 @@ -52,6 +53,8 @@ static inline int gpio_direction_output(
31 return bcm47xx_gpio_direction_output(gpio, value);
34 +#define gpio_is_valid bcm47xx_gpio_is_valid
37 /* cansleep wrappers */
38 #include <asm-generic/gpio.h>