Skip to contentSkip to conversation

m68k: Fall back to __gpio_to_irq() for non-arch GPIOs

PATCH In review Mark Brown 2 participants 2 messages Oct 26, 2011 – Oct 27, 2011 m68k architecture

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 m68k: Fall back to __gpio_to_irq() for non-arch GPIOs

gpiolib provides __gpio_to_irq() to map gpiolib gpios to interrupts - hook that up on m68k.

---
 arch/m68k/include/asm/gpio.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/m68k/include/asm/gpio.h +2 -1
index b204683..00d0071 100644
@@ -225,7 +225,8 @@ static inline void gpio_set_value(unsigned gpio, int value)
 
 static inline int gpio_to_irq(unsigned gpio)
 {
-	return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE : -EINVAL;
+	return (gpio < MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE
+		: __gpio_to_irq(gpio);
 }
 
 static inline int irq_to_gpio(unsigned irq)
Signature · 1 line
1.7.6.3
#1 lore raw

Hi Mark,

Quoted 4 lines · Mark Brown

gpiolib provides __gpio_to_irq() to map gpiolib gpios to interrupts - hook that up on m68k.

I'll take this through the m68knommu git tree, since it is only used by the ColdFire CPU parts.

Thanks
Greg

Quoted 17 lines
  arch/m68k/include/asm/gpio.h |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
arch/m68k/include/asm/gpio.h +2 -1
index b204683..00d0071 100644
@@ -225,7 +225,8 @@ static inline void gpio_set_value(unsigned gpio, int value)
 
  static inline int gpio_to_irq(unsigned gpio)
  {
-	return (gpio<  MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE : -EINVAL;
+	return (gpio<  MCFGPIO_IRQ_MAX) ? gpio + MCFGPIO_IRQ_VECBASE
+		: __gpio_to_irq(gpio);
  }
 
  static inline int irq_to_gpio(unsigned irq)
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close                             FAX:         +61 7 3217 5323
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com