Commit 60fc65fd authored by Steven King's avatar Steven King Committed by Greg Ungerer

m68knommu: add to_irq function so we can map gpios to external interrupts.

Singed-off-by: default avatarSteven King <sfking@fdwdc.com>
Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
parent 151d14f4
...@@ -147,6 +147,18 @@ void mcfgpio_free(struct gpio_chip *chip, unsigned offset) ...@@ -147,6 +147,18 @@ void mcfgpio_free(struct gpio_chip *chip, unsigned offset)
__mcfgpio_free(offset); __mcfgpio_free(offset);
} }
int mcfgpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
#if defined(MCFGPIO_IRQ_MIN)
if ((offset >= MCFGPIO_IRQ_MIN) && (offset < MCFGPIO_IRQ_MAX))
#else
if (offset < MCFGPIO_IRQ_MAX)
#endif
return MCFGPIO_IRQ_VECBASE + offset;
else
return -EINVAL;
}
struct bus_type mcfgpio_subsys = { struct bus_type mcfgpio_subsys = {
.name = "gpio", .name = "gpio",
.dev_name = "gpio", .dev_name = "gpio",
...@@ -160,6 +172,7 @@ static struct gpio_chip mcfgpio_chip = { ...@@ -160,6 +172,7 @@ static struct gpio_chip mcfgpio_chip = {
.direction_output = mcfgpio_direction_output, .direction_output = mcfgpio_direction_output,
.get = mcfgpio_get_value, .get = mcfgpio_get_value,
.set = mcfgpio_set_value, .set = mcfgpio_set_value,
.to_irq = mcfgpio_to_irq,
.base = 0, .base = 0,
.ngpio = MCFGPIO_PIN_MAX, .ngpio = MCFGPIO_PIN_MAX,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment