diff options
author | Andrew Lunn <andrew@lunn.ch> | 2012-12-28 09:08:49 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-02-28 12:57:12 -0500 |
commit | 7dcc628349de9a878c43ef4b30e6c8ccbe1d207a (patch) | |
tree | 7f8060df1e410cfe1de0fab118ee5f1a62244fd0 /arch/arm | |
parent | 12131b5424577b2eb1bef5a41220d310594e42dc (diff) |
ARM: Kirkwood: Convert NSA310 to use gpio-poweroff driver
Remove the C code and add a Device Tree node for gpio-poweroff.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/boot/dts/kirkwood-nsa310.dts | 5 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-nsa310.c | 33 |
2 files changed, 5 insertions, 33 deletions
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts index 2dc1d0929e89..85cce36491da 100644 --- a/arch/arm/boot/dts/kirkwood-nsa310.dts +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts | |||
@@ -142,6 +142,11 @@ | |||
142 | }; | 142 | }; |
143 | }; | 143 | }; |
144 | 144 | ||
145 | gpio_poweroff { | ||
146 | compatible = "gpio-poweroff"; | ||
147 | gpios = <&gpio1 16 0>; | ||
148 | }; | ||
149 | |||
145 | regulators { | 150 | regulators { |
146 | compatible = "simple-bus"; | 151 | compatible = "simple-bus"; |
147 | #address-cells = <1>; | 152 | #address-cells = <1>; |
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c index 891322b44633..cf2c78cf6513 100644 --- a/arch/arm/mach-kirkwood/board-nsa310.c +++ b/arch/arm/mach-kirkwood/board-nsa310.c | |||
@@ -11,14 +11,11 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/gpio.h> | ||
15 | #include <mach/kirkwood.h> | 14 | #include <mach/kirkwood.h> |
16 | #include <linux/of.h> | 15 | #include <linux/of.h> |
17 | #include "common.h" | 16 | #include "common.h" |
18 | #include "mpp.h" | 17 | #include "mpp.h" |
19 | 18 | ||
20 | #define NSA310_GPIO_POWER_OFF 48 | ||
21 | |||
22 | static unsigned int nsa310_mpp_config[] __initdata = { | 19 | static unsigned int nsa310_mpp_config[] __initdata = { |
23 | MPP12_GPIO, /* led esata green */ | 20 | MPP12_GPIO, /* led esata green */ |
24 | MPP13_GPIO, /* led esata red */ | 21 | MPP13_GPIO, /* led esata red */ |
@@ -43,40 +40,10 @@ static struct i2c_board_info __initdata nsa310_i2c_info[] = { | |||
43 | { I2C_BOARD_INFO("adt7476", 0x2e) }, | 40 | { I2C_BOARD_INFO("adt7476", 0x2e) }, |
44 | }; | 41 | }; |
45 | 42 | ||
46 | static void nsa310_power_off(void) | ||
47 | { | ||
48 | gpio_set_value(NSA310_GPIO_POWER_OFF, 1); | ||
49 | } | ||
50 | |||
51 | static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags, | ||
52 | const char *label) | ||
53 | { | ||
54 | int err; | ||
55 | |||
56 | err = gpio_request_one(gpio, flags, label); | ||
57 | if (err) | ||
58 | pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n", | ||
59 | gpio, label, err); | ||
60 | |||
61 | return err; | ||
62 | } | ||
63 | |||
64 | static void __init nsa310_gpio_init(void) | ||
65 | { | ||
66 | int err; | ||
67 | |||
68 | err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW, | ||
69 | "Power Off"); | ||
70 | if (!err) | ||
71 | pm_power_off = nsa310_power_off; | ||
72 | } | ||
73 | |||
74 | void __init nsa310_init(void) | 43 | void __init nsa310_init(void) |
75 | { | 44 | { |
76 | kirkwood_mpp_conf(nsa310_mpp_config); | 45 | kirkwood_mpp_conf(nsa310_mpp_config); |
77 | 46 | ||
78 | nsa310_gpio_init(); | ||
79 | |||
80 | i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info)); | 47 | i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info)); |
81 | } | 48 | } |
82 | 49 | ||