[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>
This commit is contained in:
Ben Dooks 2008-12-13 20:44:13 +00:00
parent 72880ad866
commit 7ef71320eb
2 changed files with 3 additions and 8 deletions

View File

@ -197,15 +197,13 @@ static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin)
/* /*
* Map GPIO line to IRQ number. * Map GPIO line to IRQ number.
*/ */
int gpio_to_irq(unsigned int pin) static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin)
{ {
if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */
return -EINVAL; return -EINVAL;
return gpio_irq[pin]; return gpio_irq[pin];
} }
EXPORT_SYMBOL(gpio_to_irq);
/* /*
* Map IRQ number to GPIO line. * Map IRQ number to GPIO line.
@ -227,6 +225,7 @@ static struct gpio_chip ks8695_gpio_chip = {
.direction_output = ks8695_gpio_direction_output, .direction_output = ks8695_gpio_direction_output,
.get = ks8695_gpio_get_value, .get = ks8695_gpio_get_value,
.set = ks8695_gpio_set_value, .set = ks8695_gpio_set_value,
.to_irq = ks8695_gpio_to_irq,
.base = 0, .base = 0,
.ngpio = 16, .ngpio = 16,
.can_sleep = 0, .can_sleep = 0,

View File

@ -35,11 +35,6 @@
*/ */
extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
/*
* Map GPIO line to IRQ number.
*/
extern int gpio_to_irq(unsigned int pin);
/* /*
* Map IRQ number to GPIO line. * Map IRQ number to GPIO line.
*/ */
@ -54,6 +49,7 @@ extern int irq_to_gpio(unsigned int irq);
*/ */
#define gpio_get_value __gpio_get_value #define gpio_get_value __gpio_get_value
#define gpio_set_value __gpio_set_value #define gpio_set_value __gpio_set_value
#define gpio_to_irq __gpio_to_irq
/* Register the GPIOs */ /* Register the GPIOs */
extern void ks8695_register_gpios(void); extern void ks8695_register_gpios(void);