From: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Chen-Yu Tsai <wens@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: [PATCH v2] Input: axp20x-pek - support the AXP313A power key
Date: Mon, 16 Nov 2026 17:04:23 +0100 [thread overview]
Message-ID: <20261116160423.39752-1-jernej.skrabec@gmail.com> (raw)
In-Reply-To: <20261115150903.16855-1-jernej.skrabec@gmail.com>
The AXP313A MFD cell is registered as "axp313a-pek", which this driver
doesn't match, so the power key doesn't work on boards with this PMIC.
Match it as well. The AXP313A has no AXP20X_PEK_KEY register, so leave
its driver_data empty and hide the startup and shutdown attributes on
PMICs without timing info.
Acked-by: Chen-Yu Tsai <wens@kernel.org>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
Changes in v2:
- Drop empty axp313a_info and check for NULL info instead (Dmitry)
- Collect Chen-Yu's Acked-by
- Link to v1: https://lore.kernel.org/linux-input/20261115150903.16855-1-jernej.skrabec@gmail.com/
drivers/input/misc/axp20x-pek.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
index c34e002258ee..040aec5f9e4c 100644
--- a/drivers/input/misc/axp20x-pek.c
+++ b/drivers/input/misc/axp20x-pek.c
@@ -193,7 +193,20 @@ static struct attribute *axp20x_attrs[] = {
&dev_attr_shutdown.attr,
NULL,
};
-ATTRIBUTE_GROUPS(axp20x);
+
+static umode_t axp20x_attr_is_visible(struct kobject *kobj,
+ struct attribute *attr, int n)
+{
+ struct axp20x_pek *axp20x_pek = dev_get_drvdata(kobj_to_dev(kobj));
+
+ return axp20x_pek->info ? attr->mode : 0;
+}
+
+static const struct attribute_group axp20x_group = {
+ .attrs = axp20x_attrs,
+ .is_visible = axp20x_attr_is_visible,
+};
+__ATTRIBUTE_GROUPS(axp20x);
static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
{
@@ -392,6 +405,10 @@ static const struct platform_device_id axp_pek_id_match[] = {
.name = "axp221-pek",
.driver_data = (kernel_ulong_t)&axp221_info,
},
+ {
+ /* No AXP20X_PEK_KEY register, so no timing controls. */
+ .name = "axp313a-pek",
+ },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(platform, axp_pek_id_match);
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0
prev parent reply other threads:[~2026-11-16 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 15:09 [PATCH] " Jernej Skrabec
2026-11-15 15:12 ` Chen-Yu Tsai
2026-11-16 7:39 ` Dmitry Torokhov
2026-11-16 15:43 ` Jernej Škrabec
2026-11-16 16:04 ` Jernej Skrabec [this message]
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=20261116160423.39752-1-jernej.skrabec@gmail.com \
--to=jernej.skrabec@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wens@kernel.org \
/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®