Skip to content

Commit

Permalink
gpio/pca953x: Fix IRQ support.
Browse files Browse the repository at this point in the history
It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly
cleared, otherwise claiming the interrupt fails.
In the case of sparse interrupts, the descriptor needs to be allocated
first.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
David Jander authored and Grant Likely committed Jun 16, 2011
1 parent 8e46ea3 commit c609c05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpio/gpio-pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,

static void pca953x_irq_teardown(struct pca953x_chip *chip)
{
if (chip->irq_base != -1)
if (chip->irq_base != -1) {
irq_free_descs(chip->irq_base, chip->gpio_chip.ngpio);
free_irq(chip->client->irq, chip);
}
}
#else /* CONFIG_GPIO_PCA953X_IRQ */
static int pca953x_irq_setup(struct pca953x_chip *chip,
Expand Down

0 comments on commit c609c05

Please sign in to comment.