Skip to content

Commit

Permalink
gpio: gpio-mxc: Fix: higher 16 GPIOs usable as wake source
Browse files Browse the repository at this point in the history
In the function gpio_set_wake_irq(), port->irq_high is only checked for
zero. As platform_get_irq() returns a value less then zero if no interrupt
was found, any gpio >= 16 was handled like an irq_high interrupt was
available. On iMX27 for example no high interrupt is available. This lead
to the problem that only some gpios (the lower 16) were useable as wake
sources.

Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Philipp Rosenberger authored and Linus Walleij committed Aug 1, 2017
1 parent c23d200 commit cc9269f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpio/gpio-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ static int mxc_gpio_probe(struct platform_device *pdev)
return PTR_ERR(port->base);

port->irq_high = platform_get_irq(pdev, 1);
if (port->irq_high < 0)
port->irq_high = 0;

port->irq = platform_get_irq(pdev, 0);
if (port->irq < 0)
return port->irq;
Expand Down

0 comments on commit cc9269f

Please sign in to comment.