gpio: pca953x: allow shared interrupts
cover gpio: pca953x: allow shared interrupts
These patches allow the pca953x family of chips to use a shared interrupt.
Toby Smith (2):
gpio: pca953x: return IRQ_NONE when appropriate
gpio: pca953x: request a shared interrupt
drivers/gpio/gpio-pca953x.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.2
PATCH 1/2 gpio: pca953x: return IRQ_NONE when appropriate
The irq handler should return IRQ_NONE or IRQ_HANDLED to report if we have handled the interrupt.
--- drivers/gpio/gpio-pca953x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpio/gpio-pca953x.c +4 -2
@@ -503,10 +503,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)struct pca953x_chip *chip = devid;u8 pending[MAX_BANK ];u8 level; +unsigned nhandled =0 ;int i;if (!pca953x_irq_pending (chip, pending)) -return IRQ_HANDLED ; +return IRQ_NONE ;for (i =0 ; i <NBANK (chip); i++) {while (pending[i]) {
@@ -514,10 +515,11 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)handle_nested_irq (irq_find_mapping (chip->domain, level + (BANK_SZ * i))); pending[i] &= ~(1 << level); + nhandled++; } } -return IRQ_HANDLED ; +return (nhandled >0 ) ?IRQ_HANDLED :IRQ_NONE ; } static int pca953x_gpio_irq_map(struct irq_domain *d, unsigned int irq,
Signature · 1 line
1.8.3.2
Re: [PATCH 1/2] gpio: pca953x: return IRQ_NONE when appropriate
Quoted 4 lines · Toby Smith
The irq handler should return
IRQ_NONEorIRQ_HANDLEDto report if we have handled the interrupt.Signed-off-by Toby Smith <[email protected]>
Patch applied.
Adding some randon pca953x developers to the thread so noone gets upset.
Yours,
Linus Walleij
PATCH 2/2 gpio: pca953x: request a shared interrupt
In reply to Toby SmithRequest a shared interrupt when requesting a pca953x GPIO interrupt
--- drivers/gpio/gpio-pca953x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +2 -1
@@ -586,7 +586,8 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, client->irq,NULL , pca953x_irq_handler, -IRQF_TRIGGER_LOW |IRQF_ONESHOT , +IRQF_TRIGGER_LOW |IRQF_ONESHOT | +IRQF_SHARED , dev_name(&client->dev), chip);if (ret) { dev_err(&client->dev, "failed to request irq %d\n",
Signature · 1 line
1.8.3.2
Re: [PATCH 2/2] gpio: pca953x: request a shared interrupt
Quoted 3 lines · Toby Smith
Request a shared interrupt when requesting a pca953x GPIO interrupt
Signed-off-by Toby Smith <[email protected]>
Patch applied.
Yours,
Linus Walleij