From b5fef2fc86184e262fe69ba83a0fd3c0b199816d Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Fri, 4 Nov 2011 11:17:46 +0100 Subject: [PATCH] MIPS: BCM47xx: fix build with GENERIC_GPIO configuration Since eb9ae7f2 (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 To: linux-mips@linux-mips.org CC: Hauke Mehrtens Signed-off-by: Florian Fainelli Patchwork: https://patchwork.linux-mips.org/patch/2885/ Signed-off-by: Ralf Baechle --- arch/mips/include/asm/mach-bcm47xx/gpio.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h index 98504142124e..ea2c4e8135a1 100644 --- a/arch/mips/include/asm/mach-bcm47xx/gpio.h +++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h @@ -24,11 +24,26 @@ static inline int gpio_get_value(unsigned gpio) return ssb_gpio_in(&ssb_bcm47xx, 1 << gpio); } +#define gpio_get_value_cansleep gpio_get_value + static inline void gpio_set_value(unsigned gpio, int value) { ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0); } +#define gpio_set_value_cansleep gpio_set_value + +static inline int gpio_cansleep(unsigned gpio) +{ + return 0; +} + +static inline int gpio_is_valid(unsigned gpio) +{ + return gpio < (BCM47XX_EXTIF_GPIO_LINES + BCM47XX_CHIPCO_GPIO_LINES); +} + + static inline int gpio_direction_input(unsigned gpio) { ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 0); @@ -59,7 +74,4 @@ static inline int gpio_polarity(unsigned gpio, int value) } -/* cansleep wrappers */ -#include - #endif /* __BCM47XX_GPIO_H */ -- 2.39.5