Skip to contentSkip to conversation

GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

PATCH New Russell King - ARM Linux 3 participants 6 messages Dec 18, 2011 – Jan 14, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

---
Grant, please apply to your gpio tree. Thanks.

 arch/arm/mach-sa1100/include/mach/gpio.h |    3 ---
 drivers/gpio/gpio-sa1100.c               |    6 ++++++
 2 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/mach-sa1100/include/mach/gpio.h +0 -3
index 7036318..a38fc4f 100644
@@ -51,7 +51,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
 
 #define gpio_cansleep	__gpio_cansleep
 
-#define gpio_to_irq(gpio)	((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
-					(IRQ_GPIO11 - 11 + gpio))
-
 #endif
drivers/gpio/gpio-sa1100.c +6 -0
index b6c1f6d..7eecf69 100644
@@ -47,12 +47,18 @@ static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int
 	return 0;
 }
 
+static int sa1100_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+	return offset < 11 ? (IRQ_GPIO0 + offset) : (IRQ_GPIO11 - 11 + offset);
+}
+
 static struct gpio_chip sa1100_gpio_chip = {
 	.label			= "gpio",
 	.direction_input	= sa1100_direction_input,
 	.direction_output	= sa1100_direction_output,
 	.set			= sa1100_gpio_set,
 	.get			= sa1100_gpio_get,
+	.to_irq			= sa1100_to_irq,
 	.base			= 0,
 	.ngpio			= GPIO_MAX + 1,
 };
#1 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

Quoted 10 lines · Russell King - ARM Linux

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

Thanks Russell!

Yours,
Linus Walleij

#2 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

Quoted 9 lines · Linus Walleij
Quoted 6 lines · Russell King - ARM Linux

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Quoted 7 lines
Quoted 4 lines

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

Thanks Russell!

Grant,

Have you queued this up or is it going to be missed for this merge window?

Thanks.

#3 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

Quoted 15 lines · Russell King - ARM Linux
Quoted 14 lines · Linus Walleij
Quoted 10 lines · Russell King - ARM Linux

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

Quoted 8 lines
Quoted 2 lines

Thanks Russell!

Grant,

Have you queued this up or is it going to be missed for this merge window?

Thanks.

Ping.

#4 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

In reply to Russell King - ARM Linux
Quoted 15 lines · Russell King - ARM Linux
Quoted 14 lines · Linus Walleij
Quoted 10 lines · Russell King - ARM Linux

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

Quoted 8 lines
Quoted 2 lines

Thanks Russell!

Grant,

Have you queued this up or is it going to be missed for this merge window?

Thanks.

Let's try that again, this time with Grant in the To: line rather than Linus.

Ping.

Applied
#5 lore raw

PATCH 1/1 GPIO: sa1100: implement proper gpiolib gpio_to_irq conversion

Quoted 19 lines · Russell King - ARM Linux
Quoted 18 lines · Russell King - ARM Linux
Quoted 16 lines · Linus Walleij
Quoted 10 lines · Russell King - ARM Linux

From: Russell King <[email protected]>

The existing gpio_to_irq() implementation on sa1100 only translates validly for internal GPIOs. ?Since this sub-arch enables GPIOLIB support, this results in buggy translations for non-internal GPIOs.

Get rid of the private gpio_to_irq() implementation, replacing it with the .to_irq method in the sa1100 gpio chip instead.

Thanks Russell!

Quoted 8 lines
Quoted 5 lines

Grant,

Have you queued this up or is it going to be missed for this merge window?

Thanks.

Let's try that again, this time with Grant in the To: line rather than Linus.

Applied. Sorry for the delay. I dropped a lot of patches over Christmas because I couldn't keep up on my email

g.