All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration
@ 2011-11-03 15:05 Florian Fainelli
  2011-11-03 20:08 ` Ralf Baechle
  2011-11-03 22:04 ` Jonas Gorski
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2011-11-03 15:05 UTC (permalink / raw)
  To: ralf, linux-mips, Hauke Mehrtens

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 <ralf@linux-mips.org>
CC: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 76961ca..26cc815 100644
--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
@@ -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 */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration
  2011-11-03 15:05 [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration Florian Fainelli
@ 2011-11-03 20:08 ` Ralf Baechle
  2011-11-03 22:04 ` Jonas Gorski
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2011-11-03 20:08 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-mips, Hauke Mehrtens

Thanks, applied.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration
  2011-11-03 15:05 [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration Florian Fainelli
  2011-11-03 20:08 ` Ralf Baechle
@ 2011-11-03 22:04 ` Jonas Gorski
  1 sibling, 0 replies; 3+ messages in thread
From: Jonas Gorski @ 2011-11-03 22:04 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: ralf, linux-mips, Hauke Mehrtens

Hi,

On 3 November 2011 16:05, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 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 <ralf@linux-mips.org>
> CC: Hauke Mehrtens <hauke@hauke-m.de>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
> index 76961ca..26cc815 100644
> --- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
> +++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
> @@ -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);

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-03 22:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 15:05 [PATCH] MIPS: BCM47xxx: fix build with GENERIC_GPIO configuration Florian Fainelli
2011-11-03 20:08 ` Ralf Baechle
2011-11-03 22:04 ` Jonas Gorski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.