]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpiolib: acpi: Make set debounce errors non fatal
authorHans de Goede <hansg@kernel.org>
Wed, 22 Oct 2025 13:37:15 +0000 (15:37 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 23 Oct 2025 06:36:53 +0000 (08:36 +0200)
commite4a77f9c85a528b3289c1d9570d6d73a7b5f847b
tree1e6c5e926c2199df763bed8378526d049c01ec68
parent3a8660878839faadb4f1a6dd72c3179c1df56787
gpiolib: acpi: Make set debounce errors non fatal

Commit 16c07342b542 ("gpiolib: acpi: Program debounce when finding GPIO")
adds a gpio_set_debounce_timeout() call to acpi_find_gpio() and makes
acpi_find_gpio() fail if this fails.

But gpio_set_debounce_timeout() failing is a somewhat normal occurrence,
since not all debounce values are supported on all GPIO/pinctrl chips.

Making this an error for example break getting the card-detect GPIO for
the micro-sd slot found on many Bay Trail tablets, breaking support for
the micro-sd slot on these tablets.

acpi_request_own_gpiod() already treats gpio_set_debounce_timeout()
failures as non-fatal, just warning about them.

Add a acpi_gpio_set_debounce_timeout() helper which wraps
gpio_set_debounce_timeout() and warns on failures and replace both existing
gpio_set_debounce_timeout() calls with the helper.

Since the helper only warns on failures this fixes the card-detect issue.

Fixes: 16c07342b542 ("gpiolib: acpi: Program debounce when finding GPIO")
Cc: stable@vger.kernel.org
Cc: Mario Limonciello <superm1@kernel.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Acked-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/stable/20250920201200.20611-1-hansg%40kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/gpio/gpiolib-acpi-core.c