diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-12-10 20:35:25 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-12-10 20:35:25 -0500 |
commit | a007b7096feea2d865ad3e7177eb8be34041bef9 (patch) | |
tree | be9a46ce0a25639481d1c6db1dd6d936f4c5b9e1 /arch/arm/plat-omap/gpio.c | |
parent | 21c867f1dedc21fb6e5244b7b27cfcfd09b83188 (diff) |
ARM: OMAP: gpios implement new to_irq()
Make OMAP use the new __gpio_to_irq() hook, to make it easier to
support IRQs coming in from off-chip gpio controllers like the
TWL4030/TPS65930 chip used on OMAP3 boads like Beagleboard.org and
the Gumstix Overo.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 8ff225bb1e46..e07ab233e783 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -1285,6 +1285,14 @@ static void gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
1285 | spin_unlock_irqrestore(&bank->lock, flags); | 1285 | spin_unlock_irqrestore(&bank->lock, flags); |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | static int gpio_2irq(struct gpio_chip *chip, unsigned offset) | ||
1289 | { | ||
1290 | struct gpio_bank *bank; | ||
1291 | |||
1292 | bank = container_of(chip, struct gpio_bank, chip); | ||
1293 | return bank->virtual_irq_start + offset; | ||
1294 | } | ||
1295 | |||
1288 | /*---------------------------------------------------------------------*/ | 1296 | /*---------------------------------------------------------------------*/ |
1289 | 1297 | ||
1290 | static int initialized; | 1298 | static int initialized; |
@@ -1480,6 +1488,7 @@ static int __init _omap_gpio_init(void) | |||
1480 | bank->chip.get = gpio_get; | 1488 | bank->chip.get = gpio_get; |
1481 | bank->chip.direction_output = gpio_output; | 1489 | bank->chip.direction_output = gpio_output; |
1482 | bank->chip.set = gpio_set; | 1490 | bank->chip.set = gpio_set; |
1491 | bank->chip.to_irq = gpio_2irq; | ||
1483 | if (bank_is_mpuio(bank)) { | 1492 | if (bank_is_mpuio(bank)) { |
1484 | bank->chip.label = "mpuio"; | 1493 | bank->chip.label = "mpuio"; |
1485 | #ifdef CONFIG_ARCH_OMAP16XX | 1494 | #ifdef CONFIG_ARCH_OMAP16XX |