From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Chen-Yu Tsai <wens@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: axp20x-pek - support the AXP313A power key
Date: Sun, 15 Nov 2026 23:39:21 -0800 [thread overview]
Message-ID: <9639a3578bf1cae847b4b0cdddd1a0e0@gmail.com> (raw)
In-Reply-To: <20261115150903.16855-1-jernej.skrabec@gmail.com>
Hi Jernej,
On Sun, Nov 15, 2026 at 04:09:03PM +0100, Jernej Skrabec wrote:
> 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.
...
> +/* The AXP313A has no AXP20X_PEK_KEY register, so no timing controls. */
> +static const struct axp20x_info axp313a_info = { };
> +
> static ssize_t axp20x_show_attr(struct device *dev,
> const struct axp20x_time *time,
> unsigned int mask, char *buf)
> @@ -193,7 +196,26 @@ 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));
> +
> + if (attr == &dev_attr_startup.attr && !axp20x_pek->info->startup_time)
> + return 0;
> +
> + if (attr == &dev_attr_shutdown.attr && !axp20x_pek->info->shutdown_time)
> + return 0;
> +
> + return attr->mode;
> +}
axp20x_pek->info is only used by the startup and shutdown sysfs
attributes, and we do not have variants that support only one of them.
Can we drop the empty axp313a_info structure (leaving driver_data as 0
for "axp313a-pek") and simplify this to:
return axp20x_pek->info ? attr->mode : 0;
?
Thanks.
--
Dmitry
prev parent reply other threads:[~2026-11-16 7:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 15:09 [PATCH] Input: axp20x-pek - support the AXP313A power key Jernej Skrabec
2026-11-15 15:12 ` Chen-Yu Tsai
2026-11-16 7:39 ` Dmitry Torokhov [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=9639a3578bf1cae847b4b0cdddd1a0e0@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=jernej.skrabec@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