Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91218
b: refs/heads/master
c: 0e037bb
h: refs/heads/master
v: v3
  • Loading branch information
eric miao authored and Russell King committed Apr 19, 2008
1 parent 9b7a766 commit 8661133
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dfa1067996390dfd4b1ce449676500fab4980ce2
refs/heads/master: 0e037bbb4a639fff01cebf552db19237ec688678
66 changes: 18 additions & 48 deletions trunk/arch/arm/mach-pxa/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,56 +129,26 @@ static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
__raw_writel(mask, pxa->regbase + GPCR_OFFSET);
}

#define GPIO_CHIP(_n) \
[_n] = { \
.regbase = GPIO##_n##_BASE, \
.chip = { \
.label = "gpio-" #_n, \
.direction_input = pxa_gpio_direction_input, \
.direction_output = pxa_gpio_direction_output, \
.get = pxa_gpio_get, \
.set = pxa_gpio_set, \
.base = (_n) * 32, \
.ngpio = 32, \
}, \
}

static struct pxa_gpio_chip pxa_gpio_chip[] = {
[0] = {
.regbase = GPIO0_BASE,
.chip = {
.label = "gpio-0",
.direction_input = pxa_gpio_direction_input,
.direction_output = pxa_gpio_direction_output,
.get = pxa_gpio_get,
.set = pxa_gpio_set,
.base = 0,
.ngpio = 32,
},
},
[1] = {
.regbase = GPIO1_BASE,
.chip = {
.label = "gpio-1",
.direction_input = pxa_gpio_direction_input,
.direction_output = pxa_gpio_direction_output,
.get = pxa_gpio_get,
.set = pxa_gpio_set,
.base = 32,
.ngpio = 32,
},
},
[2] = {
.regbase = GPIO2_BASE,
.chip = {
.label = "gpio-2",
.direction_input = pxa_gpio_direction_input,
.direction_output = pxa_gpio_direction_output,
.get = pxa_gpio_get,
.set = pxa_gpio_set,
.base = 64,
.ngpio = 32, /* 21 for PXA25x */
},
},
GPIO_CHIP(0),
GPIO_CHIP(1),
GPIO_CHIP(2),
#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
[3] = {
.regbase = GPIO3_BASE,
.chip = {
.label = "gpio-3",
.direction_input = pxa_gpio_direction_input,
.direction_output = pxa_gpio_direction_output,
.get = pxa_gpio_get,
.set = pxa_gpio_set,
.base = 96,
.ngpio = 32,
},
},
GPIO_CHIP(3),
#endif
};

Expand Down

0 comments on commit 8661133

Please sign in to comment.