Skip to contentSkip to conversation

Add support for ADP5055 triple buck regulator.

PATCH Superseded Alexis Czezar Torreno 3 participants 8 messages Apr 3, 2025 – Apr 4, 2025

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Alexis Czezar Torreno

author maintainer
#0 lore raw

v3 cover Add support for ADP5055 triple buck regulator.

Introduce a regulator driver support for ADP5055. The device combines 3 high performance buck regulators in a 43-termminal land grid array package. The device enables direct connection to high input voltages up to 18V with no preregulator. Channel 1 and 2 deliver a programmable output current of 3.5A or 7.5A or provide a single output with up to 14A in parallel operation. Channel 3 has a programmable output current of 1.5A or 3A.

---
Changes in v3:
- Improved commit message,
- adp5055-regulator.c
- Regulator node names are now lowercase
- Edited to support changes in bindings
- adi,adp5055-regulator.yaml
- Improved property definitions
- Improved text wrapping
- Moved device 'adi,hw-en-array-gpios' to 'enable-gpios' per regulator
- Changed 'channels' to regulators named buck[0-2]
- Added missing ref to regulator schema
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Kconfig - fixed indention problem, occured due to using spaces rather tabs
- adp5055-regulator.c
- Turned initial comment block into c++ style, using // per line
- Merged the similar read/write ranges variable called access_ranges_table
- Set max_register value correctly to 0xE0 instead of 0xFF
- Fixed issue where ndescs was an error code. replaced with -EINVAL
- Enable/disable ops functions, now use helpers like regulator_enable_regmap
- Added config.ena_gpiod for the regulator config
- Used of_parse_cb to do per regulator properties, new function added
- Migrated some yaml properties to the core regulator function
-adi,adp5055-regulator.yaml
- Moved property power_saving_mode to set/get mode under 'IDLE' mode
- Moved property output-discharge-func to core func set_active_discharge
- Moved property enable-delay-us to core function set_ramp_delay.
- Removed property disable-delay-us, as suggested to not worry about
- adjusted sample device tree to match changes due to use of of_parse_cb
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexis Czezar Torreno (2):
regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support
regulator: adp5055: Add driver for adp5055

 .../bindings/regulator/adi,adp5055-regulator.yaml  | 157 +++++++
 MAINTAINERS                                        |   7 +
 drivers/regulator/Kconfig                          |  11 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/adp5055-regulator.c              | 470 +++++++++++++++++++++
 5 files changed, 646 insertions(+)

---
base-commit: 7fef39f0e82ff02282797d9ae2589b39b16ab614
change-id: 20250225-upstream-adp5055-adbe6262f984

Best regards,

Signature · 1 line
Alexis Czezar Torreno <[email protected]>
author maintainer
#1 lore raw

PATCH v3 1/2 regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support

Add documentation for devicetree bindings for ADP5055. The device consists of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators.

---
 .../bindings/regulator/adi,adp5055-regulator.yaml  | 157 +++++++++++++++++++++
 MAINTAINERS                                        |   6 +
 2 files changed, 163 insertions(+)
Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml new file +157 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a55d564d8d0783fe5d503d4c5e2f6a38fc0702cd
@@ -0,0 +1,157 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/adi,adp5055-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADP5055 Triple Buck Regulator
+
+maintainers:
+  - Alexis Czezar Torreno <[email protected]>
+
+description: |
+  The ADP5055 combines three high performance buck regulator. The device enables
+  direct connection to high input voltages up to 18 V with no preregulators.
+  https://www.analog.com/media/en/technical-documentation/data-sheets/adp5055.pdf
+
+properties:
+  compatible:
+    enum:
+      - adi,adp5055
+
+  reg:
+    enum:
+      - 0x70
+      - 0x71
+
+  adi,tset-us:
+    description:
+      Setting time used by the device. This is changed via soldering specific
+      resistor values on the CFG2 pin.
+    enum: [2600, 20800]
+    default: 2600
+
+  adi,ocp-blanking:
+    description:
+      If present, overcurrent protection (OCP) blanking for all regulator is on.
+    type: boolean
+
+  adi,delay-power-good:
+    description:
+      Configures delay timer of the power good (PWRGD) pin. Delay is based on
+      Tset which can be 2.6 ms or 20.8 ms.
+    type: boolean
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "^buck[0-2]$":
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      enable-gpios:
+        maxItems: 1
+        description:
+          GPIO specifier to enable the GPIO control for each regulator. The
+          driver supports two modes of enable, hardware only (GPIOs) or software
+          only (Registers). Pure hardware enabling requires each regulator to
+          contain this property. If at least one regulator does not have this,
+          the driver automatically switches to software only mode.
+
+      adi,dvs-limit-upper-microvolt:
+        description:
+          Configure the allowable upper side limit of the voltage output of each
+          regulator in microvolt. Relative to the default Vref trimming value.
+          Vref = 600 mV. Voltages are in 12 mV steps, value is autoadjusted.
+          Vout_high = Vref_trim + dvs-limit-upper.
+        minimum: 12000
+        maximum: 192000
+        default: 192000
+
+      adi,dvs-limit-lower-microvolt:
+        description:
+          Configure the allowable lower side limit of the voltage output of each
+          regulator in microvolt. Relative to the default Vref trimming value.
+          Vref = 600 mV. Voltages are in 12 mV steps, value is autoadjusted.
+          Vout_low = Vref_trim + dvs-limit-lower.
+        minimum: -190500
+        maximum: -10500
+        default: -190500
+
+      adi,fast-transient:
+        description:
+          Configures the fast transient sensitivity for each regulator.
+          "none"    - No fast transient.
+          "3G_1.5%" - 1.5% window with 3*350uA/V
+          "5G_1.5%" - 1.5% window with 5*350uA/V
+          "5G_2.5%" - 2.5% window with 5*350uA/V
+        enum: [none, 3G_1.5%, 5G_1.5%, 5G_2.5%]
+        default: 5G_2.5
+
+      adi,mask-power-good:
+        description:
+          If present, masks individual regulators PWRGD signal to the external
+          PWRGD hardware pin.
+        type: boolean
+
+    required:
+      - regulator-name
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@70 {
+            compatible = "adi,adp5055";
+            reg = <0x70>;
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            adi,tset-us = <2600>;
+            adi,ocp-blanking;
+            adi,delay-power-good;
+
+            buck0 {
+                regulator-name = "buck0";
+                enable-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+                adi,dvs-limit-upper-microvolt = <192000>;
+                adi,dvs-limit-lower-microvolt = <(-190500)>;
+                adi,fast-transient = "5G_2.5%";
+                adi,mask-power-good;
+            };
+
+            buck1 {
+                regulator-name = "buck1";
+                enable-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+                adi,dvs-limit-upper-microvolt = <192000>;
+                adi,dvs-limit-lower-microvolt = <(-190500)>;
+                adi,fast-transient = "5G_2.5%";
+                adi,mask-power-good;
+            };
+
+            buck2 {
+                regulator-name = "buck2";
+                enable-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
+                adi,dvs-limit-upper-microvolt = <192000>;
+                adi,dvs-limit-lower-microvolt = <(-190500)>;
+                adi,fast-transient = "5G_2.5%";
+                adi,mask-power-good;
+            };
+        };
+    };
MAINTAINERS +6 -0
index 896a307fa06545e2861abe46ea7029f9b4d3628e..b2ec43f84d84765c319d8403fb5650afa273db83 100644
@@ -1525,6 +1525,12 @@ W:	https://ez.analog.com/linux-software-drivers
 F:	Documentation/devicetree/bindings/iio/filter/adi,admv8818.yaml
 F:	drivers/iio/filter/admv8818.c
 
+ANALOG DEVICES INC ADP5055 DRIVER
+M:	Alexis Czezar Torreno <[email protected]>
+S:	Supported
+W:	https://ez.analog.com/linux-software-drivers
+F:	Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml
+
 ANALOG DEVICES INC ADP5061 DRIVER
 M:	Michael Hennerich <[email protected]>
 L:	[email protected]
Signature · 1 line
2.34.1
Reviewed-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support

Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml line 52

Quoted 8 lines · Alexis Czezar Torreno
Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml new file +8 -0
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "^buck[0-2]$":

If there is going to be new version, use consistent quotes, either " or '

...

Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml line 95

Quoted 13 lines
Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml new file +12 -0
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
 
+      adi,fast-transient:
+        description:
+          Configures the fast transient sensitivity for each regulator.
+          "none"    - No fast transient.
+          "3G_1.5%" - 1.5% window with 3*350uA/V
+          "5G_1.5%" - 1.5% window with 5*350uA/V
+          "5G_2.5%" - 2.5% window with 5*350uA/V
+        enum: [none, 3G_1.5%, 5G_1.5%, 5G_2.5%]
+        default: 5G_2.5

Missing percent:
5G_2.5%

With this fixed:

Best regards,
Krzysztof

author maintainer
#3 lore raw

RE: [PATCH v3 1/2] regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support

Quoted 43 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Thursday, April 3, 2025 2:40 PM
To: Torreno, Alexis Czezar <[email protected]>
Cc: Liam Girdwood <[email protected]>; Mark Brown <[email protected]>; Rob Herring <[email protected]>; Krzysztof Kozlowski <[email protected]>; Conor Dooley <[email protected]>; linux- [email protected]; [email protected]
Subject: Re: [PATCH v3 1/2] regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support

[External]

Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml line 52

Quoted 8 lines · Alexis Czezar Torreno
Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml new file +8 -0
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "^buck[0-2]$":

If there is going to be new version, use consistent quotes, either " or '

...

Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml line 95

Quoted 13 lines
Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml new file +12 -0
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
 
+      adi,fast-transient:
+        description:
+          Configures the fast transient sensitivity for each regulator.
+          "none"    - No fast transient.
+          "3G_1.5%" - 1.5% window with 3*350uA/V
+          "5G_1.5%" - 1.5% window with 5*350uA/V
+          "5G_2.5%" - 2.5% window with 5*350uA/V
+        enum: [none, 3G_1.5%, 5G_1.5%, 5G_2.5%]
+        default: 5G_2.5
Quoted 6 lines

Missing percent:
5G_2.5%

With this fixed:

Will fix the small edits.
Thanks!

author maintainer
#4 lore raw

PATCH v3 2/2 regulator: adp5055: Add driver for adp5055

In reply to Alexis Czezar Torreno

Add ADI ADP5055 driver support. The device consists
of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators.

---
 MAINTAINERS                           |   1 +
 drivers/regulator/Kconfig             |  11 +
 drivers/regulator/Makefile            |   1 +
 drivers/regulator/adp5055-regulator.c | 470 ++++++++++++++++++++++++++++++++++
 4 files changed, 483 insertions(+)
MAINTAINERS +1 -0
index b2ec43f84d84765c319d8403fb5650afa273db83..7ac35d895b4c8297c6de70cd2bfaec516ff5b100 100644
@@ -1530,6 +1530,7 @@ M:	Alexis Czezar Torreno <[email protected]>
 S:	Supported
 W:	https://ez.analog.com/linux-software-drivers
 F:	Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml
+F:	drivers/regulator/adp5055-regulator.c
 
 ANALOG DEVICES INC ADP5061 DRIVER
 M:	Michael Hennerich <[email protected]>
drivers/regulator/Kconfig +11 -0
index 39297f7d8177193e51c99bc2b360c6d9936e62fe..4c08cf755d88e5f5bc6431192fad5f27786caea8 100644
@@ -122,6 +122,17 @@ config REGULATOR_AD5398
 	  This driver supports AD5398 and AD5821 current regulator chips.
 	  If building into module, its name is ad5398.ko.
 
+config REGULATOR_ADP5055
+	tristate "Analog Devices ADP5055 Triple Buck Regulator"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  This driver controls an Analog Devices ADP5055 with triple buck
+	  regulators using an I2C interface.
+
+	  Say M here if you want to include support for the regulator as a
+	  module.
+
 config REGULATOR_ANATOP
 	tristate "Freescale i.MX on-chip ANATOP LDO regulators"
 	depends on ARCH_MXC || COMPILE_TEST
drivers/regulator/Makefile +1 -0
index 3d5a803dce8a0556ba9557fa069c6e37593b3c69..71f45d9317d24e7081ac919eb31efff6652edf3f 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_REGULATOR_AB8500)	+= ab8500-ext.o ab8500.o
 obj-$(CONFIG_REGULATOR_ACT8865) += act8865-regulator.o
 obj-$(CONFIG_REGULATOR_ACT8945A) += act8945a-regulator.o
 obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
+obj-$(CONFIG_REGULATOR_ADP5055) += adp5055-regulator.o
 obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
 obj-$(CONFIG_REGULATOR_ARIZONA_LDO1) += arizona-ldo1.o
 obj-$(CONFIG_REGULATOR_ARIZONA_MICSUPP) += arizona-micsupp.o
drivers/regulator/adp5055-regulator.c new file +470 -0

470 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#5 lore raw

Re: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055

drivers/regulator/adp5055-regulator.c line 270

Quoted 13 lines · Alexis Czezar Torreno
drivers/regulator/adp5055-regulator.c new file +13 -0
+static int adp5055_is_enabled(struct regulator_dev *rdev)
+{
+	struct adp5055 *adp5055 = rdev_get_drvdata(rdev);
+	int id = rdev_get_id(rdev);
+	int val;
+
+	if (adp5055->en_mode_software)
+		return regulator_is_enabled_regmap(rdev);
+
+	val = gpiod_get_value_cansleep(adp5055->en_gpiod[id]);
+
+	return val;
+};

This is absolutely standard enable GPIO support, just let the core handle everything. Otherwise this looks fine.

author maintainer
#6 lore raw

RE: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055

Quoted 16 lines

-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Thursday, April 3, 2025 7:09 PM
To: Torreno, Alexis Czezar <[email protected]>
Cc: Liam Girdwood <[email protected]>; Rob Herring <[email protected]>; Krzysztof Kozlowski <[email protected]>; Conor Dooley <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055

[External]

On Thu, Apr 03, 2025 at 10:43:11AM +0800, Alexis Czezar Torreno wrote:

Quoted 15 lines

drivers/regulator/adp5055-regulator.c line 270

Quoted 12 lines
drivers/regulator/adp5055-regulator.c new file +12 -0
+static int adp5055_is_enabled(struct regulator_dev *rdev) {
+	struct adp5055 *adp5055 = rdev_get_drvdata(rdev);
+	int id = rdev_get_id(rdev);
+	int val;
+
+	if (adp5055->en_mode_software)
+		return regulator_is_enabled_regmap(rdev);
+
+	val = gpiod_get_value_cansleep(adp5055->en_gpiod[id]);
+
+	return val;
+};

This is absolutely standard enable GPIO support, just let the core handle everything. Otherwise this looks fine.

May I ask which core function is the suggested to use here?

I assume I need to change the line in ops:
-> .is_enabled = adp5055_is_enabled,

Not sure which function handles both GPIO and registers since as far as I understand 'regulator_is_enabled_regmap()' only handles software/registers and 'regulator_is_enabled()' only checks the gpio?

maintainer
#7 lore raw

Re: [PATCH v3 2/2] regulator: adp5055: Add driver for adp5055

Quoted 11 lines · Alexis Czezar
Quoted 2 lines

This is absolutely standard enable GPIO support, just let the core handle everything. Otherwise this looks fine.

May I ask which core function is the suggested to use here?

I assume I need to change the line in ops:
-> .is_enabled = adp5055_is_enabled,

Not sure which function handles both GPIO and registers since as far as I understand 'regulator_is_enabled_regmap()' only handles software/registers and 'regulator_is_enabled()' only checks the gpio?

The core handles GPIOs separately to the enable function, this is a very standard feature even things that actually need custom enable functions can make use of it.