Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Victor Krawiec" <victor.krawiec@arturia.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode
Date: Mon, 20 Jul 2026 10:11:18 +0000	[thread overview]
Message-ID: <20260720101119.65AA21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260720100336.62004-3-victor.krawiec@arturia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The fan53555 regulator driver lacks an `of_map_mode` callback, causing the `regulator-initial-mode` device tree property to be ignored.
--

--- Patch [2]: [PATCH v2 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode ---
commit bd8e5b9ed62ff2e741725d000597a403df903434
Author: Victor Krawiec <victor.krawiec@arturia.com>

arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode

This patch updates the device tree to prefer using a bindings constant
over a hardcoded value for the regulator initial mode.

> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
> --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
> @@ -448,7 +449,7 @@ vdd_gpu: regulator@41 {
>  		regulator-always-on;
>  		regulator-boot-on;
>  		vin-supply = <&vcc5v0_sys>;
> -		regulator-initial-mode = <1>; /* 1:force PWM 2:auto */
> +		regulator-initial-mode = <FAN53555_REGULATOR_MODE_FORCE_PWM>;

[Severity: High]
This is a pre-existing issue, but does the underlying fan53555 regulator
driver actually support mapping this property?

Looking at the driver initialization in fan53555_regulator_register(), the
regulator_desc lacks an of_map_mode callback:

drivers/regulator/fan53555.c:fan53555_regulator_register() {
    ...
	rdesc->ops = &fan53555_regulator_ops;
	rdesc->type = REGULATOR_VOLTAGE;
    ...
}

When the regulator core parses this device tree property, it requires that
callback to translate the value:

drivers/regulator/of_regulator.c:of_get_regulation_constraints() {
    ...
		if (desc && desc->of_map_mode) {
			mode = desc->of_map_mode(pval);
			if (mode == REGULATOR_MODE_INVALID)
				pr_err("%pOFn: invalid mode %u\n", np, pval);
			else
				constraints->initial_mode = mode;
		} else {
			pr_warn("%pOFn: mapping for mode %d not defined\n",
				np, pval);
		}
    ...
}

Without the callback, constraints->initial_mode is never populated, a warning
is printed, and the hardware defaults to its reset mode (Auto-PFM) instead of
the requested Forced PWM mode. Could failing to apply the Forced PWM mode lead
to hardware instability or crashes under light load conditions?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260720100336.62004-1-victor.krawiec@arturia.com?part=2

  reply	other threads:[~2026-07-20 10:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 10:03 [PATCH v2 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
2026-07-20 10:03 ` [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes Victor Krawiec
2026-07-20 10:12   ` sashiko-bot
2026-07-21  8:29   ` Krzysztof Kozlowski
2026-07-20 10:03 ` [PATCH v2 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode Victor Krawiec
2026-07-20 10:11   ` sashiko-bot [this message]
2026-07-20 10:03 ` [PATCH v2 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants Victor Krawiec
2026-07-20 10:03 ` [PATCH v2 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
2026-07-20 10:16   ` 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=20260720101119.65AA21F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=victor.krawiec@arturia.com \
    /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