diff options
author | Florian Fainelli <florian.fainelli@telecomint.eu> | 2008-03-26 17:39:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-03-27 11:08:45 -0400 |
commit | b2ef749720a97053d60605a7456772a1752164cc (patch) | |
tree | 47120d353cc460d078b5f4b6560c5ab392d09622 /include | |
parent | d8d4f157b8d828bc837f0eb2ee4a2dd40dbdd572 (diff) |
rdc321x: GPIO routines bugfixes
This patch fixes the use of GPIO routines which are in the PCI
configuration space of the RDC321x, therefore reading/writing
to this space without spinlock protection can be problematic.
We also now request and free GPIOs and support the MGB100
board, previous code was very AR525W-centric.
Signed-off-by: Volker Weiss <volker@tintuc.de>
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/mach-rdc321x/gpio.h | 9 | ||||
-rw-r--r-- | include/asm-x86/mach-rdc321x/rdc321x_defs.h | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/include/asm-x86/mach-rdc321x/gpio.h b/include/asm-x86/mach-rdc321x/gpio.h index db31b929b990..acce0b7d397b 100644 --- a/include/asm-x86/mach-rdc321x/gpio.h +++ b/include/asm-x86/mach-rdc321x/gpio.h | |||
@@ -5,19 +5,20 @@ extern int rdc_gpio_get_value(unsigned gpio); | |||
5 | extern void rdc_gpio_set_value(unsigned gpio, int value); | 5 | extern void rdc_gpio_set_value(unsigned gpio, int value); |
6 | extern int rdc_gpio_direction_input(unsigned gpio); | 6 | extern int rdc_gpio_direction_input(unsigned gpio); |
7 | extern int rdc_gpio_direction_output(unsigned gpio, int value); | 7 | extern int rdc_gpio_direction_output(unsigned gpio, int value); |
8 | 8 | extern int rdc_gpio_request(unsigned gpio, const char *label); | |
9 | extern void rdc_gpio_free(unsigned gpio); | ||
10 | extern void __init rdc321x_gpio_setup(void); | ||
9 | 11 | ||
10 | /* Wrappers for the arch-neutral GPIO API */ | 12 | /* Wrappers for the arch-neutral GPIO API */ |
11 | 13 | ||
12 | static inline int gpio_request(unsigned gpio, const char *label) | 14 | static inline int gpio_request(unsigned gpio, const char *label) |
13 | { | 15 | { |
14 | /* Not yet implemented */ | 16 | return rdc_gpio_request(gpio, label); |
15 | return 0; | ||
16 | } | 17 | } |
17 | 18 | ||
18 | static inline void gpio_free(unsigned gpio) | 19 | static inline void gpio_free(unsigned gpio) |
19 | { | 20 | { |
20 | /* Not yet implemented */ | 21 | rdc_gpio_free(gpio); |
21 | } | 22 | } |
22 | 23 | ||
23 | static inline int gpio_direction_input(unsigned gpio) | 24 | static inline int gpio_direction_input(unsigned gpio) |
diff --git a/include/asm-x86/mach-rdc321x/rdc321x_defs.h b/include/asm-x86/mach-rdc321x/rdc321x_defs.h index 838ba8f64fd3..c8e9c8bed3d0 100644 --- a/include/asm-x86/mach-rdc321x/rdc321x_defs.h +++ b/include/asm-x86/mach-rdc321x/rdc321x_defs.h | |||
@@ -3,4 +3,10 @@ | |||
3 | /* General purpose configuration and data registers */ | 3 | /* General purpose configuration and data registers */ |
4 | #define RDC3210_CFGREG_ADDR 0x0CF8 | 4 | #define RDC3210_CFGREG_ADDR 0x0CF8 |
5 | #define RDC3210_CFGREG_DATA 0x0CFC | 5 | #define RDC3210_CFGREG_DATA 0x0CFC |
6 | #define RDC_MAX_GPIO 0x3A | 6 | |
7 | #define RDC321X_GPIO_CTRL_REG1 0x48 | ||
8 | #define RDC321X_GPIO_CTRL_REG2 0x84 | ||
9 | #define RDC321X_GPIO_DATA_REG1 0x4c | ||
10 | #define RDC321X_GPIO_DATA_REG2 0x88 | ||
11 | |||
12 | #define RDC321X_MAX_GPIO 58 | ||