ARM: Kirkwood: Convert NS2 to gpio-poweroff.
authorAndrew Lunn <andrew@lunn.ch>
Fri, 28 Dec 2012 14:14:10 +0000 (15:14 +0100)
committerArnd Bergmann <arnd@arndb.de>
Thu, 28 Feb 2013 17:57:13 +0000 (18:57 +0100)
Remove C code and add a Device Tree node in its place.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
arch/arm/boot/dts/kirkwood-ns2-common.dtsi
arch/arm/mach-kirkwood/board-ns2.c

index 77d21abfcdf73a3430f529be076cb4f17cd9e13d..e8e7ecef1650e3bb9ad6b73d43382a0946a4abff 100644 (file)
                        gpios = <&gpio0 12 0>;
                };
        };
+
+       gpio_poweroff {
+               compatible = "gpio-poweroff";
+               gpios = <&gpio0 31 0>;
+       };
+
 };
index f4632a809f6895a0481ea1876e3e0fe25da36fe8..f2ea3b7ad72692d7e5e5cd38f0e7ffe235396c55 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/mv643xx_eth.h>
-#include <linux/gpio.h>
 #include <linux/of.h>
 #include "common.h"
 
@@ -23,13 +22,6 @@ static struct mv643xx_eth_platform_data ns2_ge00_data = {
        .phy_addr       = MV643XX_ETH_PHY_ADDR(8),
 };
 
-#define NS2_GPIO_POWER_OFF     31
-
-static void ns2_power_off(void)
-{
-       gpio_set_value(NS2_GPIO_POWER_OFF, 1);
-}
-
 void __init ns2_init(void)
 {
        /*
@@ -39,10 +31,4 @@ void __init ns2_init(void)
            of_machine_is_compatible("lacie,netspace_mini_v2"))
                ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0);
        kirkwood_ge00_init(&ns2_ge00_data);
-
-       if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 &&
-           gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0)
-               pm_power_off = ns2_power_off;
-       else
-               pr_err("ns2: failed to configure power-off GPIO\n");
 }