Skip to content

Commit 06abe82

Browse files
coibylinusw
authored andcommitted
pinctrl: amd: fix incorrect way to disable debounce filter
The correct way to disable debounce filter is to clear bit 5 and 6 of the register. Cc: [email protected] Signed-off-by: Coiby Xu <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Cc: Hans de Goede <[email protected]> Link: https://lore.kernel.org/linux-gpio/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 9b92f5c commit 06abe82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pinctrl/pinctrl-amd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
166166
pin_reg |= BIT(DB_TMR_OUT_UNIT_OFF);
167167
pin_reg |= BIT(DB_TMR_LARGE_OFF);
168168
} else {
169-
pin_reg &= ~DB_CNTRl_MASK;
169+
pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
170170
ret = -EINVAL;
171171
}
172172
} else {
173173
pin_reg &= ~BIT(DB_TMR_OUT_UNIT_OFF);
174174
pin_reg &= ~BIT(DB_TMR_LARGE_OFF);
175175
pin_reg &= ~DB_TMR_OUT_MASK;
176-
pin_reg &= ~DB_CNTRl_MASK;
176+
pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
177177
}
178178
writel(pin_reg, gpio_dev->base + offset * 4);
179179
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);

0 commit comments

Comments
 (0)