[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>
This commit is contained in:
parent
e605ecd7c8
commit
bdf82b59c5
6 changed files with 91 additions and 134 deletions
|
@ -83,17 +83,6 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
|
|||
#define IXP4XX_GPIO_OUT 0x1
|
||||
#define IXP4XX_GPIO_IN 0x2
|
||||
|
||||
#define IXP4XX_GPIO_INTSTYLE_MASK 0x7C /* Bits [6:2] define interrupt style */
|
||||
|
||||
/*
|
||||
* GPIO interrupt types.
|
||||
*/
|
||||
#define IXP4XX_GPIO_ACTIVE_HIGH 0x4 /* Default */
|
||||
#define IXP4XX_GPIO_ACTIVE_LOW 0x8
|
||||
#define IXP4XX_GPIO_RISING_EDGE 0x10
|
||||
#define IXP4XX_GPIO_FALLING_EDGE 0x20
|
||||
#define IXP4XX_GPIO_TRANSITIONAL 0x40
|
||||
|
||||
/* GPIO signal types */
|
||||
#define IXP4XX_GPIO_LOW 0
|
||||
#define IXP4XX_GPIO_HIGH 1
|
||||
|
@ -102,7 +91,13 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
|
|||
#define IXP4XX_GPIO_CLK_0 14
|
||||
#define IXP4XX_GPIO_CLK_1 15
|
||||
|
||||
extern void gpio_line_config(u8 line, u32 style);
|
||||
static inline void gpio_line_config(u8 line, u32 direction)
|
||||
{
|
||||
if (direction == IXP4XX_GPIO_OUT)
|
||||
*IXP4XX_GPIO_GPOER |= (1 << line);
|
||||
else
|
||||
*IXP4XX_GPIO_GPOER &= ~(1 << line);
|
||||
}
|
||||
|
||||
static inline void gpio_line_get(u8 line, int *value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue