Skip to content

Commit

Permalink
pinctrl: armada-37xx: Fix irq mask access in armada_37xx_irq_set_type()
Browse files Browse the repository at this point in the history
As explained in the following commit a9a1a48 ("pinctrl:
armada-37xx: Fix gpio interrupt setup") the armada_37xx_irq_set_type()
function can be called before the initialization of the mask field.

That means that we can't use this field in this function and need to
workaround it using hwirq.

Fixes: 30ac0d3 ("pinctrl: armada-37xx: Add edge both type gpio irq support")
Cc: [email protected]
Reported-by: Russell King <[email protected]>
Signed-off-by: Gregory CLEMENT <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
gclement authored and linusw committed Nov 21, 2019
1 parent 3fab296 commit 04fb027
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ static int armada_37xx_irq_set_type(struct irq_data *d, unsigned int type)
regmap_read(info->regmap, in_reg, &in_val);

/* Set initial polarity based on current input level. */
if (in_val & d->mask)
val |= d->mask; /* falling */
if (in_val & BIT(d->hwirq % GPIO_PER_REG))
val |= BIT(d->hwirq % GPIO_PER_REG); /* falling */
else
val &= ~d->mask; /* rising */
val &= ~(BIT(d->hwirq % GPIO_PER_REG)); /* rising */
break;
}
default:
Expand Down

0 comments on commit 04fb027

Please sign in to comment.