Skip to content

Commit df55a66

Browse files
ffainelliralfbaechle
authored andcommitted
MIPS: BCM47xx: fix build with GENERIC_GPIO configuration
Since eb9ae7f (gpio: fix build error in include/asm-generic/gpio.h) the generic version of gpio.h calls __gpio_{set,get}_value which we do not define. Get rid of asm-generic/gpio.h and define the missing stubs directly for BCM47xx to build. Reported-by: Ralf Baechle <ralf@linux-mips.org> To: linux-mips@linux-mips.org CC: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Florian Fainelli <florian@openwrt.org> Patchwork: https://patchwork.linux-mips.org/patch/2885/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 7985808 commit df55a66

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

  • arch/mips/include/asm/mach-bcm47xx

‎arch/mips/include/asm/mach-bcm47xx/gpio.h‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ static inline int gpio_get_value(unsigned gpio)
3636
return -EINVAL;
3737
}
3838

39+
#define gpio_get_value_cansleep gpio_get_value
40+
3941
static inline void gpio_set_value(unsigned gpio, int value)
4042
{
4143
switch (bcm47xx_bus_type) {
@@ -54,6 +56,19 @@ static inline void gpio_set_value(unsigned gpio, int value)
5456
}
5557
}
5658

59+
#define gpio_set_value_cansleep gpio_set_value
60+
61+
static inline int gpio_cansleep(unsigned gpio)
62+
{
63+
return 0;
64+
}
65+
66+
static inline int gpio_is_valid(unsigned gpio)
67+
{
68+
return gpio < (BCM47XX_EXTIF_GPIO_LINES + BCM47XX_CHIPCO_GPIO_LINES);
69+
}
70+
71+
5772
static inline int gpio_direction_input(unsigned gpio)
5873
{
5974
switch (bcm47xx_bus_type) {
@@ -137,7 +152,4 @@ static inline int gpio_polarity(unsigned gpio, int value)
137152
}
138153

139154

140-
/* cansleep wrappers */
141-
#include <asm-generic/gpio.h>
142-
143155
#endif /* __BCM47XX_GPIO_H */

0 commit comments

Comments
 (0)