linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] pinctrl-amd powerbtn handling regression
@ 2023-08-29 16:56 Mario Limonciello
  2023-08-29 16:56 ` [PATCH 1/3] pinctrl: amd: Clear `Less2secSts` and `Less10secSts` for GPIO0 Mario Limonciello
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Mario Limonciello @ 2023-08-29 16:56 UTC (permalink / raw)
  To: linus.walleij
  Cc: Shyam-sundar.S-k, Basavaraj.Natikar, linux-gpio, linux-kernel,
	regressions, lucapgl2001, Mario Limonciello

AMD GPIO controllers have a bit in one of the registers that sets debounce
to meet Windows certification requirements.

As many platforms ship Windows they enable this by default.
Linux was not using it until a bug fix commit a855724dc08b ("pinctrl: amd:
Fix mistake in handling clearing pins at startup") aligned the register
with the intended values.

On systems that program GPIOs through _AEI and handle interrupts in the
GPIO controller driver this makes them behave like Windows.

On systems that don't program GPIOs in _AEI, the interrupts aren't handled
by the GPIO controller driver this causes the GPIO to get "stuck".

It's stuck because according to the spec the interrupt is supposed to be
cleared by driver when the button is pressed less than 2s.

However as the GPIO doesn't trigger an interrupt, it can't be cleared
until another GPIO that is handled by the driver (such as touchpad).

This series adds handling behavior from the spec, but as it's not ideal
on the reported platform from the lack of interrupt to handle set a quirk
to revert the debounce behavior back to old behavior.

A module parameter is also added to let anyone else affected by this debug
it.

Mario Limonciello (3):
  pinctrl: amd: Clear `Less2secSts` and `Less10secSts` for GPIO0
  pinctrl: amd: Add a module parameter to configure power button
    behavior
  pinctrl: amd: Add a quirk for Lenovo Ideapad 5

 drivers/pinctrl/pinctrl-amd.c | 70 +++++++++++++++++++++++++++++++++++
 drivers/pinctrl/pinctrl-amd.h |  2 +
 2 files changed, 72 insertions(+)


base-commit: b4e880a8d840e2b64937ab47ad518185c07747e3
-- 
2.34.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-09-14 14:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-29 16:56 [PATCH 0/3] pinctrl-amd powerbtn handling regression Mario Limonciello
2023-08-29 16:56 ` [PATCH 1/3] pinctrl: amd: Clear `Less2secSts` and `Less10secSts` for GPIO0 Mario Limonciello
2023-08-29 16:56 ` [PATCH 2/3] pinctrl: amd: Add a module parameter to configure power button behavior Mario Limonciello
2023-08-29 16:56 ` [PATCH 3/3] pinctrl: amd: Add a quirk for Lenovo Ideapad 5 Mario Limonciello
2023-08-29 19:54   ` Hans de Goede
2023-08-29 21:37     ` Mario Limonciello
2023-08-30 15:37       ` Hans de Goede
2023-08-30 15:47         ` Mario Limonciello
2023-08-30 16:18           ` Hans de Goede
2023-08-31 17:53             ` Mario Limonciello
2023-09-12  7:08               ` Linus Walleij
2023-09-12  8:58                 ` Hans de Goede
2023-09-12 18:21                   ` Mario Limonciello
2023-09-13 21:21                     ` Mario Limonciello
2023-09-14  8:43                       ` Linus Walleij
2023-09-14  9:08                         ` Luca Pigliacampo
2023-09-14 14:38                           ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).