[PATCH 07/10] Input: axp20x-pek - skip IRQ handling during sleep without input device

From: Lee Jones

Date: Mon Nov 23 2026 - 13:33:03 EST


On Cherry Trail systems where an ACPI GPIO button device already handles
the power button, axp20x_pek_should_register_input() returns false and
axp20x_pek_probe() skips axp20x_pek_probe_input_device(). This leaves
axp20x_pek->input NULL and both irq_dbr and irq_dbf zero-initialised.

axp20x_pek_suspend() and axp20x_pek_resume() nevertheless pass irq_dbf
and irq_dbr unconditionally to disable_irq(), enable_irq(), and their
wakeup counterparts, manipulating IRQ 0 (the legacy x86 system timer)
across suspend and resume.

Skip interrupt management in axp20x_pek_suspend() and
axp20x_pek_resume() when no input device was registered.

Fixes: 8a78050ee257 ("Input: axp20x-pek - revert "always register interrupt handlers" change")
Closes: https://sashiko.dev/#/bug/linux-5ae6851f-784e-481c-900b-2e1686578c89
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/input/misc/axp20x-pek.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index cbbc9db33ad2..a02cdabcf22b 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -329,6 +329,9 @@ static int axp20x_pek_suspend(struct device *dev)
{
struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);

+ if (!axp20x_pek->input)
+ return 0;
+
/*
* As nested threaded IRQs are not automatically disabled during
* suspend, we must explicitly disable non-wakeup IRQs.
@@ -348,6 +351,9 @@ static int axp20x_pek_resume(struct device *dev)
{
struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev);

+ if (!axp20x_pek->input)
+ return 0;
+
if (device_may_wakeup(dev)) {
disable_irq_wake(axp20x_pek->irq_dbf);
disable_irq_wake(axp20x_pek->irq_dbr);
--
2.56.1.750.gf70dc682cf-goog