Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Molnár Máté" <matemolnar88@gmail.com>
Cc: devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	mfd@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org,
	dmitry.torokhov@gmail.com, lee@kernel.org
Subject: Re: [PATCH v7 3/9] regulator: axp20x: Add support for AXP192
Date: Sun, 06 Dec 2026 03:22:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-252116@kernel.org> (raw)
In-Reply-To: <20261206-axp192-v7-3-0200fc77da53@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] regulator: axp20x: AXP192 LDO_IO0 range overflows 4-bit
  vsel_mask
- [Medium] regulator: axp20x: AXP192 ldoin-supply and dcdc-freq conflict
  with DT binding
--

commit 0cc2f3cfe23f4355e786325437951c33f7ce7afb
Author: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>

regulator: axp20x: Add support for AXP192

This commit adds regulator support for the AXP192 PMIC to the axp20x
regulator driver, including regulator descriptors, DCDC2 ramp delay,
DCDC frequency, and DCDC workmode configuration.

> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index 53b1e0499c00a..efd4a3bc35d39 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c

[ ... ]

> +#define AXP192_LDO_IO0_V_OUT_MASK	GENMASK(7, 4)

[ ... ]

> @@ -596,6 +627,29 @@ static const struct regulator_ops axp20x_ops_sw = {
>  	.is_enabled		= regulator_is_enabled_regmap,
>  };
>  
> +static const struct regulator_desc axp192_regulators[] = {
> +	AXP_DESC(AXP192, DCDC1, "dcdc1", "vin1", 700, 3500, 25,
> +		 AXP192_DCDC1_V_OUT, AXP192_DCDC1_V_OUT_MASK,
> +		 AXP192_PWR_OUT_CTRL, AXP192_PWR_OUT_DCDC1_MASK),
> +	AXP_DESC(AXP192, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
> +		 AXP192_DCDC2_V_OUT, AXP192_DCDC2_V_OUT_MASK,
> +		 AXP192_PWR_OUT_CTRL, AXP192_PWR_OUT_DCDC2_MASK),
> +	AXP_DESC(AXP192, DCDC3, "dcdc3", "vin3", 700, 3500, 25,
> +		 AXP192_DCDC3_V_OUT, AXP192_DCDC3_V_OUT_MASK,
> +		 AXP192_PWR_OUT_CTRL, AXP192_PWR_OUT_DCDC3_MASK),
> +	AXP_DESC_FIXED(AXP192, LDO1, "ldo1", "acin", 1250),
> +	AXP_DESC(AXP192, LDO2, "ldo2", "ldoin", 1800, 3300, 100,
> +		 AXP192_LDO2_3_V_OUT, AXP192_LDO2_V_OUT_MASK,
> +		 AXP192_PWR_OUT_CTRL, AXP192_PWR_OUT_LDO2_MASK),
> +	AXP_DESC(AXP192, LDO3, "ldo3", "ldoin", 1800, 3300, 100,
> +		 AXP192_LDO2_3_V_OUT, AXP192_LDO3_V_OUT_MASK,
> +		 AXP192_PWR_OUT_CTRL, AXP192_PWR_OUT_LDO3_MASK),
> +	AXP_DESC_IO(AXP192, LDO_IO0, "ldo_io0", "ips", 700, 3300, 100,
> +		    AXP192_LDO_IO0_V_OUT, AXP192_LDO_IO0_V_OUT_MASK,
> +		    AXP192_GPIO0_CTRL, AXP192_GPIO0_FUNC_MASK,
> +		    AXP192_IO_ENABLED, AXP192_IO_DISABLED),
> +};

[Severity: High]
Does the 700 to 3300 mV range for AXP192_LDO_IO0 overflow the 4-bit
AXP192_LDO_IO0_V_OUT_MASK?

AXP_DESC_IO() gives 27 voltages (selectors 0..26) in 100 mV steps, while
GENMASK(7, 4) holds only 0..15.  regulator_set_voltage_sel_regmap()
shifts selectors 16..26 past bit 7, so regmap_update_bits() truncates
them and wraps 2300..3300 mV back to selectors 0..10.

Register 0x91 bits 7:4 encode 1800..3300 mV (like AXP20X_LDO5), so
selectors 0..15 also output 1100 mV more than requested, risking
overvoltage on attached peripherals.  Should the minimum voltage be
1800 mV instead?

[ ... ]

> @@ -1314,6 +1368,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
>  	u32 min, max, def, step;
>  
>  	switch (axp20x->variant) {
> +	case AXP192_ID:
> +		min = 900;
> +		max = 2025;
> +		def = 1500;
> +		step = 75;
> +		break;

[Severity: Medium]
Do the AXP192 DCDC frequency range and ldoin-supply conflict with
Documentation/devicetree/bindings/mfd/x-powers,axp152.yaml?

The binding puts x-powers,axp192 in the else branch of its allOf rule
for x-powers,dcdc-freq (1800..4050 kHz, default 3000 kHz), which rejects
values below 1800 kHz including the 1500 kHz default and allows values
above 2025 kHz that axp20x_set_dcdc_freq() clamps with a warning.

In axp192_regulators[], LDO2 and LDO3 also expect an ldoin-supply
property that is absent from the binding while additionalProperties is
false, causing dtbs_check failures for AXP192 boards.

The binding also omits x-powers,axp192 from the x-powers,drive-vbus-en
disallow list and the regulator-ramp-delay description.  Should the
binding be updated alongside this driver change?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261206-axp192-v7-0-0200fc77da53@gmail.com?part=3

  reply	other threads:[~2026-12-06  3:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  3:08 [PATCH v7 0/9] Add the remaining AXP192 PMIC support Molnár Máté via B4 Relay
2026-12-06  3:08 ` [PATCH v7 1/9] dt-bindings: iio: adc: axp209: Add AXP192 compatible Molnár Máté via B4 Relay
2026-12-06  3:08 ` [PATCH v7 2/9] dt-bindings: power: axp20x-battery: " Molnár Máté via B4 Relay
2026-12-06  3:08 ` [PATCH v7 3/9] regulator: axp20x: Add support for AXP192 Molnár Máté via B4 Relay
2026-12-06  3:22   ` sashiko-bot [this message]
2026-12-06  3:08 ` [PATCH v7 4/9] power: axp20x_battery: Add constant charge current table Molnár Máté via B4 Relay
2026-12-06  3:24   ` sashiko-bot
2026-12-06  3:08 ` [PATCH v7 5/9] power: axp20x_battery: Support battery status without fuel gauge Molnár Máté via B4 Relay
2026-12-06  3:23   ` sashiko-bot
2026-12-06  3:08 ` [PATCH v7 6/9] power: axp20x_battery: Add support for AXP192 Molnár Máté via B4 Relay
2026-12-06  3:08 ` [PATCH v7 7/9] power: axp20x_battery: Estimate AXP192 capacity from the OCV table Molnár Máté via B4 Relay
2026-12-06  3:24   ` sashiko-bot
2026-12-06  3:09 ` [PATCH v7 8/9] Input: axp20x-pek: Add AXP192 support Molnár Máté via B4 Relay
2026-12-06  3:21   ` sashiko-bot
2026-12-06  3:09 ` [PATCH v7 9/9] mfd: axp20x: Add the AXP192 power key cell Molnár Máté via B4 Relay
2026-12-06  3: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=sashiko-outbox-252116@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=matemolnar88@gmail.com \
    --cc=mfd@lists.linux.dev \
    --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