[PATCH v2 0/4] snvs_pwrkey - code improvements and add report event

From: Joy Zou

Date: Thu Jun 04 2026 - 02:57:29 EST


This patch series improves the snvs_pwrkey driver with better code quality
and add report press event.

The main improvements include:
1. Clean up the code by using local device pointers and dev_err_probe() for
better readability and easier debugging.

2. Fix potential event loss during system suspend by reporting key press events
directly in the interrupt handler.

To: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
To: Frank Li <Frank.Li@xxxxxxx>
To: Peng Fan <peng.fan@xxxxxxx>
To: Jacky Bai <ping.bai@xxxxxxx>
To: Ye Li <ye.li@xxxxxxx>
Cc: imx@xxxxxxxxxxxxxxx
Cc: linux-input@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx

Signed-off-by: Joy Zou <joy.zou@xxxxxxx>
---
Changes in v2:
- Drop dev_err_probe() change for platform_get_irq() per AI review comments.
- Add new patch #2 replace hardcoding -EINVAL with original error code per
AI review comments.
- Use dev instead of &pdev->dev for devm_input_allocate_device(), which was
missed in patch v1 per AI review comments.
- Add a boolean variable suspended and PM callback functions to replace
the use of the is_suspended field per AI review comments.
- Move event report handle to else branch in suspended state, since the
pdata->minor_rev == 0 branch has no debounce detection per AI review
comments.
- Modify patch #3 and #4 commit message.
- Add Reviewed-by tag for patch #1.
- Link to v1: https://lore.kernel.org/r/20260326-pwrkey-cleanup-v1-0-d85d7c0bf275@xxxxxxx

---
Joy Zou (4):
Input: snvs_pwrkey - make use of dev_err_probe()
Input: snvs_pwrkey - replace hardcoding -EINVAL with original error code
Input: snvs_pwrkey - use local device pointer to simple code
Input: snvs_pwrkey - report press event in interrupt handler

drivers/input/keyboard/snvs_pwrkey.c | 102 ++++++++++++++++++++++-------------
1 file changed, 64 insertions(+), 38 deletions(-)
---
base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
change-id: 20260326-pwrkey-cleanup-99d3de61ed6d

Best regards,
--
Joy Zou <joy.zou@xxxxxxx>