diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2012-05-06 20:44:37 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2012-05-06 20:44:37 +0000 |
commit | 7432f7b3e8b53552d451613128e67662cce42df2 (patch) | |
tree | 0426d0bfaf771bf03d4bd6251b50ae1bc6f1cb40 /target/linux/brcm47xx | |
parent | 9897c4980309eb86e8519c5e88f4477bef46d467 (diff) | |
download | upstream-7432f7b3e8b53552d451613128e67662cce42df2.tar.gz upstream-7432f7b3e8b53552d451613128e67662cce42df2.tar.bz2 upstream-7432f7b3e8b53552d451613128e67662cce42df2.zip |
brcm47xx: add gpio_request_one()
This fixes a compile error with kernel 3.3.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31635 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx')
-rw-r--r-- | target/linux/brcm47xx/patches-3.3/220-add_gpio_request_one.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/220-add_gpio_request_one.patch b/target/linux/brcm47xx/patches-3.3/220-add_gpio_request_one.patch new file mode 100644 index 0000000000..00005e2d5a --- /dev/null +++ b/target/linux/brcm47xx/patches-3.3/220-add_gpio_request_one.patch @@ -0,0 +1,51 @@ +--- a/arch/mips/bcm47xx/gpio.c ++++ b/arch/mips/bcm47xx/gpio.c +@@ -7,6 +7,7 @@ + */ + + #include <linux/export.h> ++#include <linux/gpio.h> + #include <linux/ssb/ssb.h> + #include <linux/ssb/ssb_driver_chipcommon.h> + #include <linux/ssb/ssb_driver_extif.h> +@@ -100,3 +101,30 @@ int gpio_to_irq(unsigned gpio) + return -EINVAL; + } + EXPORT_SYMBOL_GPL(gpio_to_irq); ++ ++/** ++ * gpio_request_one - request a single GPIO with initial configuration ++ * @gpio: the GPIO number ++ * @flags: GPIO configuration as specified by GPIOF_* ++ * @label: a literal description string of this GPIO ++ */ ++int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) ++{ ++ int err; ++ ++ err = gpio_request(gpio, label); ++ if (err) ++ return err; ++ ++ if (flags & GPIOF_DIR_IN) ++ err = gpio_direction_input(gpio); ++ else ++ err = gpio_direction_output(gpio, ++ (flags & GPIOF_INIT_HIGH) ? 1 : 0); ++ ++ if (err) ++ gpio_free(gpio); ++ ++ return err; ++} ++EXPORT_SYMBOL_GPL(gpio_request_one); +--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h ++++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h +@@ -19,6 +19,7 @@ + extern int gpio_request(unsigned gpio, const char *label); + extern void gpio_free(unsigned gpio); + extern int gpio_to_irq(unsigned gpio); ++extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); + + static inline int gpio_get_value(unsigned gpio) + { |