devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators
@ 2024-08-12 13:52 Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators Andrei Simion
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion

In this series of patches, support for the *-supply property [1]  is added
(correlated with supply_name [2]) from the core regulator.
Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471
Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064

I modified the mcp16502.c driver and the dts that use this PMIC.
We added these improvements to provide a complete description of the board power scheme.

Snippet (as an example) from /sys/kernel/debug/regulator/regulator_summary
(for at91-sama7g5ek):
 # cat regulator_summary
 regulator                      use open bypass  opmode voltage current     min     max
---------------------------------------------------------------------------------------
 regulator-dummy                  1    0      0 unknown     0mV     0mA     0mV     0mV
 5V_MAIN                          6    6      0 unknown  5000mV     0mA  5000mV  5000mV
    VDD_IO                        5    4      0  normal  3300mV     0mA  3300mV  3300mV
       e1208000.mmc-vqmmc         1                                 0mA     0mV     0mV
       e1208000.mmc-vmmc          1                                 0mA  3300mV  3400mV
       e1204000.mmc-vmmc          1                                 0mA  3300mV  3400mV
       VDDOUT25                   3    2      0 unknown  2500mV     0mA  2500mV  2500mV
          e1000000.adc-vref       1                                 0mA     0mV     0mV
          e1000000.adc-vddana     1                                 0mA     0mV     0mV
    VDD_DDR                       1    0      0  normal  1350mV     0mA  1350mV  1350mV
    VDD_CORE                      1    0      0  normal  1150mV     0mA  1150mV  1150mV
    VDD_OTHER                     2    1      0  normal  1050mV     0mA  1050mV  1250mV
       cpu0-cpu                   1                                 0mA  1050mV  1225mV
    LDO1                          2    1      0 unknown  1800mV     0mA  1800mV  1800mV
       e1204000.mmc-vqmmc         1                                 0mA     0mV     0mV
    LDO2

-------------------------------------------------------------------------------------------

Changelog:

v1 -> v2:
 - drop (lvin|pvin[1-4])-supply from each regulators sub-node
 - add voltage input supply documentation in the yaml schema
 - add lvin-supply, pvin[1-4]-supply to PMIC node

Andrei Simion (7):
  regulator: mcp16502: Add supplier for regulators
  regulator: dt-bindings: microchip,mcp16502: Add voltage input supply
    documentation
  ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes
  ARM: dts: microchip: at91-sama7g54_curiosity: Add reg_5v to supply
    PMIC nodes
  ARM: dts: microchip: at91-sama5d2_icp: Add reg_5v to supply PMIC nodes
  ARM: dts: microchip: at91-sama5d27_wlsom1: Add reg_5v to supply PMIC
    nodes
  ARM: dts: microchip: sama5d29_curiosity: Add reg_5v to supply PMIC
    nodes

 .../regulator/microchip,mcp16502.yaml         | 20 +++++++++++++++++++
 .../dts/microchip/at91-sama5d27_wlsom1.dtsi   | 13 ++++++++++++
 .../dts/microchip/at91-sama5d29_curiosity.dts | 13 ++++++++++++
 .../boot/dts/microchip/at91-sama5d2_icp.dts   | 13 ++++++++++++
 .../dts/microchip/at91-sama7g54_curiosity.dts | 13 ++++++++++++
 .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 13 ++++++++++++
 drivers/regulator/mcp16502.c                  | 17 ++++++++--------
 7 files changed, 94 insertions(+), 8 deletions(-)


base-commit: 9e6869691724b12e1f43655eeedc35fade38120c
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation Andrei Simion
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Based on the datasheet [1] (Block Diagram) PVIN[1-4] and LVIN
represent the input voltage supply for each BUCKs respective LDOs.
Update the driver to align with the datasheet [1].

[1]: https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP16502-Data-Sheet-DS20006275.pdf

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- no update
---
 drivers/regulator/mcp16502.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c
index 5de9d4fa5113..b34ae0bbba6f 100644
--- a/drivers/regulator/mcp16502.c
+++ b/drivers/regulator/mcp16502.c
@@ -107,9 +107,10 @@ static unsigned int mcp16502_of_map_mode(unsigned int mode)
 	return REGULATOR_MODE_INVALID;
 }
 
-#define MCP16502_REGULATOR(_name, _id, _ranges, _ops, _ramp_table)	\
+#define MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table)	\
 	[_id] = {							\
 		.name			= _name,			\
+		.supply_name		= #_sn,				\
 		.regulators_node	= "regulators",			\
 		.id			= _id,				\
 		.ops			= &(_ops),			\
@@ -467,18 +468,18 @@ static const struct linear_range b234_ranges[] = {
 };
 
 static const struct regulator_desc mcp16502_desc[] = {
-	/* MCP16502_REGULATOR(_name, _id, ranges, regulator_ops, ramp_table) */
-	MCP16502_REGULATOR("VDD_IO", BUCK1, b1l12_ranges, mcp16502_buck_ops,
+	/* MCP16502_REGULATOR(_name, _id, _sn, _ranges, _ops, _ramp_table) */
+	MCP16502_REGULATOR("VDD_IO", BUCK1, pvin1, b1l12_ranges, mcp16502_buck_ops,
 			   mcp16502_ramp_b1l12),
-	MCP16502_REGULATOR("VDD_DDR", BUCK2, b234_ranges, mcp16502_buck_ops,
+	MCP16502_REGULATOR("VDD_DDR", BUCK2, pvin2, b234_ranges, mcp16502_buck_ops,
 			   mcp16502_ramp_b234),
-	MCP16502_REGULATOR("VDD_CORE", BUCK3, b234_ranges, mcp16502_buck_ops,
+	MCP16502_REGULATOR("VDD_CORE", BUCK3, pvin3, b234_ranges, mcp16502_buck_ops,
 			   mcp16502_ramp_b234),
-	MCP16502_REGULATOR("VDD_OTHER", BUCK4, b234_ranges, mcp16502_buck_ops,
+	MCP16502_REGULATOR("VDD_OTHER", BUCK4, pvin4, b234_ranges, mcp16502_buck_ops,
 			   mcp16502_ramp_b234),
-	MCP16502_REGULATOR("LDO1", LDO1, b1l12_ranges, mcp16502_ldo_ops,
+	MCP16502_REGULATOR("LDO1", LDO1, lvin, b1l12_ranges, mcp16502_ldo_ops,
 			   mcp16502_ramp_b1l12),
-	MCP16502_REGULATOR("LDO2", LDO2, b1l12_ranges, mcp16502_ldo_ops,
+	MCP16502_REGULATOR("LDO2", LDO2, lvin, b1l12_ranges, mcp16502_ldo_ops,
 			   mcp16502_ramp_b1l12)
 };
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-14  9:07   ` Krzysztof Kozlowski
  2024-08-12 13:52 ` [PATCH v2 3/7] ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes Andrei Simion
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion

Update the yaml schema with info about input supply phandle for
each buck and ldo according with the PMIC MCP16502 Datasheet.

Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- added in v2
---
 .../regulator/microchip,mcp16502.yaml         | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml b/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
index 1aca3646789e..c3e1fc6e260e 100644
--- a/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
+++ b/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
@@ -28,6 +28,21 @@ properties:
   reg:
     maxItems: 1
 
+  lvin-supply:
+    description: Input supply phandle for LDO1 and LDO2
+
+  pvin1-supply:
+    description: Input supply phandle for VDD_IO (BUCK1)
+
+  pvin2-supply:
+    description: Input supply phandle for VDD_DDR (BUCK2)
+
+  pvin3-supply:
+    description: Input supply phandle for VDD_CORE (BUCK3)
+
+  pvin4-supply:
+    description: Input supply phandle for VDD_OTHER (BUCK4)
+
   regulators:
     type: object
     additionalProperties: false
@@ -68,6 +83,11 @@ examples:
         pmic@5b {
             compatible = "microchip,mcp16502";
             reg = <0x5b>;
+            lvin-supply = <&reg_5v>;
+            pvin1-supply = <&reg_5v>;
+            pvin2-supply = <&reg_5v>;
+            pvin3-supply = <&reg_5v>;
+            pvin4-supply = <&reg_5v>;
 
             regulators {
                 VDD_IO {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/7] ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 4/7] ARM: dts: microchip: at91-sama7g54_curiosity: " Andrei Simion
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Align with the datasheet by adding regulator-5v which supplies
each node from the regulator using phandle to regulator-5v
through pvin[1-4]-supply and lvin-supply.

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- drop (lvin|pvin[1-4])-supply from each regulators sub-node
- add lvin-supply, pvin[1-4]-supply to PMIC node
---
 arch/arm/boot/dts/microchip/at91-sama7g5ek.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
index 40f4480e298b..ed75d491a246 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g5ek.dts
@@ -88,6 +88,14 @@ memory@60000000 {
 		reg = <0x60000000 0x20000000>;
 	};
 
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "5V_MAIN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
 	sound: sound {
 		compatible = "simple-audio-card";
 		simple-audio-card,name = "sama7g5ek audio";
@@ -239,6 +247,11 @@ i2c1: i2c@600 {
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
+			lvin-supply = <&reg_5v>;
+			pvin1-supply = <&reg_5v>;
+			pvin2-supply = <&reg_5v>;
+			pvin3-supply = <&reg_5v>;
+			pvin4-supply = <&reg_5v>;
 			status = "okay";
 
 			regulators {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/7] ARM: dts: microchip: at91-sama7g54_curiosity: Add reg_5v to supply PMIC nodes
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (2 preceding siblings ...)
  2024-08-12 13:52 ` [PATCH v2 3/7] ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 5/7] ARM: dts: microchip: at91-sama5d2_icp: " Andrei Simion
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Align with the datasheet by adding regulator-5v which
supplies each node from the regulator using phandle to
regulator-5v through pvin[1-4]-supply and lvin-supply.

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- drop (lvin|pvin[1-4])-supply from each regulators sub-node
- add lvin-supply, pvin[1-4]-supply to PMIC node
---
 .../boot/dts/microchip/at91-sama7g54_curiosity.dts  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
index 009d2c832421..645e49fdb7fe 100644
--- a/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama7g54_curiosity.dts
@@ -72,6 +72,14 @@ memory@60000000 {
 		device_type = "memory";
 		reg = <0x60000000 0x10000000>; /* 256 MiB DDR3L-1066 16-bit */
 	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "5V_MAIN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
 
 &adc {
@@ -189,6 +197,11 @@ eeprom@51 {
 		pmic@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
+			lvin-supply = <&reg_5v>;
+			pvin1-supply = <&reg_5v>;
+			pvin2-supply = <&reg_5v>;
+			pvin3-supply = <&reg_5v>;
+			pvin4-supply = <&reg_5v>;
 
 			regulators {
 				vdd_3v3: VDD_IO {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 5/7] ARM: dts: microchip: at91-sama5d2_icp: Add reg_5v to supply PMIC nodes
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (3 preceding siblings ...)
  2024-08-12 13:52 ` [PATCH v2 4/7] ARM: dts: microchip: at91-sama7g54_curiosity: " Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 6/7] ARM: dts: microchip: at91-sama5d27_wlsom1: " Andrei Simion
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Align with the datasheet by adding regulator-5v which
supplies each node from the regulator using phandle to
regulator-5v through pvin[1-4]-supply and lvin-supply.

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- drop (lvin|pvin[1-4])-supply from each regulators sub-node
- add lvin-supply, pvin[1-4]-supply to PMIC node
---
 arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
index 999adeca6f33..5e2bb517a480 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d2_icp.dts
@@ -78,6 +78,14 @@ led-blue {
 			linux,default-trigger = "heartbeat";
 		};
 	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VDD_MAIN_5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
 
 &adc {
@@ -190,6 +198,11 @@ i2c6: i2c@600 {
 		mcp16502@5b {
 			compatible = "microchip,mcp16502";
 			reg = <0x5b>;
+			lvin-supply = <&reg_5v>;
+			pvin1-supply = <&reg_5v>;
+			pvin2-supply = <&reg_5v>;
+			pvin3-supply = <&reg_5v>;
+			pvin4-supply = <&reg_5v>;
 			status = "okay";
 			lpm-gpios = <&pioBU 7 GPIO_ACTIVE_LOW>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 6/7] ARM: dts: microchip: at91-sama5d27_wlsom1: Add reg_5v to supply PMIC nodes
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (4 preceding siblings ...)
  2024-08-12 13:52 ` [PATCH v2 5/7] ARM: dts: microchip: at91-sama5d2_icp: " Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 13:52 ` [PATCH v2 7/7] ARM: dts: microchip: sama5d29_curiosity: " Andrei Simion
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Align with the datasheet by adding regulator-5v which
supplies each node from the regulator using phandle to
regulator-5v through pvin[1-4]-supply and lvin-supply.

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- drop (lvin|pvin[1-4])-supply from each regulators sub-node
- add lvin-supply, pvin[1-4]-supply to PMIC node
---
 .../boot/dts/microchip/at91-sama5d27_wlsom1.dtsi    | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
index 4617805c7748..c173f49cb910 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
+++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1.dtsi
@@ -31,6 +31,14 @@ main_xtal {
 		};
 	};
 
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VDD_MAIN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-wilc1000";
 		reset-gpios = <&pioA PIN_PA27 GPIO_ACTIVE_HIGH>;
@@ -70,6 +78,11 @@ &i2c1 {
 	mcp16502@5b {
 		compatible = "microchip,mcp16502";
 		reg = <0x5b>;
+		lvin-supply = <&reg_5v>;
+		pvin1-supply = <&reg_5v>;
+		pvin2-supply = <&reg_5v>;
+		pvin3-supply = <&reg_5v>;
+		pvin4-supply = <&reg_5v>;
 		status = "okay";
 		lpm-gpios = <&pioBU 0 GPIO_ACTIVE_LOW>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 7/7] ARM: dts: microchip: sama5d29_curiosity: Add reg_5v to supply PMIC nodes
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (5 preceding siblings ...)
  2024-08-12 13:52 ` [PATCH v2 6/7] ARM: dts: microchip: at91-sama5d27_wlsom1: " Andrei Simion
@ 2024-08-12 13:52 ` Andrei Simion
  2024-08-12 15:33 ` [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Rob Herring (Arm)
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 12+ messages in thread
From: Andrei Simion @ 2024-08-12 13:52 UTC (permalink / raw)
  To: claudiu.beznea, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree, Andrei Simion,
	Mihai Sain

Align with the datasheet by adding regulator-5v which
supplies each node from the regulator using phandle to
regulator-5v through pvin[1-4]-supply and lvin-supply.

Co-developed-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
---
v1 -> v2:
- drop (lvin|pvin[1-4])-supply from each regulators sub-node
- add lvin-supply, pvin[1-4]-supply to PMIC node
---
 .../boot/dts/microchip/at91-sama5d29_curiosity.dts  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts b/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
index 6b02b7bcfd49..951a0c97d3c6 100644
--- a/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
+++ b/arch/arm/boot/dts/microchip/at91-sama5d29_curiosity.dts
@@ -84,6 +84,14 @@ memory@20000000 {
 		device_type = "memory";
 		reg = <0x20000000 0x20000000>;
 	};
+
+	reg_5v: regulator-5v {
+		compatible = "regulator-fixed";
+		regulator-name = "5V_MAIN";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
 
 &adc {
@@ -144,6 +152,11 @@ &i2c0 {
 	mcp16502@5b {
 		compatible = "microchip,mcp16502";
 		reg = <0x5b>;
+		lvin-supply = <&reg_5v>;
+		pvin1-supply = <&reg_5v>;
+		pvin2-supply = <&reg_5v>;
+		pvin3-supply = <&reg_5v>;
+		pvin4-supply = <&reg_5v>;
 		status = "okay";
 		lpm-gpios = <&pioBU 0 GPIO_ACTIVE_LOW>;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (6 preceding siblings ...)
  2024-08-12 13:52 ` [PATCH v2 7/7] ARM: dts: microchip: sama5d29_curiosity: " Andrei Simion
@ 2024-08-12 15:33 ` Rob Herring (Arm)
  2024-08-13 15:43 ` (subset) " Mark Brown
  2024-08-24 14:15 ` claudiu beznea
  9 siblings, 0 replies; 12+ messages in thread
From: Rob Herring (Arm) @ 2024-08-12 15:33 UTC (permalink / raw)
  To: Andrei Simion
  Cc: alexandre.belloni, krzk+dt, nicolas.ferre, claudiu.beznea,
	broonie, devicetree, conor+dt, linux-kernel, lgirdwood,
	linux-arm-kernel


On Mon, 12 Aug 2024 16:52:24 +0300, Andrei Simion wrote:
> In this series of patches, support for the *-supply property [1]  is added
> (correlated with supply_name [2]) from the core regulator.
> Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471
> Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064
> 
> I modified the mcp16502.c driver and the dts that use this PMIC.
> We added these improvements to provide a complete description of the board power scheme.
> 
> Snippet (as an example) from /sys/kernel/debug/regulator/regulator_summary
> (for at91-sama7g5ek):
>  # cat regulator_summary
>  regulator                      use open bypass  opmode voltage current     min     max
> ---------------------------------------------------------------------------------------
>  regulator-dummy                  1    0      0 unknown     0mV     0mA     0mV     0mV
>  5V_MAIN                          6    6      0 unknown  5000mV     0mA  5000mV  5000mV
>     VDD_IO                        5    4      0  normal  3300mV     0mA  3300mV  3300mV
>        e1208000.mmc-vqmmc         1                                 0mA     0mV     0mV
>        e1208000.mmc-vmmc          1                                 0mA  3300mV  3400mV
>        e1204000.mmc-vmmc          1                                 0mA  3300mV  3400mV
>        VDDOUT25                   3    2      0 unknown  2500mV     0mA  2500mV  2500mV
>           e1000000.adc-vref       1                                 0mA     0mV     0mV
>           e1000000.adc-vddana     1                                 0mA     0mV     0mV
>     VDD_DDR                       1    0      0  normal  1350mV     0mA  1350mV  1350mV
>     VDD_CORE                      1    0      0  normal  1150mV     0mA  1150mV  1150mV
>     VDD_OTHER                     2    1      0  normal  1050mV     0mA  1050mV  1250mV
>        cpu0-cpu                   1                                 0mA  1050mV  1225mV
>     LDO1                          2    1      0 unknown  1800mV     0mA  1800mV  1800mV
>        e1204000.mmc-vqmmc         1                                 0mA     0mV     0mV
>     LDO2
> 
> -------------------------------------------------------------------------------------------
> 
> Changelog:
> 
> v1 -> v2:
>  - drop (lvin|pvin[1-4])-supply from each regulators sub-node
>  - add voltage input supply documentation in the yaml schema
>  - add lvin-supply, pvin[1-4]-supply to PMIC node
> 
> Andrei Simion (7):
>   regulator: mcp16502: Add supplier for regulators
>   regulator: dt-bindings: microchip,mcp16502: Add voltage input supply
>     documentation
>   ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes
>   ARM: dts: microchip: at91-sama7g54_curiosity: Add reg_5v to supply
>     PMIC nodes
>   ARM: dts: microchip: at91-sama5d2_icp: Add reg_5v to supply PMIC nodes
>   ARM: dts: microchip: at91-sama5d27_wlsom1: Add reg_5v to supply PMIC
>     nodes
>   ARM: dts: microchip: sama5d29_curiosity: Add reg_5v to supply PMIC
>     nodes
> 
>  .../regulator/microchip,mcp16502.yaml         | 20 +++++++++++++++++++
>  .../dts/microchip/at91-sama5d27_wlsom1.dtsi   | 13 ++++++++++++
>  .../dts/microchip/at91-sama5d29_curiosity.dts | 13 ++++++++++++
>  .../boot/dts/microchip/at91-sama5d2_icp.dts   | 13 ++++++++++++
>  .../dts/microchip/at91-sama7g54_curiosity.dts | 13 ++++++++++++
>  .../arm/boot/dts/microchip/at91-sama7g5ek.dts | 13 ++++++++++++
>  drivers/regulator/mcp16502.c                  | 17 ++++++++--------
>  7 files changed, 94 insertions(+), 8 deletions(-)
> 
> 
> base-commit: 9e6869691724b12e1f43655eeedc35fade38120c
> --
> 2.34.1
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y microchip/at91-sama5d29_curiosity.dtb microchip/at91-sama5d2_icp.dtb microchip/at91-sama7g54_curiosity.dtb microchip/at91-sama7g5ek.dtb' for 20240812135231.43744-1-andrei.simion@microchip.com:

arch/arm/boot/dts/microchip/at91-sama7g5ek.dtb: /soc/chipid@e0020000: failed to match any schema with compatible: ['microchip,sama7g5-chipid']
arch/arm/boot/dts/microchip/at91-sama7g5ek.dtb: /soc/mmc@e120c000: failed to match any schema with compatible: ['microchip,sama7g5-sdhci', 'microchip,sam9x60-sdhci']
arch/arm/boot/dts/microchip/at91-sama7g5ek.dtb: /soc/mmc@e120c000: failed to match any schema with compatible: ['microchip,sama7g5-sdhci', 'microchip,sam9x60-sdhci']






^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (7 preceding siblings ...)
  2024-08-12 15:33 ` [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Rob Herring (Arm)
@ 2024-08-13 15:43 ` Mark Brown
  2024-08-24 14:15 ` claudiu beznea
  9 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2024-08-13 15:43 UTC (permalink / raw)
  To: claudiu.beznea, lgirdwood, nicolas.ferre, krzk+dt, conor+dt, robh,
	alexandre.belloni, Andrei Simion
  Cc: linux-arm-kernel, linux-kernel, devicetree

On Mon, 12 Aug 2024 16:52:24 +0300, Andrei Simion wrote:
> In this series of patches, support for the *-supply property [1]  is added
> (correlated with supply_name [2]) from the core regulator.
> Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471
> Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064
> 
> I modified the mcp16502.c driver and the dts that use this PMIC.
> We added these improvements to provide a complete description of the board power scheme.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/7] regulator: mcp16502: Add supplier for regulators
      commit: 861289835002b733aa8715442ba555b1daa84baa
[2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation
      commit: bf5ba94fa0b90c9433167bf143780af6c8805479

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation
  2024-08-12 13:52 ` [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation Andrei Simion
@ 2024-08-14  9:07   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-14  9:07 UTC (permalink / raw)
  To: Andrei Simion, claudiu.beznea, broonie, lgirdwood, nicolas.ferre,
	krzk+dt, conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree

On 12/08/2024 15:52, Andrei Simion wrote:
> Update the yaml schema with info about input supply phandle for
> each buck and ldo according with the PMIC MCP16502 Datasheet.
> 
> Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
> ---
> v1 -> v2:
> - added in v2
> ---
>  .../regulator/microchip,mcp16502.yaml         | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml b/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
> index 1aca3646789e..c3e1fc6e260e 100644
> --- a/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
> +++ b/Documentation/devicetree/bindings/regulator/microchip,mcp16502.yaml
> @@ -28,6 +28,21 @@ properties:
>    reg:
>      maxItems: 1
>  
> +  lvin-supply:
> +    description: Input supply phandle for LDO1 and LDO2

If there is going to be respin, drop phandle. Stating obvious is not
helping - you describe here hardware, not DT.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators
  2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
                   ` (8 preceding siblings ...)
  2024-08-13 15:43 ` (subset) " Mark Brown
@ 2024-08-24 14:15 ` claudiu beznea
  9 siblings, 0 replies; 12+ messages in thread
From: claudiu beznea @ 2024-08-24 14:15 UTC (permalink / raw)
  To: Andrei Simion, broonie, lgirdwood, nicolas.ferre, krzk+dt,
	conor+dt, robh, alexandre.belloni
  Cc: linux-arm-kernel, linux-kernel, devicetree



On 12.08.2024 16:52, Andrei Simion wrote:
> In this series of patches, support for the *-supply property [1]  is added
> (correlated with supply_name [2]) from the core regulator.
> Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471
> Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064
> 

[ ... ]

> 
> Andrei Simion (7):

[ ... ]

>   ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes
>   ARM: dts: microchip: at91-sama7g54_curiosity: Add reg_5v to supply
>     PMIC nodes
>   ARM: dts: microchip: at91-sama5d2_icp: Add reg_5v to supply PMIC nodes
>   ARM: dts: microchip: at91-sama5d27_wlsom1: Add reg_5v to supply PMIC
>     nodes
>   ARM: dts: microchip: sama5d29_curiosity: Add reg_5v to supply PMIC
>     nodes

Applied to at91-dt, thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-24 14:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 13:52 [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Andrei Simion
2024-08-12 13:52 ` [PATCH v2 1/7] regulator: mcp16502: Add supplier for regulators Andrei Simion
2024-08-12 13:52 ` [PATCH v2 2/7] regulator: dt-bindings: microchip,mcp16502: Add voltage input supply documentation Andrei Simion
2024-08-14  9:07   ` Krzysztof Kozlowski
2024-08-12 13:52 ` [PATCH v2 3/7] ARM: dts: microchip: at91-sama7g5ek: Add reg_5v to supply PMIC nodes Andrei Simion
2024-08-12 13:52 ` [PATCH v2 4/7] ARM: dts: microchip: at91-sama7g54_curiosity: " Andrei Simion
2024-08-12 13:52 ` [PATCH v2 5/7] ARM: dts: microchip: at91-sama5d2_icp: " Andrei Simion
2024-08-12 13:52 ` [PATCH v2 6/7] ARM: dts: microchip: at91-sama5d27_wlsom1: " Andrei Simion
2024-08-12 13:52 ` [PATCH v2 7/7] ARM: dts: microchip: sama5d29_curiosity: " Andrei Simion
2024-08-12 15:33 ` [PATCH v2 0/7] Add input voltage suppliers for PMIC MCP16502 regulators Rob Herring (Arm)
2024-08-13 15:43 ` (subset) " Mark Brown
2024-08-24 14:15 ` claudiu beznea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).