diff options
| author | Russell King <[email protected]> | 2011-12-18 18:24:57 +0000 |
|---|---|---|
| committer | Grant Likely <[email protected]> | 2012-01-14 05:25:23 +0000 |
| commit | f408c985cefc9b1d99bc099e1208dd7df3445aa5 (patch) | |
| tree | 8413c8cf3d8b21bfed24f09726f5c07d87be9c40 /drivers/gpio/gpio-sa1100.c | |
| parent | Merge branch 'gpio-for-grant' of git://sources.calxeda.com/kernel/linux into ... (diff) | |
| download | kernel-f408c985cefc9b1d99bc099e1208dd7df3445aa5.tar.gz kernel-f408c985cefc9b1d99bc099e1208dd7df3445aa5.zip | |
GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion
The existing gpio_to_irq() implementation on sa1100 only translates
validly for internal GPIOs. Since this sub-arch enables GPIOLIB
support, this results in buggy translations for non-internal GPIOs.
Get rid of the private gpio_to_irq() implementation, replacing it
with the .to_irq method in the sa1100 gpio chip instead.
Signed-off-by: Russell King <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Grant Likely <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-sa1100.c')
| -rw-r--r-- | drivers/gpio/gpio-sa1100.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index b6c1f6d80649..7eecf69362ee 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c @@ -47,12 +47,18 @@ static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int return 0; } +static int sa1100_to_irq(struct gpio_chip *chip, unsigned offset) +{ + return offset < 11 ? (IRQ_GPIO0 + offset) : (IRQ_GPIO11 - 11 + offset); +} + static struct gpio_chip sa1100_gpio_chip = { .label = "gpio", .direction_input = sa1100_direction_input, .direction_output = sa1100_direction_output, .set = sa1100_gpio_set, .get = sa1100_gpio_get, + .to_irq = sa1100_to_irq, .base = 0, .ngpio = GPIO_MAX + 1, }; |
