diff options
author | Deepak Saxena <dsaxena@plexity.net> | 2005-08-29 17:46:30 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-29 17:46:30 -0400 |
commit | bdf82b59c5dcf04bbdbd1938eefca14dd9cb44d3 (patch) | |
tree | 68983f484e96c737cd504ecd08e7bf669a925cec /include/asm-arm | |
parent | e605ecd7c8a38f65759c938a235a1b84f41a744e (diff) |
[ARM] 2836/1: Cleanup IXP4xx GPIO code
Patch from Deepak Saxena
This patch implements the set_irq_type() hooks for configuring GPIO
IRQ type and updates all the platforms to use it instead of the
gpio_line_config() function which is now used to configure input
vs. output on the pins.
Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/arch-ixp4xx/platform.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h index 3a626c03ea26..d13ee7f78c70 100644 --- a/include/asm-arm/arch-ixp4xx/platform.h +++ b/include/asm-arm/arch-ixp4xx/platform.h | |||
@@ -83,17 +83,6 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); | |||
83 | #define IXP4XX_GPIO_OUT 0x1 | 83 | #define IXP4XX_GPIO_OUT 0x1 |
84 | #define IXP4XX_GPIO_IN 0x2 | 84 | #define IXP4XX_GPIO_IN 0x2 |
85 | 85 | ||
86 | #define IXP4XX_GPIO_INTSTYLE_MASK 0x7C /* Bits [6:2] define interrupt style */ | ||
87 | |||
88 | /* | ||
89 | * GPIO interrupt types. | ||
90 | */ | ||
91 | #define IXP4XX_GPIO_ACTIVE_HIGH 0x4 /* Default */ | ||
92 | #define IXP4XX_GPIO_ACTIVE_LOW 0x8 | ||
93 | #define IXP4XX_GPIO_RISING_EDGE 0x10 | ||
94 | #define IXP4XX_GPIO_FALLING_EDGE 0x20 | ||
95 | #define IXP4XX_GPIO_TRANSITIONAL 0x40 | ||
96 | |||
97 | /* GPIO signal types */ | 86 | /* GPIO signal types */ |
98 | #define IXP4XX_GPIO_LOW 0 | 87 | #define IXP4XX_GPIO_LOW 0 |
99 | #define IXP4XX_GPIO_HIGH 1 | 88 | #define IXP4XX_GPIO_HIGH 1 |
@@ -102,7 +91,13 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); | |||
102 | #define IXP4XX_GPIO_CLK_0 14 | 91 | #define IXP4XX_GPIO_CLK_0 14 |
103 | #define IXP4XX_GPIO_CLK_1 15 | 92 | #define IXP4XX_GPIO_CLK_1 15 |
104 | 93 | ||
105 | extern void gpio_line_config(u8 line, u32 style); | 94 | static inline void gpio_line_config(u8 line, u32 direction) |
95 | { | ||
96 | if (direction == IXP4XX_GPIO_OUT) | ||
97 | *IXP4XX_GPIO_GPOER |= (1 << line); | ||
98 | else | ||
99 | *IXP4XX_GPIO_GPOER &= ~(1 << line); | ||
100 | } | ||
106 | 101 | ||
107 | static inline void gpio_line_get(u8 line, int *value) | 102 | static inline void gpio_line_get(u8 line, int *value) |
108 | { | 103 | { |