From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: linux-i3c@lists.infradead.org, Frank.Li@kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v19 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
Date: Wed, 16 Sep 2026 07:17:34 +0000 [thread overview]
Message-ID: <20260916071734.8DE1E1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260916070728.1088801-6-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] regulator: p3h2x4x: unused fields and dead code in driver data
- [Low] mfd: driver-specific header placed in global include/linux/mfd/ directory
--
commit 24a75a3dc0fb9f5c1adccf0bcd6a9d774397dc1c
Author: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub
This commit adds a regulator driver for the on-die voltage regulators
integrated in the NXP P3H2x4x i3c hub family. It registers the regulators
via the MFD framework and standard regulator APIs.
> diff --git a/drivers/regulator/p3h2840_i3c_hub_regulator.c b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> new file mode 100644
> index 0000000000000..244f2a4f70f38
> --- /dev/null
> +++ b/drivers/regulator/p3h2840_i3c_hub_regulator.c
> @@ -0,0 +1,289 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright 2025-2026 NXP
> + * NXP P3H2X4X regulator driver file contain functions for enable/disable regulator
> + * and voltage set/get.
> + */
> +#include <linux/bitfield.h>
> +#include <linux/cleanup.h>
> +#include <linux/mfd/p3h2840.h>
^^^^^^^^^^^^^^^^^^^^^^^^^
[Severity: Low]
Is this driver-specific header used only by the parent and its immediate
children?
The MFD subsystem guidelines state that driver-specific header files should not
be placed in the global include/linux/mfd/ directory if they are only used
by the parent and its immediate children. Could this header be kept local to
drivers/mfd/ instead?
[ ... ]
> +#define P3H2X4X_VCCIO_LDO_CONF 0x16
> +#define P3H2X4X_CP0_VCCIO_LDO_VOLTAGE_MASK GENMASK(1, 0)
> +#define P3H2X4X_CP0_VCCIO_LDO_VOLTAGE(x) \
> + FIELD_PREP(P3H2X4X_CP0_VCCIO_LDO_VOLTAGE_MASK, x)
> +#define P3H2X4X_CP1_VCCIO_LDO_VOLTAGE_MASK GENMASK(3, 2)
> +#define P3H2X4X_CP1_VCCIO_LDO_VOLTAGE(x) \
> + FIELD_PREP(P3H2X4X_CP1_VCCIO_LDO_VOLTAGE_MASK, x)
> +#define P3H2X4X_TP0145_VCCIO_LDO_VOLTAGE_MASK GENMASK(5, 4)
> +#define P3H2X4X_TP0145_VCCIO_LDO_VOLTAGE(x) \
> + FIELD_PREP(P3H2X4X_TP0145_VCCIO_LDO_VOLTAGE_MASK, x)
> +#define P3H2X4X_TP2367_VCCIO_LDO_VOLTAGE_MASK GENMASK(7, 6)
> +#define P3H2X4X_TP2367_VCCIO_LDO_VOLTAGE(x) \
> + FIELD_PREP(P3H2X4X_TP2367_VCCIO_LDO_VOLTAGE_MASK, x)
[Severity: Low]
Are the P3H2X4X_*_VCCIO_LDO_VOLTAGE() macros used anywhere?
They appear to be defined using FIELD_PREP but never utilized in the driver
code, adding unnecessary complexity.
> +#define P3H2X4X_LDO_COUNT 4
> +#define P3H2X4X_LDO_ENABLE_TIME_US 5000
> +
> +struct p3h2x4x_regulator_dev {
> + struct regulator_dev *rp3h2x4x_dev[P3H2X4X_LDO_COUNT];
> + struct p3h2x4x *p3h2x4x;
> + struct regmap *regmap;
> +};
[Severity: Low]
Are the rp3h2x4x_dev and regmap fields needed in this structure?
During p3h2x4x_regulator_probe(), these fields are populated but they don't seem
to be read anywhere on any subsequent execution path. For example, regmap access
uses rdev->regmap directly from the regulator core. Could they be removed to
reduce memory overhead and driver data payload complexity?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916070728.1088801-1-lakshay.piplani@nxp.com?part=5
next prev parent reply other threads:[~2026-09-16 7:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 7:07 [PATCH v19 0/8] Add support for NXP P3H2x4x I3C hub driver Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 1/8] i3c: master: Add APIs for I3C hub support Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 2/8] i3c: master: Add controller-only device operation helpers Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 3/8] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Lakshay Piplani
2026-09-16 7:15 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 4/8] mfd: p3h2x4x: Add driver for NXP P3H2x4x i3c hub and on-die regulator Lakshay Piplani
2026-09-16 7:19 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub Lakshay Piplani
2026-09-16 7:17 ` sashiko-bot [this message]
2026-09-16 7:07 ` [PATCH v19 6/8] i3c: hub: Add support for the I3C interface in the I3C hub Lakshay Piplani
2026-09-16 7:21 ` sashiko-bot
2026-09-21 21:15 ` Alexandre Belloni
2026-09-16 7:07 ` [PATCH v19 7/8] i3c: hub: p3h2x4x: Add support for NXP P3H2x4x I3C hub functionality Lakshay Piplani
2026-09-16 7:22 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 8/8] i3c: hub: p3h2x4x: Add SMBus slave mode support Lakshay Piplani
2026-09-16 7:25 ` sashiko-bot
2026-09-22 7:26 ` [PATCH v19 0/8] Add support for NXP P3H2x4x I3C hub driver Lee Jones
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=20260916071734.8DE1E1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lakshay.piplani@nxp.com \
--cc=linux-i3c@lists.infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).