Skip to contentSkip to conversation

pinctrl/at91: convert driver to use gpiolib irqchip

PATCH New Alexander Stein 2 participants 3 messages Apr 15, 2014 – Apr 23, 2014

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

PATCH 1/1 pinctrl/at91: convert driver to use gpiolib irqchip

This converts the AT91 pin control driver to register its chained irq handler and irqchip using the helpers in the gpiolib core.

---
This fixes the problem I come up with the patch

Quoted 1 line

gpio/at91: free GPIO after configuring as input

This uses irqchip helpers similar to

Quoted 1 line

e0bc34a ("pinctrl: nomadik: convert driver to use gpiolib irqchip")

Tested on a device tree based AT91SAM9263 board using GPIO buttons on PIO A and PIO E using evtest.

 drivers/pinctrl/Kconfig        |   3 +
 drivers/pinctrl/pinctrl-at91.c | 135 +++++++++--------------------------------
 2 files changed, 33 insertions(+), 105 deletions(-)
drivers/pinctrl/Kconfig +3 -0
index e493240..23a61c9 100644
@@ -84,6 +84,9 @@ config PINCTRL_AT91
 	depends on ARCH_AT91
 	select PINMUX
 	select PINCONF
+	select GPIOLIB
+	select OF_GPIO
+	select GPIOLIB_IRQCHIP
 	help
 	  Say Y here to enable the at91 pinctrl driver
 
drivers/pinctrl/pinctrl-at91.c +30 -105

202 lines not on this page · raw message

Signature · 1 line
1.9.2
#1 lore raw

PATCH 1/1 pinctrl/at91: convert driver to use gpiolib irqchip

Quoted 5 lines · Alexander Stein

This converts the AT91 pin control driver to register its chained irq handler and irqchip using the helpers in the gpiolib core.

Part of the large attempt to pull all these local hacks into the gpiolib irqchip helpers so patch applied. Any further quarrels can be solved on top of this in the *generic* code.

I changed this:

drivers/pinctrl/pinctrl-at91.c void at91_pinctrl_gpio_resume(void) · line 1423

Quoted 13 lines
drivers/pinctrl/pinctrl-at91.c +6 -0
+static void gpio_orq_ack(struct irq_data *d)
+{
+       /* the interrupt is already cleared before by reading ISR */
+}
+
 static unsigned int gpio_irq_startup(struct irq_data *d)
 {
        struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d);
@@ -1434,6 +1420,7 @@ void at91_pinctrl_gpio_resume(void)
 
 static struct irq_chip gpio_irqchip = {
        .name           = "GPIO",
+       .irq_ack        = gpio_orq_ack,

orq? I didn't get it so changed to irq when applying.

Yours,
Linus Walleij

#2 lore raw

PATCH 1/1 pinctrl/at91: convert driver to use gpiolib irqchip

Quoted 24 lines · Linus Walleij
Quoted 5 lines · Alexander Stein

This converts the AT91 pin control driver to register its chained irq handler and irqchip using the helpers in the gpiolib core.

Part of the large attempt to pull all these local hacks into the gpiolib irqchip helpers so patch applied. Any further quarrels can be solved on top of this in the *generic* code.

I changed this:

Quoted 10 lines
drivers/pinctrl/pinctrl-at91.c +5 -0
+static void gpio_orq_ack(struct irq_data *d)
+{
+       /* the interrupt is already cleared before by reading ISR */
+}
+
 static unsigned int gpio_irq_startup(struct irq_data *d)
 {
        struct at91_gpio_chip *at91_gpio = irq_data_get_irq_chip_data(d);
@@ -1434,6 +1420,7 @@ void at91_pinctrl_gpio_resume(void)
 
Quoted 5 lines

drivers/pinctrl/pinctrl-at91.c void at91_pinctrl_gpio_resume(void) · line 1423

Quoted 3 lines
drivers/pinctrl/pinctrl-at91.c +1 -0
 static struct irq_chip gpio_irqchip = {
        .name           = "GPIO",
+       .irq_ack        = gpio_orq_ack,

orq? I didn't get it so changed to irq when applying.

Yep, that was a typo. Thanks for noticing.

Regards,
Alexander