* [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments
@ 2026-10-06 15:44 Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema Svyatoslav Ryhel
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Convert and upgrade schema. Consolidate driver file, remove platform_data
based probing and add missing regulator/chip supplies.
Svyatoslav Ryhel (7):
regulator: dt-bindings: ti,lp872x: Convert to DT schema
regulator: dt-bindings: ti,lp872x: Document input supplies
regulator: lp872x: Fold driver header into driver file
regulator: lp872x: Remove redundant regmap wrappers
regulator: lp872x: Remove platform_data based probing
regulator: lp872x: Add support for input and regulator power supplies
regulator: lp872x: Use macro to fill regulator descriptor
.../devicetree/bindings/regulator/lp872x.txt | 161 -----
.../bindings/regulator/ti,lp8720.yaml | 244 +++++++
drivers/regulator/lp872x.c | 665 ++++++------------
include/linux/regulator/lp872x.h | 86 ---
4 files changed, 448 insertions(+), 708 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/regulator/lp872x.txt
create mode 100644 Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
delete mode 100644 include/linux/regulator/lp872x.h
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 2/7] regulator: dt-bindings: ti,lp872x: Document input supplies Svyatoslav Ryhel
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Convert TI LP872x regulator binding from text to DT schema.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../devicetree/bindings/regulator/lp872x.txt | 161 ------------
.../bindings/regulator/ti,lp8720.yaml | 232 ++++++++++++++++++
2 files changed, 232 insertions(+), 161 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/regulator/lp872x.txt
create mode 100644 Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
diff --git a/Documentation/devicetree/bindings/regulator/lp872x.txt b/Documentation/devicetree/bindings/regulator/lp872x.txt
deleted file mode 100644
index ab895cd1cac1a..0000000000000
--- a/Documentation/devicetree/bindings/regulator/lp872x.txt
+++ /dev/null
@@ -1,161 +0,0 @@
-Binding for TI/National Semiconductor LP872x Driver
-
-Required properties:
- - compatible: "ti,lp8720" or "ti,lp8725"
- - reg: I2C slave address. 0x7d = LP8720, 0x7a = LP8725
-
-Optional properties:
- - ti,general-config: the value of LP872X_GENERAL_CFG register (u8)
- (LP8720)
- bit[2]: BUCK output voltage control by external DVS pin or register
- 1 = external pin, 0 = bit7 of register 08h
- bit[1]: sleep control by external DVS pin or register
- 1 = external pin, 0 = bit6 of register 08h
- bit[0]: time step unit(usec). 1 = 25, 0 = 50
-
- (LP8725)
- bit[7:6]: time step unit(usec). 00 = 32, 01 = 64, 10 = 128, 11 = 256
- bit[4]: BUCK2 enable control. 1 = enable, 0 = disable
- bit[3]: BUCK2 output voltage register address. 1 = 0Ah, 0 = 0Bh
- bit[2]: BUCK1 output voltage control by external DVS pin or register
- 1 = register 08h, 0 = DVS
- bit[1]: LDO sleep control. 1 = sleep mode, 0 = normal
- bit[0]: BUCK1 enable control, 1 = enable, 0 = disable
-
- For more details, please see the datasheet.
-
- - ti,update-config: define it when LP872X_GENERAL_CFG register should be set
- - ti,dvs-gpio: GPIO specifier for external DVS pin control of LP872x devices.
- - ti,dvs-vsel: DVS selector. 0 = SEL_V1, 1 = SEL_V2.
- - ti,dvs-state: initial DVS pin state. 0 = DVS_LOW, 1 = DVS_HIGH.
- - enable-gpios: GPIO specifier for EN pin control of LP872x devices.
-
- Sub nodes for regulator_init_data
- LP8720 has maximum 6 nodes. (child name: ldo1 ~ 5 and buck)
- LP8725 has maximum 9 nodes. (child name: ldo1 ~ 5, lilo1,2 and buck1,2)
- For more details, please see the following binding document.
- (Documentation/devicetree/bindings/regulator/regulator.txt)
-
-Datasheet
- - LP8720: https://www.ti.com/lit/ds/symlink/lp8720.pdf
- - LP8725: https://www.ti.com/lit/ds/symlink/lp8725.pdf
-
-Example 1) LP8720
-
-lp8720@7d {
- compatible = "ti,lp8720";
- reg = <0x7d>;
-
- /* external DVS pin used, timestep is 25usec */
- ti,general-config = /bits/ 8 <0x03>;
- ti,update-config;
-
- /*
- * The dvs-gpio depends on the processor environment.
- * For example, following GPIO specifier means GPIO134 in OMAP4.
- */
- ti,dvs-gpio = <&gpio5 6 0>;
- ti,dvs-vsel = /bits/ 8 <1>; /* SEL_V2 */
- ti,dvs-state = /bits/ 8 <1>; /* DVS_HIGH */
-
- vaf: ldo1 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vmmc: ldo2 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcam_io: ldo3 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- regulator-boot-on;
- };
-
- vcam_core: ldo4 {
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <2850000>;
- regulator-boot-on;
- };
-
- vcam: ldo5 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcc: buck {
- regulator-name = "VBUCK";
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <2300000>;
- };
-};
-
-Example 2) LP8725
-
-lp8725@7a {
- compatible = "ti,lp8725";
- reg = <0x7a>;
-
- /* Enable BUCK1,2, no DVS, normal LDO mode, timestep is 256usec */
- ti,general-config = /bits/ 8 <0xdd>;
- ti,update-config;
-
- vcam_io: ldo1 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcam_core: ldo2 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcam: ldo3 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcmmb_io: ldo4 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- regulator-boot-on;
- };
-
- vcmmb_core: ldo5 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <3300000>;
- regulator-boot-on;
- };
-
- vaux1: lilo1 {
- regulator-name = "VAUX1";
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vaux2: lilo2 {
- regulator-name = "VAUX2";
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <3300000>;
- };
-
- vcc1: buck1 {
- regulator-name = "VBUCK1";
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <3000000>;
- regulator-min-microamp = <460000>;
- regulator-max-microamp = <1370000>;
- regulator-boot-on;
- };
-
- vcc2: buck2 {
- regulator-name = "VBUCK2";
- regulator-min-microvolt = <800000>;
- regulator-max-microvolt = <3000000>;
- regulator-min-microamp = <460000>;
- regulator-max-microamp = <1370000>;
- regulator-boot-on;
- };
-};
diff --git a/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml b/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
new file mode 100644
index 0000000000000..f2384749314f1
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
@@ -0,0 +1,232 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/ti,lp8720.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI/National Semiconductor LP872x PMIC
+
+description: >
+ The LP8720 is a multi-function, programmable Power Management Unit,
+ optimized for sub block power requirement solutions. This device
+ integrates one highly efficient 400 mA step-down DC-DC converter with
+ Dynamic Voltage Scale (DVS), five low-noise low dropout (LDO) voltage
+ regulators, and a 400 KHz i2c-compatible interface to allow a host
+ controller access to the internal control registers of the LP8720.
+ Additionally, the LP8720 features programmable power-on sequencing.
+
+ LP8720: https://www.ti.com/lit/ds/symlink/lp8720.pdf
+ LP8725: https://www.ti.com/lit/ds/symlink/lp8725.pdf
+
+maintainers:
+ - Svyatoslav Ryhel <clamor95@gmail.com>
+
+properties:
+ compatible:
+ enum:
+ - ti,lp8720
+ - ti,lp8725
+
+ reg:
+ maxItems: 1
+
+ enable-gpios:
+ description: GPIO specifier for EN pin control.
+ maxItems: 1
+
+ dvs-gpios:
+ description: GPIO specifier for external DVS pin control.
+ maxItems: 1
+
+ ti,general-config:
+ $ref: /schemas/types.yaml#/definitions/uint8
+ description: >
+ The value of LP872X_GENERAL_CFG register
+
+ (LP8720)
+ bit[2]: BUCK output voltage control by external DVS pin or register
+ 1 = external pin, 0 = bit7 of register 08h
+ bit[1]: sleep control by external DVS pin or register
+ 1 = external pin, 0 = bit6 of register 08h
+ bit[0]: time step unit(usec). 1 = 25, 0 = 50
+
+ (LP8725)
+ bit[7:6]: time step unit(usec). 00 = 32, 01 = 64, 10 = 128, 11 = 256
+ bit[4]: BUCK2 enable control. 1 = enable, 0 = disable
+ bit[3]: BUCK2 output voltage register address. 1 = 0Ah, 0 = 0Bh
+ bit[2]: BUCK1 output voltage control by external DVS pin or register
+ 1 = register 08h, 0 = DVS
+ bit[1]: LDO sleep control. 1 = sleep mode, 0 = normal
+ bit[0]: BUCK1 enable control, 1 = enable, 0 = disable
+
+ For more details, please see the datasheet.
+
+ ti,update-config:
+ type: boolean
+ description: Define it when LP872X_GENERAL_CFG register should be set
+
+ ti,dvs-vsel:
+ $ref: /schemas/types.yaml#/definitions/uint8
+ description: DVS selector. 0 = SEL_V1, 1 = SEL_V2.
+
+ ti,dvs-state:
+ $ref: /schemas/types.yaml#/definitions/uint8
+ description: Initial DVS pin state. 0 = DVS_LOW, 1 = DVS_HIGH.
+
+patternProperties:
+ "^(buck|buck[1-2]|ldo[1-5]|lilo[1-2])$":
+ $ref: /schemas/regulator/regulator.yaml#
+ unevaluatedProperties: false
+
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,lp8720
+ then:
+ patternProperties:
+ "^(buck[1-2]|lilo[1-2])$": false
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: ti,lp8725
+ then:
+ properties:
+ buck: false
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@7d {
+ compatible = "ti,lp8720";
+ reg = <0x7d>;
+
+ /* external DVS pin used, timestep is 25usec */
+ ti,general-config = /bits/ 8 <0x03>;
+ ti,update-config;
+
+ /*
+ * The dvs-gpio depends on the processor environment.
+ * For example, following GPIO specifier means GPIO134 in OMAP4.
+ */
+ dvs-gpios = <&gpio5 6 0>;
+ ti,dvs-vsel = /bits/ 8 <1>; /* SEL_V2 */
+ ti,dvs-state = /bits/ 8 <1>; /* DVS_HIGH */
+
+ ldo1 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ldo2 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ldo3 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ };
+
+ ldo4 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <2850000>;
+ regulator-boot-on;
+ };
+
+ ldo5 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ buck {
+ regulator-name = "VBUCK";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <2300000>;
+ };
+ };
+ };
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pmic@7a {
+ compatible = "ti,lp8725";
+ reg = <0x7a>;
+
+ /* Enable BUCK1,2, no DVS, normal LDO mode, timestep is 256usec */
+ ti,general-config = /bits/ 8 <0xdd>;
+ ti,update-config;
+
+ ldo1 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ldo2 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ldo3 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ldo4 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ };
+
+ ldo5 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ };
+
+ lilo1 {
+ regulator-name = "VAUX1";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ lilo2 {
+ regulator-name = "VAUX2";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ buck1 {
+ regulator-name = "VBUCK1";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-min-microamp = <460000>;
+ regulator-max-microamp = <1370000>;
+ regulator-boot-on;
+ };
+
+ buck2 {
+ regulator-name = "VBUCK2";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-min-microamp = <460000>;
+ regulator-max-microamp = <1370000>;
+ regulator-boot-on;
+ };
+ };
+ };
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 2/7] regulator: dt-bindings: ti,lp872x: Document input supplies
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 3/7] regulator: lp872x: Fold driver header into driver file Svyatoslav Ryhel
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Document input supplies of TI LP8720 and LP8725.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
.../devicetree/bindings/regulator/ti,lp8720.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml b/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
index f2384749314f1..ce4a5a7fb59b2 100644
--- a/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
+++ b/Documentation/devicetree/bindings/regulator/ti,lp8720.yaml
@@ -74,6 +74,16 @@ properties:
description: Initial DVS pin state. 0 = DVS_LOW, 1 = DVS_HIGH.
patternProperties:
+ "^(vbatt|vin([1-3]|b|lilo[1-2]))-supply$":
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: |
+ vbatt - input supply for ldo1 and all internal circuitry (lp8720 only).
+ vin1 - input supply for ldo2 - ldo3 (lp8720) or ldo1 (lp8725).
+ vin2 - input supply for ldo4 - ldo5 (lp8720) or ldo2 - ldo3 (lp8725).
+ vin3 - input supply for ldo4 - ldo5 (lp8725).
+ vinb - input supply for buck.
+ vinlilo1 and vinlilo2 - input supply for lilo1 and lilo2.
+
"^(buck|buck[1-2]|ldo[1-5]|lilo[1-2])$":
$ref: /schemas/regulator/regulator.yaml#
unevaluatedProperties: false
@@ -86,6 +96,7 @@ allOf:
const: ti,lp8720
then:
patternProperties:
+ "^(vin(3|lilo[1-2]))-supply$": false
"^(buck[1-2]|lilo[1-2])$": false
- if:
@@ -95,6 +106,7 @@ allOf:
const: ti,lp8725
then:
properties:
+ vbatt-supply: false
buck: false
required:
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 3/7] regulator: lp872x: Fold driver header into driver file
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 2/7] regulator: dt-bindings: ti,lp872x: Document input supplies Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 4/7] regulator: lp872x: Remove redundant regmap wrappers Svyatoslav Ryhel
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Remove need in header file in preparation for pdata probing removal.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 54 +++++++++++++++++++-
include/linux/regulator/lp872x.h | 86 --------------------------------
2 files changed, 53 insertions(+), 87 deletions(-)
delete mode 100644 include/linux/regulator/lp872x.h
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 5b2faddd8110f..13dce4dcdbe14 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -12,10 +12,10 @@
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
-#include <linux/regulator/lp872x.h>
#include <linux/regulator/driver.h>
#include <linux/platform_device.h>
#include <linux/of.h>
+#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
/* Registers : LP8720/8725 shared */
@@ -92,11 +92,63 @@
/* dump registers in regmap-debugfs */
#define MAX_REGISTERS 0x0F
+#define LP872X_MAX_REGULATORS 9
+
+#define LP8720_ENABLE_DELAY 200
+#define LP8725_ENABLE_DELAY 30000
+
enum lp872x_id {
LP8720,
LP8725,
};
+enum lp872x_regulator_id {
+ LP8720_ID_BASE,
+ LP8720_ID_LDO1 = LP8720_ID_BASE,
+ LP8720_ID_LDO2,
+ LP8720_ID_LDO3,
+ LP8720_ID_LDO4,
+ LP8720_ID_LDO5,
+ LP8720_ID_BUCK,
+
+ LP8725_ID_BASE,
+ LP8725_ID_LDO1 = LP8725_ID_BASE,
+ LP8725_ID_LDO2,
+ LP8725_ID_LDO3,
+ LP8725_ID_LDO4,
+ LP8725_ID_LDO5,
+ LP8725_ID_LILO1,
+ LP8725_ID_LILO2,
+ LP8725_ID_BUCK1,
+ LP8725_ID_BUCK2,
+
+ LP872X_ID_MAX,
+};
+
+enum lp872x_dvs_sel {
+ SEL_V1,
+ SEL_V2,
+};
+
+struct lp872x_dvs {
+ struct gpio_desc *gpio;
+ enum lp872x_dvs_sel vsel;
+ enum gpiod_flags init_state;
+};
+
+struct lp872x_regulator_data {
+ enum lp872x_regulator_id id;
+ struct regulator_init_data *init_data;
+};
+
+struct lp872x_platform_data {
+ u8 general_config;
+ bool update_config;
+ struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
+ struct lp872x_dvs *dvs;
+ struct gpio_desc *enable_gpio;
+};
+
struct lp872x {
struct regmap *regmap;
struct device *dev;
diff --git a/include/linux/regulator/lp872x.h b/include/linux/regulator/lp872x.h
deleted file mode 100644
index b62e45aa1dd36..0000000000000
--- a/include/linux/regulator/lp872x.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright 2012 Texas Instruments
- *
- * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
- */
-
-#ifndef __LP872X_REGULATOR_H__
-#define __LP872X_REGULATOR_H__
-
-#include <linux/regulator/machine.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
-
-#define LP872X_MAX_REGULATORS 9
-
-#define LP8720_ENABLE_DELAY 200
-#define LP8725_ENABLE_DELAY 30000
-
-enum lp872x_regulator_id {
- LP8720_ID_BASE,
- LP8720_ID_LDO1 = LP8720_ID_BASE,
- LP8720_ID_LDO2,
- LP8720_ID_LDO3,
- LP8720_ID_LDO4,
- LP8720_ID_LDO5,
- LP8720_ID_BUCK,
-
- LP8725_ID_BASE,
- LP8725_ID_LDO1 = LP8725_ID_BASE,
- LP8725_ID_LDO2,
- LP8725_ID_LDO3,
- LP8725_ID_LDO4,
- LP8725_ID_LDO5,
- LP8725_ID_LILO1,
- LP8725_ID_LILO2,
- LP8725_ID_BUCK1,
- LP8725_ID_BUCK2,
-
- LP872X_ID_MAX,
-};
-
-enum lp872x_dvs_sel {
- SEL_V1,
- SEL_V2,
-};
-
-/**
- * lp872x_dvs
- * @gpio : gpio descriptor for dvs control
- * @vsel : dvs selector for buck v1 or buck v2 register
- * @init_state : initial dvs pin state
- */
-struct lp872x_dvs {
- struct gpio_desc *gpio;
- enum lp872x_dvs_sel vsel;
- enum gpiod_flags init_state;
-};
-
-/**
- * lp872x_regdata
- * @id : regulator id
- * @init_data : init data for each regulator
- */
-struct lp872x_regulator_data {
- enum lp872x_regulator_id id;
- struct regulator_init_data *init_data;
-};
-
-/**
- * lp872x_platform_data
- * @general_config : the value of LP872X_GENERAL_CFG register
- * @update_config : if LP872X_GENERAL_CFG register is updated, set true
- * @regulator_data : platform regulator id and init data
- * @dvs : dvs data for buck voltage control
- * @enable_gpio : gpio descriptor for enable control
- */
-struct lp872x_platform_data {
- u8 general_config;
- bool update_config;
- struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
- struct lp872x_dvs *dvs;
- struct gpio_desc *enable_gpio;
-};
-
-#endif
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 4/7] regulator: lp872x: Remove redundant regmap wrappers
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
` (2 preceding siblings ...)
2026-10-06 15:44 ` [PATCH v1 3/7] regulator: lp872x: Fold driver header into driver file Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 5/7] regulator: lp872x: Remove platform_data based probing Svyatoslav Ryhel
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Remove lp872x_read_byte(), lp872x_write_byte(), and lp872x_update_bits()
helpers which are just wrappers around the same regmap helpers.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 66 ++++++++++++--------------------------
1 file changed, 20 insertions(+), 46 deletions(-)
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 13dce4dcdbe14..1e16d7e8361a0 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -204,36 +204,10 @@ static const unsigned int lp8725_buck_uA[] = {
460000, 780000, 1050000, 1370000,
};
-static int lp872x_read_byte(struct lp872x *lp, u8 addr, u8 *data)
-{
- int ret;
- unsigned int val;
-
- ret = regmap_read(lp->regmap, addr, &val);
- if (ret < 0) {
- dev_err(lp->dev, "failed to read 0x%.2x\n", addr);
- return ret;
- }
-
- *data = (u8)val;
- return 0;
-}
-
-static inline int lp872x_write_byte(struct lp872x *lp, u8 addr, u8 data)
-{
- return regmap_write(lp->regmap, addr, data);
-}
-
-static inline int lp872x_update_bits(struct lp872x *lp, u8 addr,
- unsigned int mask, u8 data)
-{
- return regmap_update_bits(lp->regmap, addr, mask, data);
-}
-
static int lp872x_get_timestep_usec(struct lp872x *lp)
{
enum lp872x_id chip = lp->chipid;
- u8 val, mask, shift;
+ u32 val, mask, shift;
int *time_usec, size, ret;
int lp8720_time_usec[] = { 25, 50 };
int lp8725_time_usec[] = { 32, 64, 128, 256 };
@@ -255,7 +229,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp)
return -EINVAL;
}
- ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val);
+ ret = regmap_read(lp->regmap, LP872X_GENERAL_CFG, &val);
if (ret)
return ret;
@@ -272,7 +246,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev)
enum lp872x_regulator_id rid = rdev_get_id(rdev);
int time_step_us = lp872x_get_timestep_usec(lp);
int ret;
- u8 addr, val;
+ u32 addr, val;
if (time_step_us < 0)
return time_step_us;
@@ -291,7 +265,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev)
return -EINVAL;
}
- ret = lp872x_read_byte(lp, addr, &val);
+ ret = regmap_read(lp->regmap, addr, &val);
if (ret)
return ret;
@@ -313,9 +287,9 @@ static void lp872x_set_dvs(struct lp872x *lp, enum lp872x_dvs_sel dvs_sel,
static u8 lp872x_select_buck_vout_addr(struct lp872x *lp,
enum lp872x_regulator_id buck)
{
- u8 val, addr;
+ u32 val, addr;
- if (lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val))
+ if (regmap_read(lp->regmap, LP872X_GENERAL_CFG, &val))
return 0;
switch (buck) {
@@ -324,7 +298,7 @@ static u8 lp872x_select_buck_vout_addr(struct lp872x *lp,
addr = (lp->dvs_pin == GPIOD_OUT_HIGH) ?
LP8720_BUCK_VOUT1 : LP8720_BUCK_VOUT2;
} else {
- if (lp872x_read_byte(lp, LP8720_ENABLE, &val))
+ if (regmap_read(lp->regmap, LP8720_ENABLE, &val))
return 0;
addr = val & LP8720_DVS_SEL_M ?
@@ -369,7 +343,7 @@ static int lp872x_buck_set_voltage_sel(struct regulator_dev *rdev,
{
struct lp872x *lp = rdev_get_drvdata(rdev);
enum lp872x_regulator_id buck = rdev_get_id(rdev);
- u8 addr, mask = LP872X_VOUT_M;
+ u32 addr, mask = LP872X_VOUT_M;
struct lp872x_dvs *dvs = lp->pdata ? lp->pdata->dvs : NULL;
if (dvs && dvs->gpio)
@@ -379,21 +353,21 @@ static int lp872x_buck_set_voltage_sel(struct regulator_dev *rdev,
if (!lp872x_is_valid_buck_addr(addr))
return -EINVAL;
- return lp872x_update_bits(lp, addr, mask, selector);
+ return regmap_update_bits(lp->regmap, addr, mask, selector);
}
static int lp872x_buck_get_voltage_sel(struct regulator_dev *rdev)
{
struct lp872x *lp = rdev_get_drvdata(rdev);
enum lp872x_regulator_id buck = rdev_get_id(rdev);
- u8 addr, val;
+ u32 addr, val;
int ret;
addr = lp872x_select_buck_vout_addr(lp, buck);
if (!lp872x_is_valid_buck_addr(addr))
return -EINVAL;
- ret = lp872x_read_byte(lp, addr, &val);
+ ret = regmap_read(lp->regmap, addr, &val);
if (ret)
return ret;
@@ -404,7 +378,7 @@ static int lp872x_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
{
struct lp872x *lp = rdev_get_drvdata(rdev);
enum lp872x_regulator_id buck = rdev_get_id(rdev);
- u8 addr, mask, shift, val;
+ u32 addr, mask, shift, val;
switch (buck) {
case LP8720_ID_BUCK:
@@ -433,14 +407,14 @@ static int lp872x_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
else
return -EINVAL;
- return lp872x_update_bits(lp, addr, mask, val);
+ return regmap_update_bits(lp->regmap, addr, mask, val);
}
static unsigned int lp872x_buck_get_mode(struct regulator_dev *rdev)
{
struct lp872x *lp = rdev_get_drvdata(rdev);
enum lp872x_regulator_id buck = rdev_get_id(rdev);
- u8 addr, mask, val;
+ u32 addr, mask, val;
int ret;
switch (buck) {
@@ -460,7 +434,7 @@ static unsigned int lp872x_buck_get_mode(struct regulator_dev *rdev)
return -EINVAL;
}
- ret = lp872x_read_byte(lp, addr, &val);
+ ret = regmap_read(lp->regmap, addr, &val);
if (ret)
return ret;
@@ -728,8 +702,8 @@ static int lp872x_init_dvs(struct lp872x *lp)
{
struct lp872x_dvs *dvs = lp->pdata ? lp->pdata->dvs : NULL;
enum gpiod_flags pinstate;
- u8 mask[] = { LP8720_EXT_DVS_M, LP8725_DVS1_M | LP8725_DVS2_M };
- u8 default_dvs_mode[] = { LP8720_DEFAULT_DVS, LP8725_DEFAULT_DVS };
+ u32 mask[] = { LP8720_EXT_DVS_M, LP8725_DVS1_M | LP8725_DVS2_M };
+ u32 default_dvs_mode[] = { LP8720_DEFAULT_DVS, LP8725_DEFAULT_DVS };
if (!dvs)
goto set_default_dvs_mode;
@@ -750,8 +724,8 @@ static int lp872x_init_dvs(struct lp872x *lp)
return 0;
set_default_dvs_mode:
- return lp872x_update_bits(lp, LP872X_GENERAL_CFG, mask[lp->chipid],
- default_dvs_mode[lp->chipid]);
+ return regmap_update_bits(lp->regmap, LP872X_GENERAL_CFG, mask[lp->chipid],
+ default_dvs_mode[lp->chipid]);
}
static int lp872x_hw_enable(struct lp872x *lp)
@@ -786,7 +760,7 @@ static int lp872x_config(struct lp872x *lp)
if (!pdata || !pdata->update_config)
goto init_dvs;
- ret = lp872x_write_byte(lp, LP872X_GENERAL_CFG, pdata->general_config);
+ ret = regmap_write(lp->regmap, LP872X_GENERAL_CFG, pdata->general_config);
if (ret)
return ret;
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 5/7] regulator: lp872x: Remove platform_data based probing
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
` (3 preceding siblings ...)
2026-10-06 15:44 ` [PATCH v1 4/7] regulator: lp872x: Remove redundant regmap wrappers Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 6/7] regulator: lp872x: Add support for input and regulator power supplies Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 7/7] regulator: lp872x: Use macro to fill regulator descriptor Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
The platform_data-based probing is tightly integrated into the lp872x
driver structure itself; removing just the platform data support is
impossible without remodeling major parts of the probe sequence.
The lp872x_platform_data structure was removed, and its contents were
incorporated into the driver private structure and lp872x_chip_info (which
holds differences between the LP8720 and LP8725). The
lp872x_populate_pdata_from_dt() helper was removed: general Device Tree
parsing code was integrated directly into the probe function, and
DVS-related code was consolidated into lp872x_init_dvs().
lp872x_hw_enable() and lp872x_config() helpers were folded into probe().
i2c_client_get_device_id() was switched to i2c_get_match_data(). Finally,
of_regulator_match structures were dropped, and
lp872x_regulator_register() was upgraded to rely on the core regulator
registration framework.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 320 ++++++++++---------------------------
1 file changed, 84 insertions(+), 236 deletions(-)
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 1e16d7e8361a0..3d95ca7fa0246 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -14,7 +14,7 @@
#include <linux/delay.h>
#include <linux/regulator/driver.h>
#include <linux/platform_device.h>
-#include <linux/of.h>
+#include <linux/property.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
@@ -92,8 +92,6 @@
/* dump registers in regmap-debugfs */
#define MAX_REGISTERS 0x0F
-#define LP872X_MAX_REGULATORS 9
-
#define LP8720_ENABLE_DELAY 200
#define LP8725_ENABLE_DELAY 30000
@@ -130,31 +128,22 @@ enum lp872x_dvs_sel {
SEL_V2,
};
-struct lp872x_dvs {
- struct gpio_desc *gpio;
- enum lp872x_dvs_sel vsel;
- enum gpiod_flags init_state;
-};
-
-struct lp872x_regulator_data {
- enum lp872x_regulator_id id;
- struct regulator_init_data *init_data;
-};
-
-struct lp872x_platform_data {
- u8 general_config;
- bool update_config;
- struct lp872x_regulator_data regulator_data[LP872X_MAX_REGULATORS];
- struct lp872x_dvs *dvs;
- struct gpio_desc *enable_gpio;
+struct lp872x_chip_info {
+ const struct regulator_desc *rdesc;
+ int num_regulators;
+ enum lp872x_id chipid;
};
struct lp872x {
struct regmap *regmap;
struct device *dev;
- enum lp872x_id chipid;
- struct lp872x_platform_data *pdata;
- int num_regulators;
+
+ struct gpio_desc *enable_gpio;
+ struct gpio_desc *dvs_gpio;
+
+ const struct lp872x_chip_info *info;
+
+ enum lp872x_dvs_sel vsel;
enum gpiod_flags dvs_pin;
};
@@ -206,7 +195,7 @@ static const unsigned int lp8725_buck_uA[] = {
static int lp872x_get_timestep_usec(struct lp872x *lp)
{
- enum lp872x_id chip = lp->chipid;
+ enum lp872x_id chip = lp->info->chipid;
u32 val, mask, shift;
int *time_usec, size, ret;
int lp8720_time_usec[] = { 25, 50 };
@@ -344,10 +333,9 @@ static int lp872x_buck_set_voltage_sel(struct regulator_dev *rdev,
struct lp872x *lp = rdev_get_drvdata(rdev);
enum lp872x_regulator_id buck = rdev_get_id(rdev);
u32 addr, mask = LP872X_VOUT_M;
- struct lp872x_dvs *dvs = lp->pdata ? lp->pdata->dvs : NULL;
- if (dvs && dvs->gpio)
- lp872x_set_dvs(lp, dvs->vsel, dvs->gpio);
+ if (lp->dvs_gpio)
+ lp872x_set_dvs(lp, lp->vsel, lp->dvs_gpio);
addr = lp872x_select_buck_vout_addr(lp, buck);
if (!lp872x_is_valid_buck_addr(addr))
@@ -700,110 +688,45 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
static int lp872x_init_dvs(struct lp872x *lp)
{
- struct lp872x_dvs *dvs = lp->pdata ? lp->pdata->dvs : NULL;
- enum gpiod_flags pinstate;
+ struct device *dev = lp->dev;
u32 mask[] = { LP8720_EXT_DVS_M, LP8725_DVS1_M | LP8725_DVS2_M };
u32 default_dvs_mode[] = { LP8720_DEFAULT_DVS, LP8725_DEFAULT_DVS };
+ u8 dvs_state;
- if (!dvs)
- goto set_default_dvs_mode;
-
- if (!dvs->gpio)
- goto set_default_dvs_mode;
-
- pinstate = dvs->init_state;
- dvs->gpio = devm_gpiod_get_optional(lp->dev, "ti,dvs", pinstate);
-
- if (IS_ERR(dvs->gpio)) {
- dev_err(lp->dev, "gpio request err: %ld\n", PTR_ERR(dvs->gpio));
- return PTR_ERR(dvs->gpio);
- }
-
- lp->dvs_pin = pinstate;
-
- return 0;
-
-set_default_dvs_mode:
- return regmap_update_bits(lp->regmap, LP872X_GENERAL_CFG, mask[lp->chipid],
- default_dvs_mode[lp->chipid]);
-}
-
-static int lp872x_hw_enable(struct lp872x *lp)
-{
- if (!lp->pdata)
- return -EINVAL;
-
- if (!lp->pdata->enable_gpio)
- return 0;
+ device_property_read_u8(dev, "ti,dvs-vsel", (u8 *)&lp->vsel);
+ device_property_read_u8(dev, "ti,dvs-state", &dvs_state);
+ lp->dvs_pin = dvs_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
- /* Always set enable GPIO high. */
- lp->pdata->enable_gpio = devm_gpiod_get_optional(lp->dev, "enable", GPIOD_OUT_HIGH);
- if (IS_ERR(lp->pdata->enable_gpio)) {
- dev_err(lp->dev, "gpio request err: %ld\n", PTR_ERR(lp->pdata->enable_gpio));
- return PTR_ERR(lp->pdata->enable_gpio);
+ lp->dvs_gpio = devm_gpiod_get_optional(dev, "dvs", lp->dvs_pin);
+ if (IS_ERR(lp->dvs_gpio)) {
+ dev_err(dev, "gpio request err: %ld\n", PTR_ERR(lp->dvs_gpio));
+ return PTR_ERR(lp->dvs_gpio);
}
- /* Each chip has a different enable delay. */
- if (lp->chipid == LP8720)
- usleep_range(LP8720_ENABLE_DELAY, 1.5 * LP8720_ENABLE_DELAY);
- else
- usleep_range(LP8725_ENABLE_DELAY, 1.5 * LP8725_ENABLE_DELAY);
+ if (!lp->dvs_gpio)
+ return regmap_update_bits(lp->regmap, LP872X_GENERAL_CFG,
+ mask[lp->info->chipid],
+ default_dvs_mode[lp->info->chipid]);
return 0;
}
-static int lp872x_config(struct lp872x *lp)
-{
- struct lp872x_platform_data *pdata = lp->pdata;
- int ret;
-
- if (!pdata || !pdata->update_config)
- goto init_dvs;
-
- ret = regmap_write(lp->regmap, LP872X_GENERAL_CFG, pdata->general_config);
- if (ret)
- return ret;
-
-init_dvs:
- return lp872x_init_dvs(lp);
-}
-
-static struct regulator_init_data
-*lp872x_find_regulator_init_data(int id, struct lp872x *lp)
-{
- struct lp872x_platform_data *pdata = lp->pdata;
- int i;
-
- if (!pdata)
- return NULL;
-
- for (i = 0; i < lp->num_regulators; i++) {
- if (pdata->regulator_data[i].id == id)
- return pdata->regulator_data[i].init_data;
- }
-
- return NULL;
-}
-
static int lp872x_regulator_register(struct lp872x *lp)
{
- const struct regulator_desc *desc;
+ const struct regulator_desc *desc = lp->info->rdesc;
+ int num_regulators = lp->info->num_regulators;
struct regulator_config cfg = { };
+ struct device *dev = lp->dev;
struct regulator_dev *rdev;
- int i;
-
- for (i = 0; i < lp->num_regulators; i++) {
- desc = (lp->chipid == LP8720) ? &lp8720_regulator_desc[i] :
- &lp8725_regulator_desc[i];
- cfg.dev = lp->dev;
- cfg.init_data = lp872x_find_regulator_init_data(desc->id, lp);
- cfg.driver_data = lp;
- cfg.regmap = lp->regmap;
+ cfg.dev = dev;
+ cfg.driver_data = lp;
+ cfg.regmap = lp->regmap;
- rdev = devm_regulator_register(lp->dev, desc, &cfg);
+ for (int i = 0; i < num_regulators; i++) {
+ rdev = devm_regulator_register(dev, &desc[i], &cfg);
if (IS_ERR(rdev)) {
- dev_err(lp->dev, "regulator register err");
+ dev_err(dev, "regulator register err");
return PTR_ERR(rdev);
}
}
@@ -817,152 +740,77 @@ static const struct regmap_config lp872x_regmap_config = {
.max_register = MAX_REGISTERS,
};
-#ifdef CONFIG_OF
-
-#define LP872X_VALID_OPMODE (REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL)
-
-static struct of_regulator_match lp8720_matches[] = {
- { .name = "ldo1", .driver_data = (void *)LP8720_ID_LDO1, },
- { .name = "ldo2", .driver_data = (void *)LP8720_ID_LDO2, },
- { .name = "ldo3", .driver_data = (void *)LP8720_ID_LDO3, },
- { .name = "ldo4", .driver_data = (void *)LP8720_ID_LDO4, },
- { .name = "ldo5", .driver_data = (void *)LP8720_ID_LDO5, },
- { .name = "buck", .driver_data = (void *)LP8720_ID_BUCK, },
-};
-
-static struct of_regulator_match lp8725_matches[] = {
- { .name = "ldo1", .driver_data = (void *)LP8725_ID_LDO1, },
- { .name = "ldo2", .driver_data = (void *)LP8725_ID_LDO2, },
- { .name = "ldo3", .driver_data = (void *)LP8725_ID_LDO3, },
- { .name = "ldo4", .driver_data = (void *)LP8725_ID_LDO4, },
- { .name = "ldo5", .driver_data = (void *)LP8725_ID_LDO5, },
- { .name = "lilo1", .driver_data = (void *)LP8725_ID_LILO1, },
- { .name = "lilo2", .driver_data = (void *)LP8725_ID_LILO2, },
- { .name = "buck1", .driver_data = (void *)LP8725_ID_BUCK1, },
- { .name = "buck2", .driver_data = (void *)LP8725_ID_BUCK2, },
-};
-
-static struct lp872x_platform_data
-*lp872x_populate_pdata_from_dt(struct device *dev, enum lp872x_id which)
-{
- struct device_node *np = dev->of_node;
- struct lp872x_platform_data *pdata;
- struct of_regulator_match *match;
- int num_matches;
- int count;
- int i;
- u8 dvs_state;
-
- pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata)
- return ERR_PTR(-ENOMEM);
-
- of_property_read_u8(np, "ti,general-config", &pdata->general_config);
- pdata->update_config = of_property_read_bool(np, "ti,update-config");
-
- pdata->dvs = devm_kzalloc(dev, sizeof(struct lp872x_dvs), GFP_KERNEL);
- if (!pdata->dvs)
- return ERR_PTR(-ENOMEM);
-
- of_property_read_u8(np, "ti,dvs-vsel", (u8 *)&pdata->dvs->vsel);
- of_property_read_u8(np, "ti,dvs-state", &dvs_state);
- pdata->dvs->init_state = dvs_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
-
- if (of_get_child_count(np) == 0)
- goto out;
-
- switch (which) {
- case LP8720:
- match = lp8720_matches;
- num_matches = ARRAY_SIZE(lp8720_matches);
- break;
- case LP8725:
- match = lp8725_matches;
- num_matches = ARRAY_SIZE(lp8725_matches);
- break;
- default:
- goto out;
- }
-
- count = of_regulator_match(dev, np, match, num_matches);
- if (count <= 0)
- goto out;
-
- for (i = 0; i < num_matches; i++) {
- pdata->regulator_data[i].id =
- (uintptr_t)match[i].driver_data;
- pdata->regulator_data[i].init_data = match[i].init_data;
- }
-out:
- return pdata;
-}
-#else
-static struct lp872x_platform_data
-*lp872x_populate_pdata_from_dt(struct device *dev, enum lp872x_id which)
-{
- return NULL;
-}
-#endif
-
static int lp872x_probe(struct i2c_client *cl)
{
- const struct i2c_device_id *id = i2c_client_get_device_id(cl);
+ struct device *dev = &cl->dev;
struct lp872x *lp;
- struct lp872x_platform_data *pdata;
+ u8 general_config;
int ret;
- static const int lp872x_num_regulators[] = {
- [LP8720] = LP8720_NUM_REGULATORS,
- [LP8725] = LP8725_NUM_REGULATORS,
- };
-
- if (cl->dev.of_node) {
- pdata = lp872x_populate_pdata_from_dt(&cl->dev,
- (enum lp872x_id)id->driver_data);
- if (IS_ERR(pdata))
- return PTR_ERR(pdata);
- } else {
- pdata = dev_get_platdata(&cl->dev);
- }
- lp = devm_kzalloc(&cl->dev, sizeof(struct lp872x), GFP_KERNEL);
+ lp = devm_kzalloc(dev, sizeof(*lp), GFP_KERNEL);
if (!lp)
return -ENOMEM;
- lp->num_regulators = lp872x_num_regulators[id->driver_data];
+ lp->info = i2c_get_match_data(cl);
+ if (!lp->info)
+ return -ENODEV;
lp->regmap = devm_regmap_init_i2c(cl, &lp872x_regmap_config);
- if (IS_ERR(lp->regmap)) {
- ret = PTR_ERR(lp->regmap);
- dev_err(&cl->dev, "regmap init i2c err: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(lp->regmap))
+ return dev_err_probe(dev, PTR_ERR(lp->regmap),
+ "Failed to init regmap\n");
- lp->dev = &cl->dev;
- lp->pdata = pdata;
- lp->chipid = id->driver_data;
+ lp->dev = dev;
i2c_set_clientdata(cl, lp);
- ret = lp872x_hw_enable(lp);
- if (ret)
- return ret;
+ /* Always set enable GPIO high. */
+ lp->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH);
+ if (IS_ERR(lp->enable_gpio))
+ return dev_err_probe(dev, PTR_ERR(lp->enable_gpio),
+ "Failed to request gpio\n");
+
+ /* Each chip has a different enable delay. */
+ if (lp->info->chipid == LP8720)
+ usleep_range(LP8720_ENABLE_DELAY, 1.5 * LP8720_ENABLE_DELAY);
+ else
+ usleep_range(LP8725_ENABLE_DELAY, 1.5 * LP8725_ENABLE_DELAY);
- ret = lp872x_config(lp);
+ device_property_read_u8(dev, "ti,general-config", &general_config);
+ if (device_property_read_bool(dev, "ti,update-config")) {
+ ret = regmap_write(lp->regmap, LP872X_GENERAL_CFG, general_config);
+ if (ret)
+ return ret;
+ }
+
+ ret = lp872x_init_dvs(lp);
if (ret)
return ret;
return lp872x_regulator_register(lp);
}
-static const struct of_device_id lp872x_dt_ids[] __maybe_unused = {
- { .compatible = "ti,lp8720", },
- { .compatible = "ti,lp8725", },
+static const struct lp872x_chip_info lp8720_data = {
+ .rdesc = lp8720_regulator_desc,
+ .num_regulators = LP8720_NUM_REGULATORS,
+ .chipid = LP8720,
+};
+
+static const struct lp872x_chip_info lp8725_data = {
+ .rdesc = lp8725_regulator_desc,
+ .num_regulators = LP8725_NUM_REGULATORS,
+ .chipid = LP8725,
+};
+
+static const struct of_device_id lp872x_dt_ids[] = {
+ { .compatible = "ti,lp8720", .data = &lp8720_data },
+ { .compatible = "ti,lp8725", .data = &lp8725_data },
{ }
};
MODULE_DEVICE_TABLE(of, lp872x_dt_ids);
static const struct i2c_device_id lp872x_ids[] = {
- { .name = "lp8720", .driver_data = LP8720 },
- { .name = "lp8725", .driver_data = LP8725 },
+ { .name = "lp8720", .driver_data = (kernel_ulong_t)&lp8720_data },
+ { .name = "lp8725", .driver_data = (kernel_ulong_t)&lp8725_data },
{ }
};
MODULE_DEVICE_TABLE(i2c, lp872x_ids);
@@ -971,7 +819,7 @@ static struct i2c_driver lp872x_driver = {
.driver = {
.name = "lp872x",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
- .of_match_table = of_match_ptr(lp872x_dt_ids),
+ .of_match_table = lp872x_dt_ids,
},
.probe = lp872x_probe,
.id_table = lp872x_ids,
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 6/7] regulator: lp872x: Add support for input and regulator power supplies
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
` (4 preceding siblings ...)
2026-10-06 15:44 ` [PATCH v1 5/7] regulator: lp872x: Remove platform_data based probing Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 7/7] regulator: lp872x: Use macro to fill regulator descriptor Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
The LP872x support dedicated main power supply input usually shared with
parent power supply for one of internal regulators (ldo1).
Add support for retrieving and managing these supply regulators using the
regulator framework to ensure proper power supply dependencies and
power-up sequencing.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 3d95ca7fa0246..df19a5cc94d0d 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -471,6 +471,7 @@ static const struct regulator_ops lp8725_buck_ops = {
static const struct regulator_desc lp8720_regulator_desc[] = {
{
.name = "ldo1",
+ .supply_name = "vbatt",
.of_match = of_match_ptr("ldo1"),
.id = LP8720_ID_LDO1,
.ops = &lp872x_ldo_ops,
@@ -485,6 +486,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
},
{
.name = "ldo2",
+ .supply_name = "vin1",
.of_match = of_match_ptr("ldo2"),
.id = LP8720_ID_LDO2,
.ops = &lp872x_ldo_ops,
@@ -499,6 +501,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
},
{
.name = "ldo3",
+ .supply_name = "vin1",
.of_match = of_match_ptr("ldo3"),
.id = LP8720_ID_LDO3,
.ops = &lp872x_ldo_ops,
@@ -513,6 +516,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
},
{
.name = "ldo4",
+ .supply_name = "vin2",
.of_match = of_match_ptr("ldo4"),
.id = LP8720_ID_LDO4,
.ops = &lp872x_ldo_ops,
@@ -527,6 +531,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
},
{
.name = "ldo5",
+ .supply_name = "vin2",
.of_match = of_match_ptr("ldo5"),
.id = LP8720_ID_LDO5,
.ops = &lp872x_ldo_ops,
@@ -541,6 +546,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
},
{
.name = "buck",
+ .supply_name = "vinb",
.of_match = of_match_ptr("buck"),
.id = LP8720_ID_BUCK,
.ops = &lp8720_buck_ops,
@@ -556,6 +562,7 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
static const struct regulator_desc lp8725_regulator_desc[] = {
{
.name = "ldo1",
+ .supply_name = "vin1",
.of_match = of_match_ptr("ldo1"),
.id = LP8725_ID_LDO1,
.ops = &lp872x_ldo_ops,
@@ -570,6 +577,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "ldo2",
+ .supply_name = "vin2",
.of_match = of_match_ptr("ldo2"),
.id = LP8725_ID_LDO2,
.ops = &lp872x_ldo_ops,
@@ -584,6 +592,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "ldo3",
+ .supply_name = "vin2",
.of_match = of_match_ptr("ldo3"),
.id = LP8725_ID_LDO3,
.ops = &lp872x_ldo_ops,
@@ -598,6 +607,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "ldo4",
+ .supply_name = "vin3",
.of_match = of_match_ptr("ldo4"),
.id = LP8725_ID_LDO4,
.ops = &lp872x_ldo_ops,
@@ -612,6 +622,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "ldo5",
+ .supply_name = "vin3",
.of_match = of_match_ptr("ldo5"),
.id = LP8725_ID_LDO5,
.ops = &lp872x_ldo_ops,
@@ -626,6 +637,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "lilo1",
+ .supply_name = "vinlilo1",
.of_match = of_match_ptr("lilo1"),
.id = LP8725_ID_LILO1,
.ops = &lp872x_ldo_ops,
@@ -640,6 +652,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "lilo2",
+ .supply_name = "vinlilo2",
.of_match = of_match_ptr("lilo2"),
.id = LP8725_ID_LILO2,
.ops = &lp872x_ldo_ops,
@@ -654,6 +667,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "buck1",
+ .supply_name = "vinb",
.of_match = of_match_ptr("buck1"),
.id = LP8725_ID_BUCK1,
.ops = &lp8725_buck_ops,
@@ -670,6 +684,7 @@ static const struct regulator_desc lp8725_regulator_desc[] = {
},
{
.name = "buck2",
+ .supply_name = "vinb",
.of_match = of_match_ptr("buck2"),
.id = LP8725_ID_BUCK2,
.ops = &lp8725_buck_ops,
@@ -743,6 +758,7 @@ static const struct regmap_config lp872x_regmap_config = {
static int lp872x_probe(struct i2c_client *cl)
{
struct device *dev = &cl->dev;
+ const char *in_supply_name;
struct lp872x *lp;
u8 general_config;
int ret;
@@ -760,6 +776,12 @@ static int lp872x_probe(struct i2c_client *cl)
return dev_err_probe(dev, PTR_ERR(lp->regmap),
"Failed to init regmap\n");
+ /* LDO0 parent supplies chip itself */
+ in_supply_name = lp->info->rdesc[0].supply_name;
+ ret = devm_regulator_get_enable(dev, in_supply_name);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to enable supply regulator\n");
+
lp->dev = dev;
i2c_set_clientdata(cl, lp);
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 7/7] regulator: lp872x: Use macro to fill regulator descriptor
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
` (5 preceding siblings ...)
2026-10-06 15:44 ` [PATCH v1 6/7] regulator: lp872x: Add support for input and regulator power supplies Svyatoslav Ryhel
@ 2026-10-06 15:44 ` Svyatoslav Ryhel
6 siblings, 0 replies; 8+ messages in thread
From: Svyatoslav Ryhel @ 2026-10-06 15:44 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Svyatoslav Ryhel
Cc: linux-kernel, devicetree
Switch to using the macro for filling the LP872x regulator descriptor
to improve readability.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/regulator/lp872x.c | 275 ++++++++-----------------------------
1 file changed, 61 insertions(+), 214 deletions(-)
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index df19a5cc94d0d..2eae35228d006 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -468,82 +468,59 @@ static const struct regulator_ops lp8725_buck_ops = {
.get_current_limit = regulator_get_current_limit_regmap,
};
+#define LP872X_LDO(_id, match, supply, _volt_table, _vsel_reg, \
+ _enable_reg, _enable_mask) { \
+ .name = (match), \
+ .supply_name = (supply), \
+ .of_match = (match), \
+ .id = _id, \
+ .ops = &lp872x_ldo_ops, \
+ .n_voltages = ARRAY_SIZE(_volt_table), \
+ .volt_table = _volt_table, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .vsel_reg = _vsel_reg, \
+ .vsel_mask = LP872X_VOUT_M, \
+ .enable_reg = _enable_reg, \
+ .enable_mask = _enable_mask, \
+}
+
+#define LP8720_LDO(ids, match, supply, _volt_table) \
+ LP872X_LDO(LP8720_ID_##ids, match, supply, _volt_table, \
+ LP872X_##ids##_VOUT, LP8720_ENABLE, LP872X_EN_##ids##_M)
+
+#define LP8725_LDO(ids, match, supply) \
+ LP872X_LDO(LP8725_ID_##ids, match, supply, lp872x_ldo_vtbl, \
+ LP872X_##ids##_VOUT, LP8725_LDO_CTRL, LP872X_EN_##ids##_M)
+
+#define LP8725_LILO(ids, match, supply) \
+ LP872X_LDO(LP8725_ID_##ids, match, supply, lp8725_lilo_vtbl, \
+ LP8725_##ids##_VOUT, LP8725_LDO_CTRL, LP8725_EN_##ids##_M)
+
+#define LP8725_BUCK(ids, match) { \
+ .name = (match), \
+ .supply_name = "vinb", \
+ .of_match = (match), \
+ .id = LP8725_ID_##ids, \
+ .ops = &lp8725_buck_ops, \
+ .n_voltages = ARRAY_SIZE(lp8725_buck_vtbl), \
+ .volt_table = lp8725_buck_vtbl, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .enable_reg = LP872X_GENERAL_CFG, \
+ .enable_mask = LP8725_##ids##_EN_M, \
+ .curr_table = lp8725_buck_uA, \
+ .n_current_limits = ARRAY_SIZE(lp8725_buck_uA), \
+ .csel_reg = LP8725_##ids##_VOUT2, \
+ .csel_mask = LP8725_BUCK_CL_M, \
+}
+
static const struct regulator_desc lp8720_regulator_desc[] = {
- {
- .name = "ldo1",
- .supply_name = "vbatt",
- .of_match = of_match_ptr("ldo1"),
- .id = LP8720_ID_LDO1,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO1_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8720_ENABLE,
- .enable_mask = LP872X_EN_LDO1_M,
- },
- {
- .name = "ldo2",
- .supply_name = "vin1",
- .of_match = of_match_ptr("ldo2"),
- .id = LP8720_ID_LDO2,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO2_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8720_ENABLE,
- .enable_mask = LP872X_EN_LDO2_M,
- },
- {
- .name = "ldo3",
- .supply_name = "vin1",
- .of_match = of_match_ptr("ldo3"),
- .id = LP8720_ID_LDO3,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO3_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8720_ENABLE,
- .enable_mask = LP872X_EN_LDO3_M,
- },
- {
- .name = "ldo4",
- .supply_name = "vin2",
- .of_match = of_match_ptr("ldo4"),
- .id = LP8720_ID_LDO4,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp8720_ldo4_vtbl),
- .volt_table = lp8720_ldo4_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO4_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8720_ENABLE,
- .enable_mask = LP872X_EN_LDO4_M,
- },
- {
- .name = "ldo5",
- .supply_name = "vin2",
- .of_match = of_match_ptr("ldo5"),
- .id = LP8720_ID_LDO5,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO5_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8720_ENABLE,
- .enable_mask = LP872X_EN_LDO5_M,
- },
+ LP8720_LDO(LDO1, "ldo1", "vbatt", lp872x_ldo_vtbl),
+ LP8720_LDO(LDO2, "ldo2", "vin1", lp872x_ldo_vtbl),
+ LP8720_LDO(LDO3, "ldo3", "vin1", lp872x_ldo_vtbl),
+ LP8720_LDO(LDO4, "ldo4", "vin2", lp8720_ldo4_vtbl),
+ LP8720_LDO(LDO5, "ldo5", "vin2", lp872x_ldo_vtbl),
{
.name = "buck",
.supply_name = "vinb",
@@ -560,145 +537,15 @@ static const struct regulator_desc lp8720_regulator_desc[] = {
};
static const struct regulator_desc lp8725_regulator_desc[] = {
- {
- .name = "ldo1",
- .supply_name = "vin1",
- .of_match = of_match_ptr("ldo1"),
- .id = LP8725_ID_LDO1,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO1_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP872X_EN_LDO1_M,
- },
- {
- .name = "ldo2",
- .supply_name = "vin2",
- .of_match = of_match_ptr("ldo2"),
- .id = LP8725_ID_LDO2,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO2_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP872X_EN_LDO2_M,
- },
- {
- .name = "ldo3",
- .supply_name = "vin2",
- .of_match = of_match_ptr("ldo3"),
- .id = LP8725_ID_LDO3,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO3_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP872X_EN_LDO3_M,
- },
- {
- .name = "ldo4",
- .supply_name = "vin3",
- .of_match = of_match_ptr("ldo4"),
- .id = LP8725_ID_LDO4,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO4_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP872X_EN_LDO4_M,
- },
- {
- .name = "ldo5",
- .supply_name = "vin3",
- .of_match = of_match_ptr("ldo5"),
- .id = LP8725_ID_LDO5,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp872x_ldo_vtbl),
- .volt_table = lp872x_ldo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP872X_LDO5_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP872X_EN_LDO5_M,
- },
- {
- .name = "lilo1",
- .supply_name = "vinlilo1",
- .of_match = of_match_ptr("lilo1"),
- .id = LP8725_ID_LILO1,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp8725_lilo_vtbl),
- .volt_table = lp8725_lilo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP8725_LILO1_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP8725_EN_LILO1_M,
- },
- {
- .name = "lilo2",
- .supply_name = "vinlilo2",
- .of_match = of_match_ptr("lilo2"),
- .id = LP8725_ID_LILO2,
- .ops = &lp872x_ldo_ops,
- .n_voltages = ARRAY_SIZE(lp8725_lilo_vtbl),
- .volt_table = lp8725_lilo_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .vsel_reg = LP8725_LILO2_VOUT,
- .vsel_mask = LP872X_VOUT_M,
- .enable_reg = LP8725_LDO_CTRL,
- .enable_mask = LP8725_EN_LILO2_M,
- },
- {
- .name = "buck1",
- .supply_name = "vinb",
- .of_match = of_match_ptr("buck1"),
- .id = LP8725_ID_BUCK1,
- .ops = &lp8725_buck_ops,
- .n_voltages = ARRAY_SIZE(lp8725_buck_vtbl),
- .volt_table = lp8725_buck_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .enable_reg = LP872X_GENERAL_CFG,
- .enable_mask = LP8725_BUCK1_EN_M,
- .curr_table = lp8725_buck_uA,
- .n_current_limits = ARRAY_SIZE(lp8725_buck_uA),
- .csel_reg = LP8725_BUCK1_VOUT2,
- .csel_mask = LP8725_BUCK_CL_M,
- },
- {
- .name = "buck2",
- .supply_name = "vinb",
- .of_match = of_match_ptr("buck2"),
- .id = LP8725_ID_BUCK2,
- .ops = &lp8725_buck_ops,
- .n_voltages = ARRAY_SIZE(lp8725_buck_vtbl),
- .volt_table = lp8725_buck_vtbl,
- .type = REGULATOR_VOLTAGE,
- .owner = THIS_MODULE,
- .enable_reg = LP872X_GENERAL_CFG,
- .enable_mask = LP8725_BUCK2_EN_M,
- .curr_table = lp8725_buck_uA,
- .n_current_limits = ARRAY_SIZE(lp8725_buck_uA),
- .csel_reg = LP8725_BUCK2_VOUT2,
- .csel_mask = LP8725_BUCK_CL_M,
- },
+ LP8725_LDO(LDO1, "ldo1", "vin1"),
+ LP8725_LDO(LDO2, "ldo2", "vin2"),
+ LP8725_LDO(LDO3, "ldo3", "vin2"),
+ LP8725_LDO(LDO4, "ldo4", "vin3"),
+ LP8725_LDO(LDO5, "ldo5", "vin3"),
+ LP8725_LILO(LILO1, "lilo1", "vinlilo1"),
+ LP8725_LILO(LILO2, "lilo2", "vinlilo2"),
+ LP8725_BUCK(BUCK1, "buck1"),
+ LP8725_BUCK(BUCK2, "buck2"),
};
static int lp872x_init_dvs(struct lp872x *lp)
--
2.53.0
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-06 15:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-06 15:44 [PATCH v1 0/7] lp872x: remove platform_data based probing and adjustments Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 1/7] regulator: dt-bindings: ti,lp872x: Convert to DT schema Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 2/7] regulator: dt-bindings: ti,lp872x: Document input supplies Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 3/7] regulator: lp872x: Fold driver header into driver file Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 4/7] regulator: lp872x: Remove redundant regmap wrappers Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 5/7] regulator: lp872x: Remove platform_data based probing Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 6/7] regulator: lp872x: Add support for input and regulator power supplies Svyatoslav Ryhel
2026-10-06 15:44 ` [PATCH v1 7/7] regulator: lp872x: Use macro to fill regulator descriptor Svyatoslav Ryhel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®