aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx
diff options
context:
space:
mode:
authorMichael Büsch <mb@bu3sch.de>2008-07-20 19:34:09 +0000
committerMichael Büsch <mb@bu3sch.de>2008-07-20 19:34:09 +0000
commit883f926360884e1bcb16dcde67e1e5f978874807 (patch)
tree6c86f34088ee1e6a4255b2454574c83cb9451cfa /target/linux/brcm47xx
parentda85c64a1c6d6b1a20e41de2e5e2b5083f2fb88d (diff)
downloadupstream-883f926360884e1bcb16dcde67e1e5f978874807.tar.gz
upstream-883f926360884e1bcb16dcde67e1e5f978874807.tar.bz2
upstream-883f926360884e1bcb16dcde67e1e5f978874807.zip
Update gpiommc to use configfs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11887 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx')
-rw-r--r--target/linux/brcm47xx/patches-2.6.25/710-add-gpio-is-valid.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.25/710-add-gpio-is-valid.patch b/target/linux/brcm47xx/patches-2.6.25/710-add-gpio-is-valid.patch
new file mode 100644
index 0000000000..bca3b4eaae
--- /dev/null
+++ b/target/linux/brcm47xx/patches-2.6.25/710-add-gpio-is-valid.patch
@@ -0,0 +1,44 @@
+Add gpio_is_valid() for bcm47xx
+Index: linux-2.6.25.10/arch/mips/bcm47xx/gpio.c
+===================================================================
+--- linux-2.6.25.10.orig/arch/mips/bcm47xx/gpio.c 2008-07-20 20:48:44.000000000 +0200
++++ linux-2.6.25.10/arch/mips/bcm47xx/gpio.c 2008-07-20 20:57:55.000000000 +0200
+@@ -77,3 +77,15 @@ int bcm47xx_gpio_direction_output(unsign
+ }
+ EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_output);
+
++int bcm47xx_gpio_is_valid(int gpio)
++{
++ if (ssb_bcm47xx.chipco.dev) {
++ if (gpio >= 0 && gpio < BCM47XX_CHIPCO_GPIO_LINES)
++ return 1;
++ } else if (ssb_bcm47xx.extif.dev) {
++ if (gpio >= 0 && gpio < BCM47XX_EXTIF_GPIO_LINES)
++ return 1;
++ }
++ return 0;
++}
++EXPORT_SYMBOL_GPL(bcm47xx_gpio_is_valid);
+Index: linux-2.6.25.10/include/asm-mips/mach-bcm47xx/gpio.h
+===================================================================
+--- linux-2.6.25.10.orig/include/asm-mips/mach-bcm47xx/gpio.h 2008-07-20 20:48:44.000000000 +0200
++++ linux-2.6.25.10/include/asm-mips/mach-bcm47xx/gpio.h 2008-07-20 20:49:20.000000000 +0200
+@@ -17,6 +17,7 @@ extern int bcm47xx_gpio_get_value(unsign
+ extern void bcm47xx_gpio_set_value(unsigned gpio, int value);
+ extern int bcm47xx_gpio_direction_input(unsigned gpio);
+ extern int bcm47xx_gpio_direction_output(unsigned gpio, int value);
++extern int bcm47xx_gpio_is_valid(int gpio);
+
+ static inline int gpio_request(unsigned gpio, const char *label)
+ {
+@@ -52,6 +53,10 @@ static inline int gpio_direction_output(
+ return bcm47xx_gpio_direction_output(gpio, value);
+ }
+
++static inline int gpio_is_valid(int gpio)
++{
++ return bcm47xx_gpio_is_valid(gpio);
++}
+
+ /* cansleep wrappers */
+ #include <asm-generic/gpio.h>