diff options
Diffstat (limited to 'drivers/gpio/gpio-sa1100.c')
| -rw-r--r-- | drivers/gpio/gpio-sa1100.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index b6c1f6d8064..a90be34e4d5 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c @@ -10,8 +10,9 @@ #include <linux/gpio.h> #include <linux/init.h> #include <linux/module.h> - +#include <linux/io.h> #include <mach/hardware.h> +#include <mach/irqs.h> static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset) { @@ -47,12 +48,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, }; |
