aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2008-09-11 11:48:00 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-10-11 11:18:57 -0400
commit9609e74093abd9f61fb1d20a8915a8ea87c77d5a (patch)
treeaa624059b2100b657275ad93e452d6bb0f325ee9 /arch/mips
parentd302d05cf4d25f4fbbec0f9338fac13ee0c0ad89 (diff)
MIPS: RB532: provide GPIO_BUILTIN_NR and irq_to_gpio/gpio_to_irq
This patchs defines the number of built-in the GPIOs present on the SoC as Documentation/gpio.txt recommends to do. Define irq_to_gpio/gpio_to_irq to return the right values so that it fixes a compilation error on drivers/gpio/gpiolib.c when enabling debugfs. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/mach-rc32434/gpio.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h
index 3a70b41cd7a5..c8e554eafce3 100644
--- a/arch/mips/include/asm/mach-rc32434/gpio.h
+++ b/arch/mips/include/asm/mach-rc32434/gpio.h
@@ -14,16 +14,16 @@
14#define _RC32434_GPIO_H_ 14#define _RC32434_GPIO_H_
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <asm-generic/gpio.h>
17 18
18#define gpio_get_value __gpio_get_value 19#define NR_BUILTIN_GPIO 32
19#define gpio_set_value __gpio_set_value
20
21#define gpio_cansleep __gpio_cansleep
22 20
23#define gpio_to_irq(gpio) IRQ_GPIO(gpio) 21#define gpio_get_value __gpio_get_value
24#define irq_to_gpio(irq) IRQ_TO_GPIO(irq) 22#define gpio_set_value __gpio_set_value
23#define gpio_cansleep __gpio_cansleep
25 24
26#include <asm-generic/gpio.h> 25#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
26#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
27 27
28struct rb532_gpio_reg { 28struct rb532_gpio_reg {
29 u32 gpiofunc; /* GPIO Function Register 29 u32 gpiofunc; /* GPIO Function Register