From: joy.zou@oss.nxp.com
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Frank Li <Frank.Li@nxp.com>, Bough Chen <haibo.chen@nxp.com>,
Peng Fan <peng.fan@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
Ye Li <ye.li@nxp.com>
Cc: Joy Zou <joy.zou@oss.nxp.com>,
imx@lists.linux.dev, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Joy Zou <joy.zou@nxp.com>
Subject: [PATCH v5 0/4] snvs_pwrkey - code improvements and add report event
Date: Wed, 15 Jul 2026 17:33:50 +0800 [thread overview]
Message-ID: <20260715-b4-pwrkey-v5-0-07e7353c319e@oss.nxp.com> (raw)
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
in the timer callback.
Signed-off-by: Joy Zou <joy.zou@oss.nxp.com>
---
Changes in v5:
- Replace SIMPLE_DEV_PM_OPS with DEFINE_SIMPLE_DEV_PM_OPS and remove
__maybe_unused from suspend/resume callbacks for patch #4.
- Use pm_ptr() to wrap pm_ops pointer in platform_driver for patch #4.
- Replace suspended flag check in interrupt handler with a pending_press
latch: set pending_press in hardirq context, consume and report the
press event from the timer callback in softirq context for patch #4.
- Link to v4: https://patch.msgid.link/20260618-b4-pwrkey-v4-0-4bfda105bdf3@oss.nxp.com
Changes in v4:
- Use dev_err_probe() for devm_input_allocate_device() to simplify error handling
for patch #1.
- Add Reviewed-by tag for patch #2 and #3.
- Modify the subject description for patch #2.
- Link to v3: https://patch.msgid.link/20260615-b4-pwrkey-v3-0-9510b1173f6e@oss.nxp.com
Changes in v3:
- Add spinlock for pdata->keystate and pdata->suspended per AI review comments.
- Replace hardcode value 1 with local variable keystate in input_report_key()
under suspended.
- Link to v2: https://lore.kernel.org/r/20260604-pwrkey-cleanup-v2-0-59fa0ddf0d7c@nxp.com
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@nxp.com
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Frank Li <Frank.Li@nxp.com>
To: Bough Chen <haibo.chen@nxp.com>
To: Peng Fan <peng.fan@nxp.com>
To: Jacky Bai <ping.bai@nxp.com>
To: Ye Li <ye.li@nxp.com>
Cc: imx@lists.linux.dev
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Joy Zou (4):
Input: snvs_pwrkey - make use of dev_err_probe()
Input: snvs_pwrkey - propagate error code of platform_get_irq()
Input: snvs_pwrkey - use local device pointer to simple code
Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend
drivers/input/keyboard/snvs_pwrkey.c | 143 ++++++++++++++++++++++++-----------
1 file changed, 98 insertions(+), 45 deletions(-)
---
base-commit: 34cf6dafc47441dfb6b356a095b89c3585a93714
change-id: 20260615-b4-pwrkey-a60b2043cd29
Best regards,
--
Joy Zou <joy.zou@oss.nxp.com>
next reply other threads:[~2026-07-15 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 9:33 joy.zou [this message]
2026-07-15 9:33 ` [PATCH v5 1/4] Input: snvs_pwrkey - make use of dev_err_probe() joy.zou
2026-07-15 9:33 ` [PATCH v5 2/4] Input: snvs_pwrkey - propagate error code of platform_get_irq() joy.zou
2026-07-15 9:33 ` [PATCH v5 3/4] Input: snvs_pwrkey - use local device pointer to simple code joy.zou
2026-07-15 9:33 ` [PATCH v5 4/4] Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend joy.zou
2026-07-15 16:01 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715-b4-pwrkey-v5-0-07e7353c319e@oss.nxp.com \
--to=joy.zou@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=dmitry.torokhov@gmail.com \
--cc=haibo.chen@nxp.com \
--cc=imx@lists.linux.dev \
--cc=joy.zou@nxp.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=ye.li@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®