linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Vladimir <anykey196@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] Input: axp20x-pek - add AXP313a support
Date: Wed, 23 Sep 2026 11:02:36 +0000	[thread overview]
Message-ID: <20260923110236.CA7FB1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923105215.1633-1-anykey196@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] sysfs: broken startup/shutdown attributes for axp313a
--

commit 2573be3a312f98b032ff9523708d368661f8e004
Author: Vladnwx <vladnwx@users.noreply.github.com>

Input: axp20x-pek - add AXP313a support

The AXP313a MFD driver registers its power button cell as "axp313a-pek",
but the axp20x-pek platform id table only matches "axp20x-pek" and
"axp221-pek". The power button therefore never probes on boards using the
AXP313a PMIC (e.g. the OrangePi Zero 2W).

> diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
> index 24f9e9d893de3..d4e2fc9a937ff 100644
> --- a/drivers/input/misc/axp20x-pek.c
> +++ b/drivers/input/misc/axp20x-pek.c
> @@ -393,6 +393,10 @@ static const struct platform_device_id axp_pek_id_match[] = {
>  		.name = "axp221-pek",
>  		.driver_data = (kernel_ulong_t)&axp221_info,
>  	},
> +	{
> +		.name = "axp313a-pek",
> +		.driver_data = (kernel_ulong_t)&axp20x_info,
> +	},

[Severity: Medium]
Will using axp20x_info result in broken sysfs attributes for AXP313a?

The AXP313a platform binding unconditionally exposes startup and shutdown
sysfs files because they are hardcoded in axp20x_groups. Reading or writing
these files attempts to access the AXP20X_PEK_KEY register (0x36) in
axp20x_show_attr() and axp20x_store_attr():

drivers/input/misc/axp20x-pek.c:axp20x_show_attr() {
	...
	ret = regmap_read(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY, &val);
	...
}

drivers/input/misc/axp20x-pek.c:axp20x_store_attr() {
	...
	ret = regmap_update_bits(axp20x_pek->axp20x->regmap, AXP20X_PEK_KEY,
				 mask, idx);
	...
}

However, the AXP313a regmap configuration restricts max_register to
AXP313A_IRQ_STATE (0x21). The regmap core blocks accesses to registers beyond
max_register, meaning these sysfs accesses will definitively fail with -EIO.

Could the axp313a-pek driver be updated to avoid exposing these broken sysfs
attributes?

>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(platform, axp_pek_id_match);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923105215.1633-1-anykey196@gmail.com?part=1

  reply	other threads:[~2026-09-23 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 10:52 [PATCH] Input: axp20x-pek - add AXP313a support Vladimir
2026-09-23 11:02 ` sashiko-bot [this message]
     [not found]   ` <CANHPwASJBzich3-2QV3FNNdKX+GHQGe2FuFWu2CUXCYya=-1zA@mail.gmail.com>
2026-09-23 11:22     ` Влад СВН
2026-09-23 11:26   ` Влад СВН
  -- strict thread matches above, loose matches on Subject: below --
2026-09-23 10:57 Vladimir
2026-09-23 11:07 ` sashiko-bot
2026-09-23 11:23   ` Влад СВН
2026-09-23 11:27   ` Влад СВН

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=20260923110236.CA7FB1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=anykey196@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).