Skip to contentSkip to conversation

MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration

PATCH Applied Florian Fainelli 3 participants 3 messages Nov 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: BCM47xxx: 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.

---

arch/mips/include/asm/mach-bcm47xx/gpio.h +15 -3
index 76961ca..26cc815 100644
@@ -36,6 +36,8 @@ static inline int gpio_get_value(unsigned gpio)
 	return -EINVAL;
 }
 
+#define gpio_get_value_cansleep	gpio_get_value
+
 static inline void gpio_set_value(unsigned gpio, int value)
 {
 	switch (bcm47xx_bus_type) {
@@ -54,6 +56,19 @@ static inline void gpio_set_value(unsigned gpio, int value)
 	}
 }
 
+#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_EXTIF_GPIO_LINES);
+}
+
+
 static inline int gpio_direction_input(unsigned gpio)
 {
 	switch (bcm47xx_bus_type) {
@@ -137,7 +152,4 @@ static inline int gpio_polarity(unsigned gpio, int value)
 }
 
 
-/* cansleep wrappers */
-#include <asm-generic/gpio.h>
-
 #endif /* __BCM47XX_GPIO_H */
Signature · 1 line
1.7.5.4
#2 lore raw
In reply to Florian Fainelli

Hi,

Quoted 26 lines · Florian Fainelli

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.

---

arch/mips/include/asm/mach-bcm47xx/gpio.h +2 -0
index 76961ca..26cc815 100644
@@ -36,6 +36,8 @@ static inline int gpio_get_value(unsigned gpio)
        return -EINVAL;
  }
 
+#define gpio_get_value_cansleep        gpio_get_value
+
  static inline void gpio_set_value(unsigned gpio, int value)
  {
        switch (bcm47xx_bus_type) {
@@ -54,6 +56,19 @@ static inline void gpio_set_value(unsigned gpio, int value)
        }
  }
 

arch/mips/include/asm/mach-bcm47xx/gpio.h static inline void gpio_set_value(unsigned gpio, int value) · line 68

Quoted 10 lines
arch/mips/include/asm/mach-bcm47xx/gpio.h +10 -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_EXTIF_GPIO_LINES);

This looks wrong; did you perhaps mean BCM47XX_EXTIF_GPIO_LINES + BCM47XX_CHIPCO_GPIO_LINES?

BCM47XX_CHIPCO_GPIO_LINES (=16) is bigger than (2 * BCM47XX_EXTIF_GPIO_LINES(=5)), which would make the upper 6 chipco gpios always invalid.

Regards,
Jonas