aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-12-18 13:24:57 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-01-14 00:25:23 -0500
commitf408c985cefc9b1d99bc099e1208dd7df3445aa5 (patch)
tree8413c8cf3d8b21bfed24f09726f5c07d87be9c40 /drivers/gpio
parentfda87903f4e9caf87e02d52768c2611e417b7efb (diff)
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 <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-sa1100.c6
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
47 return 0; 47 return 0;
48} 48}
49 49
50static int sa1100_to_irq(struct gpio_chip *chip, unsigned offset)
51{
52 return offset < 11 ? (IRQ_GPIO0 + offset) : (IRQ_GPIO11 - 11 + offset);
53}
54
50static struct gpio_chip sa1100_gpio_chip = { 55static struct gpio_chip sa1100_gpio_chip = {
51 .label = "gpio", 56 .label = "gpio",
52 .direction_input = sa1100_direction_input, 57 .direction_input = sa1100_direction_input,
53 .direction_output = sa1100_direction_output, 58 .direction_output = sa1100_direction_output,
54 .set = sa1100_gpio_set, 59 .set = sa1100_gpio_set,
55 .get = sa1100_gpio_get, 60 .get = sa1100_gpio_get,
61 .to_irq = sa1100_to_irq,
56 .base = 0, 62 .base = 0,
57 .ngpio = GPIO_MAX + 1, 63 .ngpio = GPIO_MAX + 1,
58}; 64};