All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: marvell: armada-7040-db: Add USB current regulators
@ 2019-05-28  9:03 ` Miquel Raynal
  0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2019-05-28  9:03 UTC (permalink / raw)
  To: Gregory Clement, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Rob Herring, Mark Rutland
  Cc: devicetree, Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Thomas Petazzoni, Miquel Raynal, linux-arm-kernel

Armada 7040-db USB ports deliver 500mA by default while they
could deliver up to 900mA (usually, for USB3 devices).

The board embeds a GPIO controlled regulator on each port which can be
configured to deliver each amount of current.

Add a vin-supply property to the USB3 Vbus nodes for this purpose. The
regulator will be automatically 'enabled', ie. set to limit at 900mA
instead of 500mA.

Suggested-by: Alex Leibovich <alexl@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 .../arm64/boot/dts/marvell/armada-7040-db.dts | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
index d20d84ce7ca8..f34ee87a0f56 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
@@ -28,6 +28,32 @@
 		ethernet2 = &cp0_eth2;
 	};
 
+	cp0_exp_usb3_0_current_regulator: gpio-regulator {
+		compatible = "regulator-gpio";
+		regulator-name = "cp0-usb3-0-current-regulator";
+		regulator-type = "current";
+		regulator-min-microamp = <500000>;
+		regulator-max-microamp = <900000>;
+		gpios = <&expander0 4 GPIO_ACTIVE_HIGH>;
+		states = <500000 0x0
+			  900000 0x1>;
+		enable-active-high;
+		gpios-states = <0>;
+	};
+
+	cp0_exp_usb3_1_current_regulator: gpio-regulator {
+		compatible = "regulator-gpio";
+		regulator-name = "cp0-usb3-1-current-regulator";
+		regulator-type = "current";
+		regulator-min-microamp = <500000>;
+		regulator-max-microamp = <900000>;
+		gpios = <&expander0 5 GPIO_ACTIVE_HIGH>;
+		states = <500000 0x0
+			  900000 0x1>;
+		enable-active-high;
+		gpios-states = <0>;
+	};
+
 	cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb3h0-vbus";
@@ -35,6 +61,7 @@
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
 		gpio = <&expander0 0 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&cp0_exp_usb3_0_current_regulator>;
 	};
 
 	cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
@@ -44,6 +71,7 @@
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
 		gpio = <&expander0 1 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&cp0_exp_usb3_1_current_regulator>;
 	};
 
 	cp0_usb3_0_phy: cp0-usb3-0-phy {
-- 
2.19.1

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

* [PATCH] arm64: dts: marvell: armada-7040-db: Add USB current regulators
@ 2019-05-28  9:03 ` Miquel Raynal
  0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2019-05-28  9:03 UTC (permalink / raw)
  To: Gregory Clement, Jason Cooper, Andrew Lunn,
	Sebastian Hesselbarth, Rob Herring, Mark Rutland
  Cc: devicetree, Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Thomas Petazzoni, Miquel Raynal, linux-arm-kernel

Armada 7040-db USB ports deliver 500mA by default while they
could deliver up to 900mA (usually, for USB3 devices).

The board embeds a GPIO controlled regulator on each port which can be
configured to deliver each amount of current.

Add a vin-supply property to the USB3 Vbus nodes for this purpose. The
regulator will be automatically 'enabled', ie. set to limit at 900mA
instead of 500mA.

Suggested-by: Alex Leibovich <alexl@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 .../arm64/boot/dts/marvell/armada-7040-db.dts | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
index d20d84ce7ca8..f34ee87a0f56 100644
--- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
+++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
@@ -28,6 +28,32 @@
 		ethernet2 = &cp0_eth2;
 	};
 
+	cp0_exp_usb3_0_current_regulator: gpio-regulator {
+		compatible = "regulator-gpio";
+		regulator-name = "cp0-usb3-0-current-regulator";
+		regulator-type = "current";
+		regulator-min-microamp = <500000>;
+		regulator-max-microamp = <900000>;
+		gpios = <&expander0 4 GPIO_ACTIVE_HIGH>;
+		states = <500000 0x0
+			  900000 0x1>;
+		enable-active-high;
+		gpios-states = <0>;
+	};
+
+	cp0_exp_usb3_1_current_regulator: gpio-regulator {
+		compatible = "regulator-gpio";
+		regulator-name = "cp0-usb3-1-current-regulator";
+		regulator-type = "current";
+		regulator-min-microamp = <500000>;
+		regulator-max-microamp = <900000>;
+		gpios = <&expander0 5 GPIO_ACTIVE_HIGH>;
+		states = <500000 0x0
+			  900000 0x1>;
+		enable-active-high;
+		gpios-states = <0>;
+	};
+
 	cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb3h0-vbus";
@@ -35,6 +61,7 @@
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
 		gpio = <&expander0 0 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&cp0_exp_usb3_0_current_regulator>;
 	};
 
 	cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
@@ -44,6 +71,7 @@
 		regulator-max-microvolt = <5000000>;
 		enable-active-high;
 		gpio = <&expander0 1 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&cp0_exp_usb3_1_current_regulator>;
 	};
 
 	cp0_usb3_0_phy: cp0-usb3-0-phy {
-- 
2.19.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] 4+ messages in thread

* Re: [PATCH] arm64: dts: marvell: armada-7040-db: Add USB current regulators
  2019-05-28  9:03 ` Miquel Raynal
@ 2019-06-11 11:39   ` Gregory CLEMENT
  -1 siblings, 0 replies; 4+ messages in thread
From: Gregory CLEMENT @ 2019-06-11 11:39 UTC (permalink / raw)
  To: Jason Cooper, Andrew Lunn, Sebastian Hesselbarth, Rob Herring,
	Mark Rutland
  Cc: devicetree, Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Thomas Petazzoni, Miquel Raynal, linux-arm-kernel

Miquel Raynal <miquel.raynal@bootlin.com> writes:

> Armada 7040-db USB ports deliver 500mA by default while they
> could deliver up to 900mA (usually, for USB3 devices).
>
> The board embeds a GPIO controlled regulator on each port which can be
> configured to deliver each amount of current.
>
> Add a vin-supply property to the USB3 Vbus nodes for this purpose. The
> regulator will be automatically 'enabled', ie. set to limit at 900mA
> instead of 500mA.
>
> Suggested-by: Alex Leibovich <alexl@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied on mvebu/dt64

Thanks,

Gregory
> ---
>  .../arm64/boot/dts/marvell/armada-7040-db.dts | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> index d20d84ce7ca8..f34ee87a0f56 100644
> --- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> @@ -28,6 +28,32 @@
>  		ethernet2 = &cp0_eth2;
>  	};
>  
> +	cp0_exp_usb3_0_current_regulator: gpio-regulator {
> +		compatible = "regulator-gpio";
> +		regulator-name = "cp0-usb3-0-current-regulator";
> +		regulator-type = "current";
> +		regulator-min-microamp = <500000>;
> +		regulator-max-microamp = <900000>;
> +		gpios = <&expander0 4 GPIO_ACTIVE_HIGH>;
> +		states = <500000 0x0
> +			  900000 0x1>;
> +		enable-active-high;
> +		gpios-states = <0>;
> +	};
> +
> +	cp0_exp_usb3_1_current_regulator: gpio-regulator {
> +		compatible = "regulator-gpio";
> +		regulator-name = "cp0-usb3-1-current-regulator";
> +		regulator-type = "current";
> +		regulator-min-microamp = <500000>;
> +		regulator-max-microamp = <900000>;
> +		gpios = <&expander0 5 GPIO_ACTIVE_HIGH>;
> +		states = <500000 0x0
> +			  900000 0x1>;
> +		enable-active-high;
> +		gpios-states = <0>;
> +	};
> +
>  	cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
>  		compatible = "regulator-fixed";
>  		regulator-name = "usb3h0-vbus";
> @@ -35,6 +61,7 @@
>  		regulator-max-microvolt = <5000000>;
>  		enable-active-high;
>  		gpio = <&expander0 0 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&cp0_exp_usb3_0_current_regulator>;
>  	};
>  
>  	cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
> @@ -44,6 +71,7 @@
>  		regulator-max-microvolt = <5000000>;
>  		enable-active-high;
>  		gpio = <&expander0 1 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&cp0_exp_usb3_1_current_regulator>;
>  	};
>  
>  	cp0_usb3_0_phy: cp0-usb3-0-phy {
> -- 
> 2.19.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

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

* Re: [PATCH] arm64: dts: marvell: armada-7040-db: Add USB current regulators
@ 2019-06-11 11:39   ` Gregory CLEMENT
  0 siblings, 0 replies; 4+ messages in thread
From: Gregory CLEMENT @ 2019-06-11 11:39 UTC (permalink / raw)
  To: Miquel Raynal, Jason Cooper, Andrew Lunn, Sebastian Hesselbarth,
	Rob Herring, Mark Rutland
  Cc: devicetree, Antoine Tenart, Maxime Chevallier, Nadav Haklai,
	Thomas Petazzoni, Miquel Raynal, linux-arm-kernel

Miquel Raynal <miquel.raynal@bootlin.com> writes:

> Armada 7040-db USB ports deliver 500mA by default while they
> could deliver up to 900mA (usually, for USB3 devices).
>
> The board embeds a GPIO controlled regulator on each port which can be
> configured to deliver each amount of current.
>
> Add a vin-supply property to the USB3 Vbus nodes for this purpose. The
> regulator will be automatically 'enabled', ie. set to limit at 900mA
> instead of 500mA.
>
> Suggested-by: Alex Leibovich <alexl@marvell.com>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied on mvebu/dt64

Thanks,

Gregory
> ---
>  .../arm64/boot/dts/marvell/armada-7040-db.dts | 28 +++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/marvell/armada-7040-db.dts b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> index d20d84ce7ca8..f34ee87a0f56 100644
> --- a/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> +++ b/arch/arm64/boot/dts/marvell/armada-7040-db.dts
> @@ -28,6 +28,32 @@
>  		ethernet2 = &cp0_eth2;
>  	};
>  
> +	cp0_exp_usb3_0_current_regulator: gpio-regulator {
> +		compatible = "regulator-gpio";
> +		regulator-name = "cp0-usb3-0-current-regulator";
> +		regulator-type = "current";
> +		regulator-min-microamp = <500000>;
> +		regulator-max-microamp = <900000>;
> +		gpios = <&expander0 4 GPIO_ACTIVE_HIGH>;
> +		states = <500000 0x0
> +			  900000 0x1>;
> +		enable-active-high;
> +		gpios-states = <0>;
> +	};
> +
> +	cp0_exp_usb3_1_current_regulator: gpio-regulator {
> +		compatible = "regulator-gpio";
> +		regulator-name = "cp0-usb3-1-current-regulator";
> +		regulator-type = "current";
> +		regulator-min-microamp = <500000>;
> +		regulator-max-microamp = <900000>;
> +		gpios = <&expander0 5 GPIO_ACTIVE_HIGH>;
> +		states = <500000 0x0
> +			  900000 0x1>;
> +		enable-active-high;
> +		gpios-states = <0>;
> +	};
> +
>  	cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
>  		compatible = "regulator-fixed";
>  		regulator-name = "usb3h0-vbus";
> @@ -35,6 +61,7 @@
>  		regulator-max-microvolt = <5000000>;
>  		enable-active-high;
>  		gpio = <&expander0 0 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&cp0_exp_usb3_0_current_regulator>;
>  	};
>  
>  	cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
> @@ -44,6 +71,7 @@
>  		regulator-max-microvolt = <5000000>;
>  		enable-active-high;
>  		gpio = <&expander0 1 GPIO_ACTIVE_HIGH>;
> +		vin-supply = <&cp0_exp_usb3_1_current_regulator>;
>  	};
>  
>  	cp0_usb3_0_phy: cp0-usb3-0-phy {
> -- 
> 2.19.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

_______________________________________________
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] 4+ messages in thread

end of thread, other threads:[~2019-06-11 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28  9:03 [PATCH] arm64: dts: marvell: armada-7040-db: Add USB current regulators Miquel Raynal
2019-05-28  9:03 ` Miquel Raynal
2019-06-11 11:39 ` Gregory CLEMENT
2019-06-11 11:39   ` Gregory CLEMENT

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.