Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: amd: Only use special debounce behavior for GPIO 0

It's uncommon to use debounce on any other pin, but technically
we should only set debounce to 0 when working off GPIO0.

Cc: stable@vger.kernel.org
Tested-by: Jan Visser <starquake@linuxeverywhere.org>
Fixes: 968ab9261627 ("pinctrl: amd: Detect internal GPIO0 debounce handling")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230705133005.577-2-mario.limonciello@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Mario Limonciello and committed by
Linus Walleij
0d5ace1a 06c2afb8

+5 -3
+5 -3
drivers/pinctrl/pinctrl-amd.c
··· 128 128 raw_spin_lock_irqsave(&gpio_dev->lock, flags); 129 129 130 130 /* Use special handling for Pin0 debounce */ 131 - pin_reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG); 132 - if (pin_reg & INTERNAL_GPIO0_DEBOUNCE) 133 - debounce = 0; 131 + if (offset == 0) { 132 + pin_reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG); 133 + if (pin_reg & INTERNAL_GPIO0_DEBOUNCE) 134 + debounce = 0; 135 + } 134 136 135 137 pin_reg = readl(gpio_dev->base + offset * 4); 136 138