ARM: Kirkwood: Convert LSXL to use regulators
authorAndrew Lunn <andrew@lunn.ch>
Sat, 17 Nov 2012 14:46:14 +0000 (15:46 +0100)
committerJason Cooper <jason@lakedaemon.net>
Sat, 24 Nov 2012 02:57:10 +0000 (02:57 +0000)
Control the power to USB and HDD using a fixed regulator.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/boot/dts/kirkwood-lsxl.dtsi
arch/arm/mach-kirkwood/board-lsxl.c

index 798e60eeedf3bb0abbf0acfd2c5d997c364fe0d2..32d302ed2ed0e654e66df5cad95269288896cadf 100644 (file)
                                      5000 0>;
                alarm-gpios = <&gpio1 8 0>;
        };
+
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               usb_power: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "USB Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 11 0>;
+               };
+               hdd_power: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "HDD Power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 10 0>;
+               };
+       };
 };
index b6fbdaac3843f9cbdbedf271d615ae2056df6052..f780e2e0c5dc310a3c64fedc30e23ba3df2b4e8c 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 #include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -61,9 +60,6 @@ static void lsxl_power_off(void)
        kirkwood_restart('h', NULL);
 }
 
-#define LSXL_GPIO_HDD_POWER 10
-#define LSXL_GPIO_USB_POWER 11
-
 void __init lsxl_init(void)
 {
        /*
@@ -71,10 +67,6 @@ void __init lsxl_init(void)
         */
        kirkwood_mpp_conf(lsxl_mpp_config);
 
-       /* usb and sata power on */
-       gpio_set_value(LSXL_GPIO_USB_POWER, 1);
-       gpio_set_value(LSXL_GPIO_HDD_POWER, 1);
-
        kirkwood_ge00_init(&lsxl_ge00_data);
        kirkwood_ge01_init(&lsxl_ge01_data);