* [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-17 9:08 ` Krzysztof Kozlowski
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; 10+ 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 [flat|nested] 10+ 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-17 9:08 ` Krzysztof Kozlowski
2026-07-17 12:02 ` Victor Krawiec
0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-17 9:08 UTC (permalink / raw)
To: Victor Krawiec
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, linux-kernel, devicetree
On Wed, Jul 15, 2026 at 05:51:38PM +0200, Victor Krawiec wrote:
> 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
>
This header should be mentioned in the binding in property description.
> 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
Some confusing name. How is your binding file called? This must be the
same.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-17 9:08 ` Krzysztof Kozlowski
@ 2026-07-17 12:02 ` Victor Krawiec
2026-07-17 12:31 ` Krzysztof Kozlowski
0 siblings, 1 reply; 10+ messages in thread
From: Victor Krawiec @ 2026-07-17 12:02 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, linux-kernel, devicetree
On 7/17/26 11:08, Krzysztof Kozlowski wrote:
> On Wed, Jul 15, 2026 at 05:51:38PM +0200, Victor Krawiec wrote:
>> 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
>>
> This header should be mentioned in the binding in property description.
Thank you for the review. I'll add it to the binding in the next iteration.
>> 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
> Some confusing name. How is your binding file called? This must be the
> same.
The binding file is named fcs,fan53555.yaml and handles several devices including the Silergy SYR82X which I was targeting in this patch serie. I will rename the header to have the same name as the binding file. Should I also rename the macros defined inside the header (SYR82X_REGULATOR_MODE_*) ?
The underlying implementation in the driver (in fan53555_device_mode_map_setup() it the patch serie) is limited to SYR82X because it is the only hardware that I'm able to test. That's why the binding part was referring to this specific device.
Best regards,
Victor
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-17 12:02 ` Victor Krawiec
@ 2026-07-17 12:31 ` Krzysztof Kozlowski
2026-07-17 12:44 ` Mark Brown
0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-17 12:31 UTC (permalink / raw)
To: Victor Krawiec
Cc: lgirdwood, broonie, robh, krzk+dt, conor+dt, linux-kernel, devicetree
On 17/07/2026 14:02, Victor Krawiec wrote:
> On 7/17/26 11:08, Krzysztof Kozlowski wrote:
>
>> On Wed, Jul 15, 2026 at 05:51:38PM +0200, Victor Krawiec wrote:
>>> 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
>>>
>> This header should be mentioned in the binding in property description.
> Thank you for the review. I'll add it to the binding in the next iteration.
>>> 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
>> Some confusing name. How is your binding file called? This must be the
>> same.
>
> The binding file is named fcs,fan53555.yaml and handles several devices including the Silergy SYR82X which I was targeting in this patch serie. I will rename the header to have the same name as the binding file. Should I also rename the macros defined inside the header (SYR82X_REGULATOR_MODE_*) ?
>
> The underlying implementation in the driver (in fan53555_device_mode_map_setup() it the patch serie) is limited to SYR82X because it is the only hardware that I'm able to test. That's why the binding part was referring to this specific device.
>
So you are adding constants for one device but used in the bindings and
driver for other? Are they valid there?
The fcs,fan53555.yaml does not say that any modes are particularly valid.
Please wrap your replies.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-17 12:31 ` Krzysztof Kozlowski
@ 2026-07-17 12:44 ` Mark Brown
2026-07-17 14:14 ` Victor Krawiec
0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2026-07-17 12:44 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Victor Krawiec, lgirdwood, robh, krzk+dt, conor+dt, linux-kernel,
devicetree
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]
On Fri, Jul 17, 2026 at 02:31:51PM +0200, Krzysztof Kozlowski wrote:
> On 17/07/2026 14:02, Victor Krawiec wrote:
> > The underlying implementation in the driver (in fan53555_device_mode_map_setup() it the patch serie) is limited to SYR82X because it is the only hardware that I'm able to test. That's why the binding part was referring to this specific device.
> So you are adding constants for one device but used in the bindings and
> driver for other? Are they valid there?
It's one of these devices that's got a bunch of clones from various
manufacturers with minor differences and share a driver.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] regulator: dt-bindings: Add Silergy SYR82X allowed modes
2026-07-17 12:44 ` Mark Brown
@ 2026-07-17 14:14 ` Victor Krawiec
0 siblings, 0 replies; 10+ messages in thread
From: Victor Krawiec @ 2026-07-17 14:14 UTC (permalink / raw)
To: Mark Brown, Krzysztof Kozlowski
Cc: lgirdwood, robh, krzk+dt, conor+dt, linux-kernel, devicetree
On 7/17/26 14:44, Mark Brown wrote:
> On Fri, Jul 17, 2026 at 02:31:51PM +0200, Krzysztof Kozlowski wrote:
>
>> So you are adding constants for one device but used in the bindings and
>> driver for other? Are they valid there?
>
> It's one of these devices that's got a bunch of clones from various
> manufacturers with minor differences and share a driver.
I checked the datasheets and all devices share the same 2 modes which
are Auto-PFM and Forced PWM mode.
Since devices are all clones and share the same modes the binding part
can be generic. I plan to rename the header and its macros to use
FAN53555 name and add this property to the binding:
regulator-initial-mode:
enum:
[ 1, 2 ]
description:
Defined in
include/dt-bindings/regulator/fcs,fan53555-regulator.h
However the implementation I made in the driver is currently
restricted to SYR82X. I could make it generic but I don't have access
to the other devices to test it.
Best regards
Victor
^ permalink raw reply [flat|nested] 10+ 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; 10+ 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 [flat|nested] 10+ 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; 10+ 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 [flat|nested] 10+ 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
3 siblings, 0 replies; 10+ 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 [flat|nested] 10+ messages in thread