* [PATCH v2 0/4] Configure SYR82X regulator modes via device tree
@ 2026-07-20 10:03 Victor Krawiec
2026-07-20 10:03 ` [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes Victor Krawiec
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Victor Krawiec @ 2026-07-20 10:03 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
SYR82X is a regulator that supports two modes of operation:
- Auto-PFM: Allow automatic PFM during light load (default mode)
- Forced PWM
Some boards require to configure forced PWM mode from device tree to keep
the supply ripple within acceptable limits under light load conditions.
SYR82X is a clone of FAN53555 regulator and its configuration is handled by
the fcs,fan53555 driver. All clones of FAN53555 regulator share the same two
mode of operation (Auto-PFM / Forced PWM).
However the implementation in the driver is currently restricted to SYR82X
as it is the only tested hardware.
---
V1 -> V2:
- Add missing dt binding property description
- Naming changes since all clones handled by the fan53555 driver share
the same two modes
- dt binding header name changed from silergy,syr82x.h to
fcs,fan53555-regulator.h
- dt binding header constants changed from SYR82X_* to FAN53555_*
- fan53555_silergy_map_mode() changed to fan53555_map_mode()
- More detailed commit descriptions
Victor Krawiec (4):
regulator: dt-bindings: Add fan53555 allowed modes
arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants
for SYR828 regulator initial mode
arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator
initial mode to use device tree bindings constants
regulator: fan53555: Add support for mode operations on Silergy
devices
.../bindings/regulator/fcs,fan53555.yaml | 8 +++++
.../boot/dts/rockchip/rk3399-hugsun-x99.dts | 3 +-
.../boot/dts/rockchip/rk3399-rock-4c-plus.dts | 3 +-
drivers/regulator/fan53555.c | 29 ++++++++++++++++++-
.../regulator/fcs,fan53555-regulator.h | 20 +++++++++++++
5 files changed, 60 insertions(+), 3 deletions(-)
create mode 100644 include/dt-bindings/regulator/fcs,fan53555-regulator.h
base-commit: 62b9452f5fc4d007f1ea31cfdbb53a96d91e3c66
--
2.43.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes
2026-07-20 10:03 [PATCH v2 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
@ 2026-07-20 10:03 ` 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
` (2 subsequent siblings)
3 siblings, 2 replies; 9+ messages in thread
From: Victor Krawiec @ 2026-07-20 10:03 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
Fairchild FAN53555 and its clone from Rockchip, Silergy and TCS support
two modes of operation:
- Auto-PFM: Allow automatic PFM during light load (default mode)
- Forced PWM
Some boards require forced PWM mode to keep the supply ripple within
acceptable limits under light load conditions.
Regulator mode indexes are starting from 1 to keep backward compatibility
with existing device trees
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml # new file:
include/dt-bindings/regulator/fcs,fan53555-regulator.h #
arch/arm64/boot/dts/rockchip/rk3399-drumfreak.dts #
arch/arm64/boot/simple-boot.img # arch/arm64/boot/simple-kernel.img #
arch/arm64/configs/drumfreak_defconfig #
scripts/arturia_simple_boot_image.sh #
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
---
.../bindings/regulator/fcs,fan53555.yaml | 8 ++++++++
.../regulator/fcs,fan53555-regulator.h | 20 +++++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 include/dt-bindings/regulator/fcs,fan53555-regulator.h
diff --git a/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml b/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
index 69bae90fc4b2..9a18891f721e 100644
--- a/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
+++ b/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
@@ -48,6 +48,12 @@ properties:
VSEL0 register. When this pin is HIGH, VOUT is set by the VSEL1 register.
maxItems: 1
+ regulator-initial-mode:
+ enum:
+ [ 1, 2 ]
+ description:
+ Defined in include/dt-bindings/regulator/fcs,fan53555-regulator.h
+
required:
- compatible
- reg
@@ -56,6 +62,7 @@ unevaluatedProperties: false
examples:
- |
+ #include <dt-bindings/regulator/fcs,fan53555-regulator.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
@@ -68,6 +75,7 @@ examples:
regulator-max-microvolt = <1800000>;
vin-supply = <&parent_reg>;
fcs,suspend-voltage-selector = <1>;
+ regulator-initial-mode = <FAN53555_REGULATOR_MODE_FORCE_PWM>;
};
};
...
diff --git a/include/dt-bindings/regulator/fcs,fan53555-regulator.h b/include/dt-bindings/regulator/fcs,fan53555-regulator.h
new file mode 100644
index 000000000000..ce3d6c63a0f1
--- /dev/null
+++ b/include/dt-bindings/regulator/fcs,fan53555-regulator.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2026 Arturia - All rights reserved.
+ *
+ * Device Tree binding constants for the FAN53555 PMIC regulator
+ */
+
+#ifndef _DT_BINDINGS_REGULATOR_FAN53555_H
+#define _DT_BINDINGS_REGULATOR_FAN53555_H
+
+/*
+ * Constants to specify regulator modes in device tree for SYR82X regulators
+ * FAN53555_REGULATOR_MODE_FORCE_PWM: Force fixed PWM mode
+ * FAN53555_REGULATOR_MODE_AUTO: Allow auto-PFM mode during light load
+ */
+
+#define FAN53555_REGULATOR_MODE_FORCE_PWM 1
+#define FAN53555_REGULATOR_MODE_AUTO 2
+
+#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode
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:03 ` Victor Krawiec
2026-07-20 10:11 ` sashiko-bot
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
3 siblings, 1 reply; 9+ messages in thread
From: Victor Krawiec @ 2026-07-20 10:03 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
Prefer using a device tree bindings constant over a hardcoded value
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
---
arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
index d9ff777b4913..0387172cb470 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
@@ -7,6 +7,7 @@
/dts-v1/;
#include <dt-bindings/leds/common.h>
+#include <dt-bindings/regulator/fcs,fan53555-regulator.h>
#include "rk3399-t.dtsi"
/ {
@@ -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>;
regulator-state-mem {
regulator-off-in-suspend;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants
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: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:03 ` Victor Krawiec
2026-07-20 10:03 ` [PATCH v2 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
3 siblings, 0 replies; 9+ messages in thread
From: Victor Krawiec @ 2026-07-20 10:03 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
Prefer using a device tree bindings constant over a hardcoded value
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
---
arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
index 352c8efb37e0..a2b7bab63553 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-hugsun-x99.dts
@@ -3,6 +3,7 @@
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/regulator/fcs,fan53555-regulator.h>
#include "rk3399.dtsi"
/ {
@@ -237,7 +238,7 @@ vdd_gpu: syr828@41 {
regulator-always-on;
regulator-boot-on;
vin-supply = <&vcc_sys>;
- regulator-initial-mode = <1>;
+ regulator-initial-mode = <FAN53555_REGULATOR_MODE_FORCE_PWM>;
regulator-state-mem {
regulator-off-in-suspend;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 4/4] regulator: fan53555: Add support for mode operations on Silergy devices
2026-07-20 10:03 [PATCH v2 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
` (2 preceding siblings ...)
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 ` Victor Krawiec
2026-07-20 10:16 ` sashiko-bot
3 siblings, 1 reply; 9+ messages in thread
From: Victor Krawiec @ 2026-07-20 10:03 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
Make the PWM mode configurable from devicetree. Some boards require forced
PWM mode to keep the supply ripple within acceptable limits under light
load conditions
Support is restricted to Silergy manufacturer as it is the only one
currently tested.
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
---
drivers/regulator/fan53555.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index c282236959b1..85f46874eb49 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -21,6 +21,7 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/slab.h>
+#include <dt-bindings/regulator/fcs,fan53555-regulator.h>
/* Voltage setting */
#define FAN53555_VSEL0 0x00
@@ -389,6 +390,18 @@ static int rk8602_voltages_setup_rockchip(struct fan53555_device_info *di)
return 0;
}
+static inline unsigned int fan53555_map_mode(unsigned int mode)
+{
+ switch (mode) {
+ case FAN53555_REGULATOR_MODE_FORCE_PWM:
+ return REGULATOR_MODE_FAST;
+ case FAN53555_REGULATOR_MODE_AUTO:
+ return REGULATOR_MODE_NORMAL;
+ default:
+ return REGULATOR_MODE_INVALID;
+ }
+}
+
static int fan53555_voltages_setup_silergy(struct fan53555_device_info *di)
{
/* Init voltage range and step */
@@ -586,6 +599,17 @@ static int fan53555_device_setup(struct fan53555_device_info *di,
return ret;
}
+static void fan53555_device_mode_map_setup(struct fan53555_device_info *di)
+{
+ switch (di->vendor) {
+ case FAN53555_VENDOR_SILERGY:
+ di->desc.of_map_mode = fan53555_map_mode;
+ break;
+ default:
+ break;
+ }
+}
+
static int fan53555_regulator_register(struct fan53555_device_info *di,
struct regulator_config *config)
{
@@ -686,6 +710,10 @@ static int fan53555_regulator_probe(struct i2c_client *client)
if (!di)
return -ENOMEM;
+ di->vendor = (uintptr_t)i2c_get_match_data(client);
+
+ fan53555_device_mode_map_setup(di);
+
pdata = dev_get_platdata(&client->dev);
if (!pdata)
pdata = fan53555_parse_dt(&client->dev, np, &di->desc);
@@ -695,7 +723,6 @@ static int fan53555_regulator_probe(struct i2c_client *client)
"Platform data not found!\n");
di->regulator = pdata->regulator;
- di->vendor = (uintptr_t)i2c_get_match_data(client);
if (!dev_fwnode(&client->dev)) {
/* if no ramp constraint set, get the pdata ramp_delay */
if (!di->regulator->constraints.ramp_delay) {
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode
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
0 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-07-20 10:11 UTC (permalink / raw)
To: Victor Krawiec; +Cc: robh, conor+dt, devicetree
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes
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
1 sibling, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-07-20 10:12 UTC (permalink / raw)
To: Victor Krawiec; +Cc: robh, conor+dt, devicetree
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
New issues:
- [High] The regulator driver lacks the `.of_map_mode` callback required to parse the newly added `regulator-initial-mode` device tree property.
- [High] The patch is missing the board and script modifications explicitly listed in the commit message, and includes raw `git status` output.
- [Medium] The schema fails to constrain the `regulator-allowed-modes` property despite the commit explicitly claiming to add allowed modes.
Pre-existing issues:
- [High] The driver's `fan53555_set_mode()` function accidentally writes to the voltage register (`vol_reg`) instead of the mode register (`mode_reg`) when switching to `REGULATOR_MODE_NORMAL`.
--
--- Patch [1]: [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes ---
commit 6198556f842d1d3f4521256414c33ff637d763cb
Author: Victor Krawiec <victor.krawiec@arturia.com>
regulator: dt-bindings: Add fan53555 allowed modes
This commit adds device tree binding definitions for the FAN53555 regulator's
operational modes (Auto-PFM and Forced PWM). It introduces a new header file
with mode constants and updates the YAML schema to allow specifying an initial
mode.
> Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml # new file:
> include/dt-bindings/regulator/fcs,fan53555-regulator.h #
> arch/arm64/boot/dts/rockchip/rk3399-drumfreak.dts #
> arch/arm64/boot/simple-boot.img # arch/arm64/boot/simple-kernel.img #
> arch/arm64/configs/drumfreak_defconfig #
> scripts/arturia_simple_boot_image.sh #
[Severity: High]
Are these files intentionally missing from the diff? The commit message lists
several board and script files, as well as driver implementation details, but
they are not included in the patch. It looks like accidental output from git
status was included in the commit message, and the patch submission might be
incomplete.
> diff --git a/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml b/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
> index 69bae90fc4b28..9a18891f721e6 100644
> --- a/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
> +++ b/Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml
> @@ -48,6 +48,12 @@ properties:
> VSEL0 register. When this pin is HIGH, VOUT is set by the VSEL1 register.
> maxItems: 1
>
> + regulator-initial-mode:
> + enum:
> + [ 1, 2 ]
[Severity: Medium]
The commit message mentions adding allowed modes, but the schema only constrains
regulator-initial-mode. Should regulator-allowed-modes also be added to the
schema with constraints?
Without it, dt_binding_check will permit any values for regulator-allowed-modes
since it falls back to the generic uint32-array schema.
> + description:
> + Defined in include/dt-bindings/regulator/fcs,fan53555-regulator.h
[ ... ]
While reviewing the proposed bindings, I noticed a couple of issues in the
corresponding driver implementation in drivers/regulator/fan53555.c.
drivers/regulator/fan53555.c:fan53555_regulator_register() {
...
rdesc->ops = &fan53555_regulator_ops;
rdesc->type = REGULATOR_VOLTAGE;
...
}
[Severity: High]
Does the driver need an .of_map_mode callback assigned to the regulator_desc?
Without this callback, the regulator core cannot parse regulator-initial-mode
during probe, and will silently ignore the property with a warning.
This is a pre-existing issue, but while reviewing the mode switching logic
that these bindings interact with:
drivers/regulator/fan53555.c:fan53555_set_mode() {
...
case REGULATOR_MODE_NORMAL:
regmap_update_bits(rdev->regmap, di->vol_reg, di->mode_mask, 0);
break;
...
}
[Severity: High]
Does this mistakenly write to di->vol_reg instead of di->mode_reg?
On variants like the TCS4525 where di->mode_mask is BIT(7) or BIT(6), clearing
this bit in the voltage register clears VSEL_BUCK_EN. This would unexpectedly
turn off the regulator instead of changing its mode.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720100336.62004-1-victor.krawiec@arturia.com?part=1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 4/4] regulator: fan53555: Add support for mode operations on Silergy devices
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
0 siblings, 0 replies; 9+ messages in thread
From: sashiko-bot @ 2026-07-20 10:16 UTC (permalink / raw)
To: Victor Krawiec; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] fan53555_set_mode() incorrectly updates the voltage register instead of the mode register when setting REGULATOR_MODE_NORMAL, causing severe voltage corruption on chips where these registers are distinct.
--
--- Patch [4]: [PATCH v2 4/4] regulator: fan53555: Add support for mode operations on Silergy devices ---
commit 4b739645e4ed09b01a00b9bb826b1cf9a4da63a8
Author: Victor Krawiec <victor.krawiec@arturia.com>
regulator: fan53555: Add support for mode operations on Silergy devices
This commit makes the PWM mode configurable from devicetree for Silergy
devices. It adds a mapping function for devicetree mode flags to regulator
modes, allowing boards to force PWM mode to manage supply ripple.
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index c282236959b18..85f46874eb49d 100644
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
[ ... ]
> @@ -389,6 +390,18 @@ static int rk8602_voltages_setup_rockchip(struct fan53555_device_info *di)
> return 0;
> }
>
> +static inline unsigned int fan53555_map_mode(unsigned int mode)
> +{
> + switch (mode) {
> + case FAN53555_REGULATOR_MODE_FORCE_PWM:
> + return REGULATOR_MODE_FAST;
> + case FAN53555_REGULATOR_MODE_AUTO:
> + return REGULATOR_MODE_NORMAL;
[Severity: High]
This isn't a bug introduced by this patch, but mapping to REGULATOR_MODE_NORMAL
exposes a pre-existing issue in fan53555_set_mode().
When REGULATOR_MODE_NORMAL is selected, fan53555_set_mode() updates di->vol_reg
instead of di->mode_reg:
fan53555_set_mode() {
...
case REGULATOR_MODE_NORMAL:
regmap_update_bits(rdev->regmap, di->vol_reg, di->mode_mask, 0);
break;
...
}
On chips where the mode register and voltage register are distinct (such as
RK8602, FAN53526, or TCS), clearing di->mode_mask inside di->vol_reg corrupts
the voltage selection bits. This can cause a sudden, unintended drop in output
voltage leading to a system lockup.
Is it possible to correct the register used in fan53555_set_mode() before
enabling this mode mapping?
> + default:
> + return REGULATOR_MODE_INVALID;
> + }
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720100336.62004-1-victor.krawiec@arturia.com?part=4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/4] regulator: dt-bindings: Add fan53555 allowed modes
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
1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-21 8:29 UTC (permalink / raw)
To: Victor Krawiec
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, linux-kernel,
devicetree
On Mon, Jul 20, 2026 at 12:03:33PM +0200, Victor Krawiec wrote:
> Fairchild FAN53555 and its clone from Rockchip, Silergy and TCS support
> two modes of operation:
> - Auto-PFM: Allow automatic PFM during light load (default mode)
> - Forced PWM
>
> Some boards require forced PWM mode to keep the supply ripple within
> acceptable limits under light load conditions.
>
> Regulator mode indexes are starting from 1 to keep backward compatibility
> with existing device trees
>
> Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
SoB here...
>
> Documentation/devicetree/bindings/regulator/fcs,fan53555.yaml # new file:
> include/dt-bindings/regulator/fcs,fan53555-regulator.h #
> arch/arm64/boot/dts/rockchip/rk3399-drumfreak.dts #
> arch/arm64/boot/simple-boot.img # arch/arm64/boot/simple-kernel.img #
> arch/arm64/configs/drumfreak_defconfig #
> scripts/arturia_simple_boot_image.sh #
Looks random paste/mistake...
>
> Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
but also here SoB.
Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-07-21 8:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox