* [PATCH 0/4] Configure SYR82X regulator modes via device tree
@ 2026-07-15 15:51 Victor Krawiec
2026-07-15 15:51 ` [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes Victor Krawiec
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Victor Krawiec @ 2026-07-15 15:51 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt
Cc: linux-kernel, devicetree, Victor Krawiec
Some boards require forced PWM mode to keep the supply ripple within
acceptable limits under light load conditions
Victor Krawiec (4):
regulator: dt-bindings: Add Silergy SYR82X 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
.../boot/dts/rockchip/rk3399-hugsun-x99.dts | 3 +-
.../boot/dts/rockchip/rk3399-rock-4c-plus.dts | 3 +-
drivers/regulator/fan53555.c | 29 ++++++++++++++++++-
.../dt-bindings/regulator/silergy,syr82x.h | 20 +++++++++++++
4 files changed, 52 insertions(+), 3 deletions(-)
create mode 100644 include/dt-bindings/regulator/silergy,syr82x.h
base-commit: 62b9452f5fc4d007f1ea31cfdbb53a96d91e3c66
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-15 15:51 [PATCH 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
@ 2026-07-15 15:51 ` Victor Krawiec
2026-07-15 16:02 ` sashiko-bot
2026-07-15 15:51 ` [PATCH 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, 1 reply; 7+ messages in thread
From: Victor Krawiec @ 2026-07-15 15:51 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
Indexes are starting from 1 to keep backward compatibility with existing
device trees
Signed-off-by: Victor Krawiec <victor.krawiec@arturia.com>
---
.../dt-bindings/regulator/silergy,syr82x.h | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 include/dt-bindings/regulator/silergy,syr82x.h
diff --git a/include/dt-bindings/regulator/silergy,syr82x.h b/include/dt-bindings/regulator/silergy,syr82x.h
new file mode 100644
index 000000000000..6d4aa86bb5c1
--- /dev/null
+++ b/include/dt-bindings/regulator/silergy,syr82x.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 Sylergy SYR827 and SYR828 PMIC regulators
+ */
+
+#ifndef _DT_BINDINGS_REGULATOR_SYR82X_H
+#define _DT_BINDINGS_REGULATOR_SYR82X_H
+
+/*
+ * Constants to specify regulator modes in device tree for SYR82X regulators
+ * SYR82X_REGULATOR_MODE_FORCE_PWM: Force fixed PWM mode
+ * SYR82X_REGULATOR_MODE_AUTO: Allow auto-PFM mode during light load
+ */
+
+#define SYR82X_REGULATOR_MODE_FORCE_PWM 1
+#define SYR82X_REGULATOR_MODE_AUTO 2
+
+#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode
2026-07-15 15:51 [PATCH 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
2026-07-15 15:51 ` [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes Victor Krawiec
@ 2026-07-15 15:51 ` Victor Krawiec
2026-07-15 15:51 ` [PATCH 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants Victor Krawiec
2026-07-15 15:51 ` [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
3 siblings, 0 replies; 7+ messages in thread
From: Victor Krawiec @ 2026-07-15 15:51 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..813c3cb1b71e 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/silergy,syr82x.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 = <SYR82X_REGULATOR_MODE_FORCE_PWM>;
regulator-state-mem {
regulator-off-in-suspend;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants
2026-07-15 15:51 [PATCH 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
2026-07-15 15:51 ` [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes Victor Krawiec
2026-07-15 15:51 ` [PATCH 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode Victor Krawiec
@ 2026-07-15 15:51 ` Victor Krawiec
2026-07-15 15:51 ` [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
3 siblings, 0 replies; 7+ messages in thread
From: Victor Krawiec @ 2026-07-15 15:51 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..6d9ca6e7325b 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/silergy,syr82x.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 = <SYR82X_REGULATOR_MODE_FORCE_PWM>;
regulator-state-mem {
regulator-off-in-suspend;
};
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices
2026-07-15 15:51 [PATCH 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
` (2 preceding siblings ...)
2026-07-15 15:51 ` [PATCH 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants Victor Krawiec
@ 2026-07-15 15:51 ` Victor Krawiec
2026-07-15 16:02 ` sashiko-bot
3 siblings, 1 reply; 7+ messages in thread
From: Victor Krawiec @ 2026-07-15 15:51 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
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..8664659f0d80 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/silergy,syr82x.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_silergy_map_mode(unsigned int mode)
+{
+ switch (mode) {
+ case SYR82X_REGULATOR_MODE_FORCE_PWM:
+ return REGULATOR_MODE_FAST;
+ case SYR82X_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_silergy_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] 7+ messages in thread
* Re: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-15 15:51 ` [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes Victor Krawiec
@ 2026-07-15 16:02 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-07-15 16:02 UTC (permalink / raw)
To: Victor Krawiec; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
New issues:
- [Medium] Missing of_map_mode callback in fan53555 driver renders DT mode constants non-functional.
- [Low] Brand name misspelled in the newly added header file comment.
Pre-existing issues:
- [High] fan53555_set_mode() corrupts the voltage or enable register instead of changing the mode for multiple non-default variants.
--
--- Patch [1]: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes ---
commit 17c0df18a13c2c0dbee697655aab8c718df5c959
Author: Victor Krawiec <victor.krawiec@arturia.com>
regulator: dt-bindings: Add Silergy SYR82X allowed modes
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.
> diff --git a/include/dt-bindings/regulator/silergy,syr82x.h b/include/dt-bindings/regulator/silergy,syr82x.h
> new file mode 100644
> index 0000000000000..6d4aa86bb5c1d
> --- /dev/null
> +++ b/include/dt-bindings/regulator/silergy,syr82x.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 Sylergy SYR827 and SYR828 PMIC regulators
[Severity: Low]
This isn't a bug, but there is a typo here ("Sylergy" instead of "Silergy").
> + */
> +
> +#ifndef _DT_BINDINGS_REGULATOR_SYR82X_H
> +#define _DT_BINDINGS_REGULATOR_SYR82X_H
> +
> +/*
> + * Constants to specify regulator modes in device tree for SYR82X regulators
> + * SYR82X_REGULATOR_MODE_FORCE_PWM: Force fixed PWM mode
> + * SYR82X_REGULATOR_MODE_AUTO: Allow auto-PFM mode during light load
> + */
> +
> +#define SYR82X_REGULATOR_MODE_FORCE_PWM 1
> +#define SYR82X_REGULATOR_MODE_AUTO 2
[Severity: Medium]
Will these constants actually be parsed by the regulator core?
Looking at the driver handling the SYR82x regulators, it appears to lack the
.of_map_mode callback:
drivers/regulator/fan53555.c:fan53555_regulator_register() {
...
rdesc->enable_time = di->enable_time;
rdesc->owner = THIS_MODULE;
rdev = devm_regulator_register(di->dev, &di->desc, config);
...
}
Without an of_map_mode callback, won't the regulator core fail to translate
these device tree mode constants, leaving the forced PWM mode non-functional?
[Severity: High]
This is a pre-existing issue, but while reviewing the mode support for this
hardware I noticed that fan53555_set_mode() might be corrupting registers:
drivers/regulator/fan53555.c:fan53555_set_mode() {
...
case REGULATOR_MODE_NORMAL:
regmap_update_bits(rdev->regmap, di->vol_reg, di->mode_mask, 0);
break;
...
}
Does this incorrectly clear the mode mask on di->vol_reg instead of
di->mode_reg?
For variants like FAN53526_VENDOR_TCS where these point to different
registers, could this drop the voltage or disable the regulator entirely
when changing to normal mode?
> +
> +#endif
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260715155141.128601-1-victor.krawiec@arturia.com?part=1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices
2026-07-15 15:51 ` [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
@ 2026-07-15 16:02 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-07-15 16:02 UTC (permalink / raw)
To: Victor Krawiec; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] `fan53555_set_mode()` writes to `di->vol_reg` instead of `di->mode_reg` when setting `REGULATOR_MODE_NORMAL`, causing severe state corruption for several vendors.
--
--- Patch [4]: [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices ---
commit f660e0b49b4dfc8b2006ec4509cf598aba57babb
Author: Victor Krawiec <victor.krawiec@arturia.com>
regulator: fan53555: Add support for mode operations on Silergy devices
This patch maps Silergy PMIC device modes via device tree by mapping
SYR82X_REGULATOR_MODE_AUTO to REGULATOR_MODE_NORMAL. It exposes configurable
PWM modes for these regulators.
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index c282236959b18..8664659f0d809 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_silergy_map_mode(unsigned int mode)
> +{
> + switch (mode) {
> + case SYR82X_REGULATOR_MODE_FORCE_PWM:
> + return REGULATOR_MODE_FAST;
> + case SYR82X_REGULATOR_MODE_AUTO:
> + return REGULATOR_MODE_NORMAL;
[Severity: High]
This isn't a bug introduced by this patch, but returning REGULATOR_MODE_NORMAL
here exposes a pre-existing issue in fan53555_set_mode() that affects multiple
vendors (such as FAN53526, TCS, or RK8602).
When an in-kernel PM consumer driver or sysfs interface calls
regulator_set_mode() to set REGULATOR_MODE_NORMAL, it incorrectly updates
di->vol_reg instead of di->mode_reg:
drivers/regulator/fan53555.c:fan53555_set_mode() {
...
case REGULATOR_MODE_NORMAL:
regmap_update_bits(rdev->regmap, di->vol_reg, di->mode_mask, 0);
break;
...
}
For RK8602, di->mode_mask is VSEL_MODE (BIT 6), but in vol_reg (e.g.,
RK8602_VSEL1), bit 6 represents a 64-step voltage increment (400mV). Clearing
this bit inadvertently plummets the physical voltage, which can cause hardware
brownouts, instant kernel panics, or memory corruption.
Is it possible to fix this existing issue in fan53555_set_mode() by using
di->mode_reg instead of di->vol_reg before or alongside this change?
> + default:
> + return REGULATOR_MODE_INVALID;
> + }
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260715155141.128601-1-victor.krawiec@arturia.com?part=4
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-15 16:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 15:51 [PATCH 0/4] Configure SYR82X regulator modes via device tree Victor Krawiec
2026-07-15 15:51 ` [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes Victor Krawiec
2026-07-15 16:02 ` sashiko-bot
2026-07-15 15:51 ` [PATCH 2/4] arm64: dts: rk3399-rock-4c-plus: Use device tree bindings constants for SYR828 regulator initial mode Victor Krawiec
2026-07-15 15:51 ` [PATCH 3/4] arm64: dts: rockchip: rk3399-hugsun-x99: Update SYR828 regulator initial mode to use device tree bindings constants Victor Krawiec
2026-07-15 15:51 ` [PATCH 4/4] regulator: fan53555: Add support for mode operations on Silergy devices Victor Krawiec
2026-07-15 16:02 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.