From 5b65a02b63a98f0c7dd8a997fc1e5ddecd32af20 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 18 Dec 2011 18:24:57 +0000 Subject: [PATCH] --- yaml --- r: 284805 b: refs/heads/master c: f408c985cefc9b1d99bc099e1208dd7df3445aa5 h: refs/heads/master i: 284803: a09e9c4f91cee474e912778f58cfbd0bebdc9c44 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-sa1100/include/mach/gpio.h | 3 --- trunk/drivers/gpio/gpio-sa1100.c | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b3636edd2525..732bdea360c6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fda87903f4e9caf87e02d52768c2611e417b7efb +refs/heads/master: f408c985cefc9b1d99bc099e1208dd7df3445aa5 diff --git a/trunk/arch/arm/mach-sa1100/include/mach/gpio.h b/trunk/arch/arm/mach-sa1100/include/mach/gpio.h index 703631887c94..a38fc4f54241 100644 --- a/trunk/arch/arm/mach-sa1100/include/mach/gpio.h +++ b/trunk/arch/arm/mach-sa1100/include/mach/gpio.h @@ -51,7 +51,4 @@ static inline void gpio_set_value(unsigned gpio, int value) #define gpio_cansleep __gpio_cansleep -#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \ - (IRQ_GPIO11 - 11 + gpio)) - #endif diff --git a/trunk/drivers/gpio/gpio-sa1100.c b/trunk/drivers/gpio/gpio-sa1100.c index b6c1f6d80649..7eecf69362ee 100644 --- a/trunk/drivers/gpio/gpio-sa1100.c +++ b/trunk/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, };