Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jerome Brunet" <jbrunet@baylibre.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 2/4] mfd: axp20x: Add support for AXP318W PMIC
Date: Fri, 17 Jul 2026 09:02:08 +0000	[thread overview]
Message-ID: <20260717090209.2A09B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260717-axp318-regulator-v3-2-779dc1b97dd4@baylibre.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The newly added I2C device ID `axp318w` fails to use named initializers and omits the `.driver_data` field, resulting in it defaulting to `0` (`AXP152_ID`).
- [Medium] The MFD cell and resources for the power key (`axp20x-pek`) are completely omitted from `axp318_cells`, despite the commit message claiming to support it and IRQs being defined.
- [Low] The `axp318_cells` array uses a hard-coded ID of `1` for the regulator cell, which violates MFD subsystem guidelines and risks sysfs naming collisions.
--

--- Patch [2]: [PATCH v3 2/4] mfd: axp20x: Add support for AXP318W PMIC ---
commit c0a61d967fff87b52d26e4cb329e69e10684fb89
Author: Andre Przywara <andre.przywara@arm.com>

mfd: axp20x: Add support for AXP318W PMIC

This patch adds support for the AXP318W PMIC connected via I2C. It sets up
the regmap configurations, volatile ranges, interrupts, and registers the
MFD cells for the regulator devices.

> Describe the regmap and the MFD bits, along with the registers exposed
> via I2C only. This covers the regulator, interrupts and power key
> devices for now.

[Severity: Medium]
Is the power key device missing from the MFD cells array in this patch? The
commit message mentions it is covered, but there are no power key resources
or cells defined for the AXP318W.

> diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c
> index 5c93136f977e7..4e4ebfc78525c 100644
> --- a/drivers/mfd/axp20x-i2c.c
> +++ b/drivers/mfd/axp20x-i2c.c
> @@ -83,6 +84,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
>  	{ "axp221" },
>  	{ "axp223" },
>  	{ "axp313a" },
> +	{ "axp318w" },

[Severity: Medium]
Does this need named initializers to provide the .driver_data payload?

Without setting .driver_data like the of_device_id table does, won't this
default to 0, which is AXP152_ID? If this device is instantiated via legacy
I2C methods, device_get_match_data() might return AXP152_ID instead,
causing the driver to mistakenly configure it as an AXP152 variant.

> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
> index 679364189ea58..c8aeebd01bbcd 100644
> --- a/drivers/mfd/axp20x.c
> +++ b/drivers/mfd/axp20x.c
[ ... ]
> @@ -1061,6 +1129,10 @@ static struct mfd_cell axp313a_cells[] = {
>  	MFD_CELL_RES("axp313a-pek", axp313a_pek_resources),
>  };
>  
> +static const struct mfd_cell axp318_cells[] = {
> +	MFD_CELL_BASIC("axp20x-regulator", NULL, NULL, 0, 1),

[Severity: Low]
Should this use PLATFORM_DEVID_AUTO instead of a hard-coded ID of 1?

Assigning a hardcoded ID can lead to device naming collisions in sysfs if
multiple instances of the device are present.

> +};
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260717-axp318-regulator-v3-0-779dc1b97dd4@baylibre.com?part=2

  reply	other threads:[~2026-07-17  9:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17  8:44 [PATCH v3 0/4] regulator: Add X-Powers AXP318W PMIC support Jerome Brunet
2026-07-17  8:44 ` [PATCH v3 1/4] dt-bindings: mfd: x-powers,axp152: Document AXP318W Jerome Brunet
2026-07-17  8:44 ` [PATCH v3 2/4] mfd: axp20x: Add support for AXP318W PMIC Jerome Brunet
2026-07-17  9:02   ` sashiko-bot [this message]
2026-07-17  9:51     ` Jerome Brunet
2026-07-17  8:44 ` [PATCH v3 3/4] mfd: axp20x: constify axp313 and axp717 cells Jerome Brunet
2026-07-17  9:08   ` sashiko-bot
2026-07-17  8:44 ` [PATCH v3 4/4] regulator: axp20x: add support for the AXP318W Jerome Brunet
2026-07-17  9:18   ` sashiko-bot

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=20260717090209.2A09B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=robh@kernel.org \
    --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