]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: dts: marvell: armada-7040-db: Add USB current regulators
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 28 May 2019 09:03:10 +0000 (11:03 +0200)
committerGregory CLEMENT <gregory.clement@bootlin.com>
Tue, 11 Jun 2019 11:33:55 +0000 (13:33 +0200)
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>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
arch/arm64/boot/dts/marvell/armada-7040-db.dts

index d20d84ce7ca86a08f6044827b8ce62dbf7392967..f34ee87a0f569e1fecab273a28c01b0ccd1e0b49 100644 (file)
@@ -28,6 +28,32 @@ aliases {
                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 @@ cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
                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 @@ cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
                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 {