From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@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: Mon, 16 Nov 2026 16:43:10 +0100 [thread overview]
Message-ID: <0au3zkKrQ_KG8TbI4m_Fyg@gmail.com> (raw)
In-Reply-To: <9639a3578bf1cae847b4b0cdddd1a0e0@gmail.com>
Dne ponedeljek, 16. november 2026 ob 08:39:21 Srednjeevropski standardni čas je Dmitry Torokhov napisal(a):
> 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.
>
>
Makes sense, will do.
Best regards,
Jernej
next prev parent reply other threads:[~2026-11-16 15:43 UTC|newest]
Thread overview: 5+ 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
2026-11-16 15:43 ` Jernej Škrabec [this message]
2026-11-16 16:04 ` [PATCH v2] " Jernej Skrabec
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=0au3zkKrQ_KG8TbI4m_Fyg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.