Skip to content

Commit c0af427

Browse files
pelwellpopcornmix
authored andcommitted
pinctrl: rp1: Clear events when setting IRQ type
When setting the interrupt type, it is unlikely that any latched events are of interest, so clear them. Signed-off-by: Phil Elwell <[email protected]>
1 parent 6f0a634 commit c0af427

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/pinctrl/pinctrl-rp1.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,10 +848,13 @@ static int rp1_irq_set_type(struct rp1_pin_info *pin, unsigned int type)
848848
return -EINVAL;
849849
}
850850

851-
/* Clear them all */
851+
/* Clear the event enables */
852852
writel(RP1_INT_MASK << RP1_GPIO_EVENTS_SHIFT_RAW,
853853
pin->gpio + RP1_CLR_OFFSET + RP1_GPIO_CTRL);
854-
/* Set those that are needed */
854+
/* Clear any latched events */
855+
writel(RP1_GPIO_CTRL_IRQRESET,
856+
pin->gpio + RP1_SET_OFFSET + RP1_GPIO_CTRL);
857+
/* Enable the events that are needed */
855858
writel(irq_flags << RP1_GPIO_EVENTS_SHIFT_RAW,
856859
pin->gpio + RP1_SET_OFFSET + RP1_GPIO_CTRL);
857860
pin->irq_type = type;

0 commit comments

Comments
 (0)