apm821xx: clean up gpio-hogs
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 29 Jul 2018 09:55:17 +0000 (11:55 +0200)
committerJohn Crispin <john@phrozen.org>
Mon, 30 Jul 2018 06:12:32 +0000 (08:12 +0200)
convert the usb and both sata port power related gpio-hogs to
what they really are: fixed-regulators.

The ethernet phy-reset gpio-hog is replaced by a proper
upstream (4.15+) reset-gpios property in the mdio-node.
So this will work eventually.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/apm821xx/dts/wd-mybooklive.dts
target/linux/apm821xx/sata/config-default

index aee0d3266d1af148d34a325b335de15c3134e8bf..4c619871196f0a6d9de5f92b03c5aa5a0173982a 100644 (file)
                #gpio-cells = <2>;
                gpio-controller;
 
-               enable-phy {
-                       /* toggle to reset EMAC PHY */
-                       gpio-hog;
-                       line-name = "enable EMAC PHY";
-                       gpios = <0 GPIO_ACTIVE_LOW>;
-                       output-low;
-               };
-
                enable-button {
                        /* Defined in u-boot as: NOT_NOR
                         * "enables features other than NOR
                        gpios = <1 GPIO_ACTIVE_HIGH>;
                        output-low;
                };
-
-               enable-usb {
-                       gpio-hog;
-                       line-name = "Power USB Core";
-                       gpios = <2 GPIO_ACTIVE_LOW>;
-                       output-low;
-               };
-
-               enable-port1 {
-                       gpio-hog;
-                       line-name = "Power Drive Port 1";
-                       gpios = <3 GPIO_ACTIVE_LOW>;
-                       output-low;
-               };
-
-               enable-port0 {
-                       gpio-hog;
-                       line-name = "Power Drive Port 0";
-                       gpios = <7 GPIO_ACTIVE_LOW>;
-                       output-low;
-               };
        };
 
        GPIO2: gpio2@e0100000 {
                };
        };
 
-       gpio_keys_polled {
+       gpio-keys-polled {
                compatible = "gpio-keys-polled";
                #address-cells = <1>;
                #size-cells = <0>;
                        gpios = <&GPIO2 2 GPIO_ACTIVE_LOW>;
                };
        };
+
+       usbpwr: usb-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "Power USB Core";
+               gpios = <&GPIO1 2 GPIO_ACTIVE_LOW>;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+       };
+
+       sata1pwr: sata1-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "Power Drive Port 1";
+               gpios = <&GPIO1 3 GPIO_ACTIVE_LOW>;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on; /* needed to read OS from HDD */
+       };
+
+       sata0pwr: sata0-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "Power Drive Port 0";
+               gpios = <&GPIO1 7 GPIO_ACTIVE_LOW>;
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-always-on; /* needed to read OS from HDD */
+       };
 };
 
 &EMAC0 {
        mdio {
                #address-cells = <1>;
                #size-cells = <0>;
+               reset-gpios = <&GPIO1 0 GPIO_ACTIVE_LOW>;
 
                phy: phy@1 {
                        compatible = "ethernet-phy-ieee802.3-c22";
 &USBOTG0 {
        status = "okay";
        dr_mode = "host";
+       vbus-supply = <&usbpwr>;
 };
index 4c7c655233515bada5364e405afb16a5549733db..5af8c338f54ba3dc337feb35dae2b61c6f54a67c 100644 (file)
@@ -45,3 +45,5 @@ CONFIG_PPC_EARLY_DEBUG_44x=y
 # CONFIG_PPC_EARLY_DEBUG_MEMCONS is not set
 CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x4
 CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y