diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2011-08-22 03:43:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-08-22 04:12:56 -0400 |
commit | 257af9f9725aa8a863b306659208a031135d59e7 (patch) | |
tree | ecd200084aff34e820fc242f8a2996d3cb45c9ad /drivers/gpio | |
parent | 5f3fcf9649dbb010ccac41259d04147775ec8fc2 (diff) |
ARM: 7041/1: gpio-ep93xx: hookup the to_irq callback in the driver
Remove the ep93xx machine specific dependencies for gpio_to_irq() by
hooking up the callback in the driver and using __gpio_to_irq.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-ep93xx.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index 72fb9c665320..fbd6a6066777 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c | |||
@@ -307,6 +307,21 @@ static int ep93xx_gpio_set_debounce(struct gpio_chip *chip, | |||
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | 309 | ||
310 | /* | ||
311 | * Map GPIO A0..A7 (0..7) to irq 64..71, | ||
312 | * B0..B7 (7..15) to irq 72..79, and | ||
313 | * F0..F7 (16..24) to irq 80..87. | ||
314 | */ | ||
315 | static int ep93xx_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | ||
316 | { | ||
317 | int gpio = chip->base + offset; | ||
318 | |||
319 | if (gpio > EP93XX_GPIO_LINE_MAX_IRQ) | ||
320 | return -EINVAL; | ||
321 | |||
322 | return 64 + gpio; | ||
323 | } | ||
324 | |||
310 | static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, | 325 | static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, |
311 | void __iomem *mmio_base, struct ep93xx_gpio_bank *bank) | 326 | void __iomem *mmio_base, struct ep93xx_gpio_bank *bank) |
312 | { | 327 | { |
@@ -321,8 +336,10 @@ static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, | |||
321 | bgc->gc.label = bank->label; | 336 | bgc->gc.label = bank->label; |
322 | bgc->gc.base = bank->base; | 337 | bgc->gc.base = bank->base; |
323 | 338 | ||
324 | if (bank->has_debounce) | 339 | if (bank->has_debounce) { |
325 | bgc->gc.set_debounce = ep93xx_gpio_set_debounce; | 340 | bgc->gc.set_debounce = ep93xx_gpio_set_debounce; |
341 | bgc->gc.to_irq = ep93xx_gpio_to_irq; | ||
342 | } | ||
326 | 343 | ||
327 | return gpiochip_add(&bgc->gc); | 344 | return gpiochip_add(&bgc->gc); |
328 | } | 345 | } |