diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-12-13 15:44:13 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-12-14 06:34:47 -0500 |
commit | 7ef71320eba8933275be10bfa44e083bec95b3f1 (patch) | |
tree | 3f588c2f24204ecedcce1b3814cd5c3b130e9c4b /arch | |
parent | 72880ad866c21badace4d8026c1e58f2fde087fb (diff) |
[ARM] KS8695: Add GPIO to IRQ mapping function
Use the GPIOlib .to_irq call to map KS8695 GPIOs
to the relevant IRQ line.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ks8695/gpio.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-ks8695/include/mach/gpio.h | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/arch/arm/mach-ks8695/gpio.c b/arch/arm/mach-ks8695/gpio.c index 26d6346f38f1..55fbf7111a5b 100644 --- a/arch/arm/mach-ks8695/gpio.c +++ b/arch/arm/mach-ks8695/gpio.c | |||
@@ -197,15 +197,13 @@ static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin) | |||
197 | /* | 197 | /* |
198 | * Map GPIO line to IRQ number. | 198 | * Map GPIO line to IRQ number. |
199 | */ | 199 | */ |
200 | int gpio_to_irq(unsigned int pin) | 200 | static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin) |
201 | { | 201 | { |
202 | if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ | 202 | if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ |
203 | return -EINVAL; | 203 | return -EINVAL; |
204 | 204 | ||
205 | return gpio_irq[pin]; | 205 | return gpio_irq[pin]; |
206 | } | 206 | } |
207 | EXPORT_SYMBOL(gpio_to_irq); | ||
208 | |||
209 | 207 | ||
210 | /* | 208 | /* |
211 | * Map IRQ number to GPIO line. | 209 | * Map IRQ number to GPIO line. |
@@ -227,6 +225,7 @@ static struct gpio_chip ks8695_gpio_chip = { | |||
227 | .direction_output = ks8695_gpio_direction_output, | 225 | .direction_output = ks8695_gpio_direction_output, |
228 | .get = ks8695_gpio_get_value, | 226 | .get = ks8695_gpio_get_value, |
229 | .set = ks8695_gpio_set_value, | 227 | .set = ks8695_gpio_set_value, |
228 | .to_irq = ks8695_gpio_to_irq, | ||
230 | .base = 0, | 229 | .base = 0, |
231 | .ngpio = 16, | 230 | .ngpio = 16, |
232 | .can_sleep = 0, | 231 | .can_sleep = 0, |
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 6379f2fe843d..86312d476bc6 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h | |||
@@ -36,11 +36,6 @@ | |||
36 | extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); | 36 | extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * Map GPIO line to IRQ number. | ||
40 | */ | ||
41 | extern int gpio_to_irq(unsigned int pin); | ||
42 | |||
43 | /* | ||
44 | * Map IRQ number to GPIO line. | 39 | * Map IRQ number to GPIO line. |
45 | */ | 40 | */ |
46 | extern int irq_to_gpio(unsigned int irq); | 41 | extern int irq_to_gpio(unsigned int irq); |
@@ -54,6 +49,7 @@ extern int irq_to_gpio(unsigned int irq); | |||
54 | */ | 49 | */ |
55 | #define gpio_get_value __gpio_get_value | 50 | #define gpio_get_value __gpio_get_value |
56 | #define gpio_set_value __gpio_set_value | 51 | #define gpio_set_value __gpio_set_value |
52 | #define gpio_to_irq __gpio_to_irq | ||
57 | 53 | ||
58 | /* Register the GPIOs */ | 54 | /* Register the GPIOs */ |
59 | extern void ks8695_register_gpios(void); | 55 | extern void ks8695_register_gpios(void); |