ARM: sun8i: h3: add SY8113B regulator on Banana Pi M2 Zero board
authorIcenowy Zheng <icenowy@aosc.io>
Wed, 11 Jul 2018 13:44:50 +0000 (21:44 +0800)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Thu, 12 Jul 2018 07:23:20 +0000 (09:23 +0200)
Banana Pi M2 Zero board has a SY8113B regulator, which is controlled via
GPIO and capable of outputing 1.1V when the PL1 GPIO is set to output 0
or 1.1V when the PL6 GPIO is set to input or output 1, and the output is
the power supply of the ARM cores in H3 SoC.

Add the device tree node of this regulator and set the cpu's cpu-supply
property to it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts

index 7d01f93..1db2541 100644 (file)
                };
        };
 
+       reg_vdd_cpux: vdd-cpux-regulator {
+               compatible = "regulator-gpio";
+               regulator-name = "vdd-cpux";
+               regulator-type = "voltage";
+               regulator-boot-on;
+               regulator-always-on;
+               regulator-min-microvolt = <1100000>;
+               regulator-max-microvolt = <1300000>;
+               regulator-ramp-delay = <50>; /* 4ms */
+
+               gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */
+               enable-active-high;
+               gpios-states = <0x1>;
+               states = <1100000 0x0
+                         1300000 0x1>;
+       };
+
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                pinctrl-names = "default";
        };
 };
 
+&cpu0 {
+       cpu-supply = <&reg_vdd_cpux>;
+};
+
 &ehci0 {
        status = "okay";
 };