linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
@ 2020-01-04 15:32 Markus Reichl
  2020-01-04 15:32 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
  2020-01-04 21:19 ` [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Heiko Stuebner
  0 siblings, 2 replies; 7+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip
  Cc: devicetree, Heiko Stuebner, Stephan Gerhold, Rob Herring,
	Linus Walleij, Angus Ainslie (Purism),
	linux-kernel, Maxime Ripard, Markus Reichl, Laurent Pinchart,
	Shawn Guo, linux-arm-kernel, Jagan Teki

On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
is used to supply the 12V power line. This delivers 5V as a default value after
boot. The voltage is controllable via I2C.
Add a basic driver to set and get the voltage of the MP8859 and add a matching
node with fixed 12V in the DT of the board. 

Markus Reichl (5):
  regulator: mp8859: add driver
  regulator: mp8859: add config option and build entry
  dt-bindings: add vendor Monolithic Power Systems
  dt-bindings: regulator: add MPS mp8859 voltage regulator
  arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc

 .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
 drivers/regulator/Kconfig                     |  11 ++
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
 6 files changed, 210 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
 create mode 100644 drivers/regulator/mp8859.c

-- 
2.24.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 15:32 [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Markus Reichl
@ 2020-01-04 15:32 ` Markus Reichl
  2020-01-04 21:23   ` Heiko Stuebner
  2020-01-04 21:19 ` [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Heiko Stuebner
  1 sibling, 1 reply; 7+ messages in thread
From: Markus Reichl @ 2020-01-04 15:32 UTC (permalink / raw)
  To: linux-rockchip, Rob Herring, Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, devicetree, Jagan Teki, linux-arm-kernel, linux-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board
  2020-01-04 15:32 [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Markus Reichl
  2020-01-04 15:32 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
@ 2020-01-04 21:19 ` Heiko Stuebner
  1 sibling, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:19 UTC (permalink / raw)
  To: Markus Reichl
  Cc: devicetree, Stephan Gerhold, Rob Herring, Linus Walleij,
	Angus Ainslie (Purism),
	linux-kernel, Maxime Ripard, linux-rockchip, Laurent Pinchart,
	Shawn Guo, linux-arm-kernel, Jagan Teki

Hi Markus,

I've only gotten patches 3+5 of this series (vendor-prefix+dts patch), so
maybe you could teach your git-send-email to include all patches to all
recipients.

Am Samstag, 4. Januar 2020, 16:32:44 CET schrieb Markus Reichl:
> On rk3399-roc-pc board a voltage regulator MP8859 from Monolithic Power Systems
> is used to supply the 12V power line. This delivers 5V as a default value after
> boot. The voltage is controllable via I2C.
> Add a basic driver to set and get the voltage of the MP8859 and add a matching
> node with fixed 12V in the DT of the board. 
> 
> Markus Reichl (5):
>   regulator: mp8859: add driver
>   regulator: mp8859: add config option and build entry

I think these two should only need one patch together.

Heiko

>   dt-bindings: add vendor Monolithic Power Systems
>   dt-bindings: regulator: add MPS mp8859 voltage regulator
>   arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
> 
>  .../devicetree/bindings/regulator/mp8859.txt  |  22 +++
>  .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      |  32 ++--
>  drivers/regulator/Kconfig                     |  11 ++
>  drivers/regulator/Makefile                    |   1 +
>  drivers/regulator/mp8859.c                    | 156 ++++++++++++++++++
>  6 files changed, 210 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt
>  create mode 100644 drivers/regulator/mp8859.c
> 
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 15:32 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
@ 2020-01-04 21:23   ` Heiko Stuebner
  2020-01-05  9:16     ` Markus Reichl
  0 siblings, 1 reply; 7+ messages in thread
From: Heiko Stuebner @ 2020-01-04 21:23 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree, linux-kernel, linux-rockchip,
	Rob Herring, Jagan Teki, linux-arm-kernel

Hi Markus,

Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.

Just for my understanding ... both the old static regulator before as
well as the new i2c node said to supply 12V, but above you say that
the default is 5V ... so I'm wondering who configured the 12V before.

Or was it the case that the old regulator node was just wrong and we
had 5V running on the dc_12v line?

Thanks
Heiko

> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
> ---
>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> index 8e01b04144b7..9f225e9c3d54 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>  		regulator-max-microvolt = <5000000>;
>  	};
>  
> -	/*
> -	 * should be placed inside mp8859, but not until mp8859 has
> -	 * its own dt-binding.
> -	 */
> -	dc_12v: mp8859-dcdc1 {
> -		compatible = "regulator-fixed";
> -		regulator-name = "dc_12v";
> -		regulator-always-on;
> -		regulator-boot-on;
> -		regulator-min-microvolt = <12000000>;
> -		regulator-max-microvolt = <12000000>;
> -		vin-supply = <&vcc_vbus_typec0>;
> -	};
> -
>  	/* switched by pmic_sleep */
>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>  		compatible = "regulator-fixed";
> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>  		vbus-supply = <&vcc_vbus_typec0>;
>  		status = "okay";
>  	};
> +
> +	mp8859: regulator@66 {
> +		compatible = "mps,mp8859";
> +		reg = <0x66>;
> +		dc_12v: mp8859_dcdc {
> +			regulator-name = "dc_12v";
> +			regulator-min-microvolt = <12000000>;
> +			regulator-max-microvolt = <12000000>;
> +			regulator-always-on;
> +			regulator-boot-on;
> +			vin-supply = <&vcc_vbus_typec0>;
> +
> +			regulator-state-mem {
> +				regulator-on-in-suspend;
> +				regulator-suspend-microvolt = <12000000>;
> +			};
> +		};
> +	};
>  };
>  
>  &i2s0 {
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-04 21:23   ` Heiko Stuebner
@ 2020-01-05  9:16     ` Markus Reichl
  0 siblings, 0 replies; 7+ messages in thread
From: Markus Reichl @ 2020-01-05  9:16 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: Mark Rutland, devicetree, linux-kernel, linux-rockchip,
	Rob Herring, Jagan Teki, linux-arm-kernel

Hi Heiko,

Am 04.01.20 um 22:23 schrieb Heiko Stuebner:
> Hi Markus,
> 
> Am Samstag, 4. Januar 2020, 16:32:49 CET schrieb Markus Reichl:
>> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
>> This supplies 5V only in default state after booting.
> 
> Just for my understanding ... both the old static regulator before as
> well as the new i2c node said to supply 12V, but above you say that
> the default is 5V ... so I'm wondering who configured the 12V before.
> 
> Or was it the case that the old regulator node was just wrong and we
> had 5V running on the dc_12v line?

Yes, the dc_12v line was running at 5V (measured 4,7V) as it is the
default power up value for the MP8859. This is as documented in the data
sheet [1].

[1] https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MP8859/document_id/4033/

Gruß
--
Markus
> 
> Thanks
> Heiko
> 
>> Now we can control the output voltage via I2C interface.
>> Add a node for the driver to reach 12V.
>> 
>> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
>> ---
>>  .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
>>  1 file changed, 18 insertions(+), 14 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> index 8e01b04144b7..9f225e9c3d54 100644
>> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
>> @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
>>  		regulator-max-microvolt = <5000000>;
>>  	};
>>  
>> -	/*
>> -	 * should be placed inside mp8859, but not until mp8859 has
>> -	 * its own dt-binding.
>> -	 */
>> -	dc_12v: mp8859-dcdc1 {
>> -		compatible = "regulator-fixed";
>> -		regulator-name = "dc_12v";
>> -		regulator-always-on;
>> -		regulator-boot-on;
>> -		regulator-min-microvolt = <12000000>;
>> -		regulator-max-microvolt = <12000000>;
>> -		vin-supply = <&vcc_vbus_typec0>;
>> -	};
>> -
>>  	/* switched by pmic_sleep */
>>  	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
>>  		compatible = "regulator-fixed";
>> @@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
>>  		vbus-supply = <&vcc_vbus_typec0>;
>>  		status = "okay";
>>  	};
>> +
>> +	mp8859: regulator@66 {
>> +		compatible = "mps,mp8859";
>> +		reg = <0x66>;
>> +		dc_12v: mp8859_dcdc {
>> +			regulator-name = "dc_12v";
>> +			regulator-min-microvolt = <12000000>;
>> +			regulator-max-microvolt = <12000000>;
>> +			regulator-always-on;
>> +			regulator-boot-on;
>> +			vin-supply = <&vcc_vbus_typec0>;
>> +
>> +			regulator-state-mem {
>> +				regulator-on-in-suspend;
>> +				regulator-suspend-microvolt = <12000000>;
>> +			};
>> +		};
>> +	};
>>  };
>>  
>>  &i2s0 {
>> 
> 
> 
> 
> 
> 
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-06 21:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
@ 2020-01-08 23:30   ` Heiko Stuebner
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2020-01-08 23:30 UTC (permalink / raw)
  To: Markus Reichl
  Cc: Mark Rutland, devicetree, Liam Girdwood, Rob Herring,
	linux-kernel, linux-rockchip, Mark Brown, linux-arm-kernel

Am Montag, 6. Januar 2020, 22:16:28 CET schrieb Markus Reichl:
> The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
> This supplies 5V only in default state after booting.
> Now we can control the output voltage via I2C interface.
> Add a node for the driver to reach 12V.
> 
> Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>

applied for 5.6 now that the driver-side got merged

Thanks
Heiko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc
  2020-01-06 21:16 Markus Reichl
@ 2020-01-06 21:16 ` Markus Reichl
  2020-01-08 23:30   ` Heiko Stuebner
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Reichl @ 2020-01-06 21:16 UTC (permalink / raw)
  To: linux-rockchip, Liam Girdwood, Mark Brown, Rob Herring,
	Mark Rutland, Heiko Stuebner
  Cc: Markus Reichl, devicetree, linux-kernel, linux-arm-kernel

The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply.
This supplies 5V only in default state after booting.
Now we can control the output voltage via I2C interface.
Add a node for the driver to reach 12V.

Signed-off-by: Markus Reichl <m.reichl@fivetechno.de>
---
 .../boot/dts/rockchip/rk3399-roc-pc.dtsi      | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
index 8e01b04144b7..9f225e9c3d54 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
@@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 {
 		regulator-max-microvolt = <5000000>;
 	};
 
-	/*
-	 * should be placed inside mp8859, but not until mp8859 has
-	 * its own dt-binding.
-	 */
-	dc_12v: mp8859-dcdc1 {
-		compatible = "regulator-fixed";
-		regulator-name = "dc_12v";
-		regulator-always-on;
-		regulator-boot-on;
-		regulator-min-microvolt = <12000000>;
-		regulator-max-microvolt = <12000000>;
-		vin-supply = <&vcc_vbus_typec0>;
-	};
-
 	/* switched by pmic_sleep */
 	vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
 		compatible = "regulator-fixed";
@@ -546,6 +532,24 @@ fusb0: usb-typec@22 {
 		vbus-supply = <&vcc_vbus_typec0>;
 		status = "okay";
 	};
+
+	mp8859: regulator@66 {
+		compatible = "mps,mp8859";
+		reg = <0x66>;
+		dc_12v: mp8859_dcdc {
+			regulator-name = "dc_12v";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			vin-supply = <&vcc_vbus_typec0>;
+
+			regulator-state-mem {
+				regulator-on-in-suspend;
+				regulator-suspend-microvolt = <12000000>;
+			};
+		};
+	};
 };
 
 &i2s0 {
-- 
2.24.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-01-08 23:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 15:32 [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Markus Reichl
2020-01-04 15:32 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
2020-01-04 21:23   ` Heiko Stuebner
2020-01-05  9:16     ` Markus Reichl
2020-01-04 21:19 ` [PATCH 0/5] regulator: mp8859: add driver for DC/DC converter used on rk3399-roc-pc board Heiko Stuebner
2020-01-06 21:16 Markus Reichl
2020-01-06 21:16 ` [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Markus Reichl
2020-01-08 23:30   ` Heiko Stuebner

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).