summaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform
diff options
context:
space:
mode:
authorSteven King <sfking@fdwdc.com>2014-05-22 01:00:30 +0200
committerGreg Ungerer <gerg@uclinux.org>2014-05-26 05:28:37 +0200
commit60fc65fdd1f18c75095a00229078d884f5135fc1 (patch)
treed4b33feca5ca65b0f2bd0ab7197daffc4629cdf3 /arch/m68k/platform
parentm68knommu: qspi declutter. (diff)
downloadlinux-60fc65fdd1f18c75095a00229078d884f5135fc1.tar.xz
linux-60fc65fdd1f18c75095a00229078d884f5135fc1.zip
m68knommu: add to_irq function so we can map gpios to external interrupts.
Singed-off-by: Steven King <sfking@fdwdc.com> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform')
-rw-r--r--arch/m68k/platform/coldfire/gpio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/m68k/platform/coldfire/gpio.c b/arch/m68k/platform/coldfire/gpio.c
index 9cd2b5c70519..ab9ac4110877 100644
--- a/arch/m68k/platform/coldfire/gpio.c
+++ b/arch/m68k/platform/coldfire/gpio.c
@@ -147,6 +147,18 @@ void mcfgpio_free(struct gpio_chip *chip, unsigned 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 = {
.name = "gpio",
.dev_name = "gpio",
@@ -160,6 +172,7 @@ static struct gpio_chip mcfgpio_chip = {
.direction_output = mcfgpio_direction_output,
.get = mcfgpio_get_value,
.set = mcfgpio_set_value,
+ .to_irq = mcfgpio_to_irq,
.base = 0,
.ngpio = MCFGPIO_PIN_MAX,
};