Commit 29501577 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik Committed by Tony Lindgren

omap: gpio: fix incorrect matching of IRQ_TYPE_EDGE_BOTH

Since IRQ_TYPE_EDGE_BOTH is defined as (IRQ_TYPE_EDGE_FALLING |
IRQ_TYPE_EDGE_RISING), testing against it with a bitwise AND also matches
both single-edge cases in addition to the intended both edges case. Fix it,
replacing with a more accurate expression.

Created and tested againts linux-2.6.34-rc3.
Applicable to 2.6.33-stable as well.
Signed-off-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 46cdc4e4
...@@ -798,7 +798,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) ...@@ -798,7 +798,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
case METHOD_MPUIO: case METHOD_MPUIO:
reg += OMAP_MPUIO_GPIO_INT_EDGE; reg += OMAP_MPUIO_GPIO_INT_EDGE;
l = __raw_readl(reg); l = __raw_readl(reg);
if (trigger & IRQ_TYPE_EDGE_BOTH) if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
bank->toggle_mask |= 1 << gpio; bank->toggle_mask |= 1 << gpio;
if (trigger & IRQ_TYPE_EDGE_RISING) if (trigger & IRQ_TYPE_EDGE_RISING)
l |= 1 << gpio; l |= 1 << gpio;
...@@ -812,7 +812,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) ...@@ -812,7 +812,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
case METHOD_GPIO_1510: case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_INT_CONTROL; reg += OMAP1510_GPIO_INT_CONTROL;
l = __raw_readl(reg); l = __raw_readl(reg);
if (trigger & IRQ_TYPE_EDGE_BOTH) if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
bank->toggle_mask |= 1 << gpio; bank->toggle_mask |= 1 << gpio;
if (trigger & IRQ_TYPE_EDGE_RISING) if (trigger & IRQ_TYPE_EDGE_RISING)
l |= 1 << gpio; l |= 1 << gpio;
...@@ -846,7 +846,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) ...@@ -846,7 +846,7 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
case METHOD_GPIO_7XX: case METHOD_GPIO_7XX:
reg += OMAP7XX_GPIO_INT_CONTROL; reg += OMAP7XX_GPIO_INT_CONTROL;
l = __raw_readl(reg); l = __raw_readl(reg);
if (trigger & IRQ_TYPE_EDGE_BOTH) if ((trigger & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
bank->toggle_mask |= 1 << gpio; bank->toggle_mask |= 1 << gpio;
if (trigger & IRQ_TYPE_EDGE_RISING) if (trigger & IRQ_TYPE_EDGE_RISING)
l |= 1 << gpio; l |= 1 << gpio;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment