aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform
diff options
context:
space:
mode:
authorSteven King <sfking@fdwdc.com>2014-05-21 19:00:30 -0400
committerGreg Ungerer <gerg@uclinux.org>2014-05-25 23:28:37 -0400
commit60fc65fdd1f18c75095a00229078d884f5135fc1 (patch)
treed4b33feca5ca65b0f2bd0ab7197daffc4629cdf3 /arch/m68k/platform
parent151d14f4ac5a02cc059cb05b2a2f27ec5b9d6831 (diff)
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)
147 __mcfgpio_free(offset); 147 __mcfgpio_free(offset);
148} 148}
149 149
150int mcfgpio_to_irq(struct gpio_chip *chip, unsigned offset)
151{
152#if defined(MCFGPIO_IRQ_MIN)
153 if ((offset >= MCFGPIO_IRQ_MIN) && (offset < MCFGPIO_IRQ_MAX))
154#else
155 if (offset < MCFGPIO_IRQ_MAX)
156#endif
157 return MCFGPIO_IRQ_VECBASE + offset;
158 else
159 return -EINVAL;
160}
161
150struct bus_type mcfgpio_subsys = { 162struct bus_type mcfgpio_subsys = {
151 .name = "gpio", 163 .name = "gpio",
152 .dev_name = "gpio", 164 .dev_name = "gpio",
@@ -160,6 +172,7 @@ static struct gpio_chip mcfgpio_chip = {
160 .direction_output = mcfgpio_direction_output, 172 .direction_output = mcfgpio_direction_output,
161 .get = mcfgpio_get_value, 173 .get = mcfgpio_get_value,
162 .set = mcfgpio_set_value, 174 .set = mcfgpio_set_value,
175 .to_irq = mcfgpio_to_irq,
163 .base = 0, 176 .base = 0,
164 .ngpio = MCFGPIO_PIN_MAX, 177 .ngpio = MCFGPIO_PIN_MAX,
165}; 178};