aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2012-07-17 02:14:19 -0400
committerAndrew Lunn <andrew@lunn.ch>2012-07-27 10:50:18 -0400
commit157727d6490b31df45f6c1b59beb3950b82f3c21 (patch)
treef78edb8d91ef2a54abeb05c8a4ad7ff90f9728fa /arch
parentc06c7ca77c85396f19a9f364e2d10d7aa1fafaa5 (diff)
ARM: Kirkwood: Describe IB62x0 LEDs in DT.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Simon Baatz <gmbnomis@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/kirkwood-ib62x0.dts17
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c36
2 files changed, 17 insertions, 36 deletions
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 3724687fc9c9..66794ed75ff1 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -62,4 +62,21 @@
62 gpios = <&gpio0 28 1>; 62 gpios = <&gpio0 28 1>;
63 }; 63 };
64 }; 64 };
65 gpio-leds {
66 compatible = "gpio-leds";
67
68 green-os {
69 label = "ib62x0:green:os";
70 gpios = <&gpio0 25 0>;
71 linux,default-trigger = "default-on";
72 };
73 red-os {
74 label = "ib62x0:red:os";
75 gpios = <&gpio0 22 0>;
76 };
77 usb-copy {
78 label = "ib62x0:red:usb_copy";
79 gpios = <&gpio0 27 0>;
80 };
81 };
65}; 82};
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
index f30065e50cb9..cfc47f80e734 100644
--- a/arch/arm/mach-kirkwood/board-ib62x0.c
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -19,7 +19,6 @@
19#include <linux/mv643xx_eth.h> 19#include <linux/mv643xx_eth.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/leds.h>
23#include <asm/mach-types.h> 22#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
25#include <mach/kirkwood.h> 24#include <mach/kirkwood.h>
@@ -50,40 +49,6 @@ static unsigned int ib62x0_mpp_config[] __initdata = {
50 0 49 0
51}; 50};
52 51
53static struct gpio_led ib62x0_led_pins[] = {
54 {
55 .name = "ib62x0:green:os",
56 .default_trigger = "default-on",
57 .gpio = 25,
58 .active_low = 0,
59 },
60 {
61 .name = "ib62x0:red:os",
62 .default_trigger = "none",
63 .gpio = 22,
64 .active_low = 0,
65 },
66 {
67 .name = "ib62x0:red:usb_copy",
68 .default_trigger = "none",
69 .gpio = 27,
70 .active_low = 0,
71 },
72};
73
74static struct gpio_led_platform_data ib62x0_led_data = {
75 .leds = ib62x0_led_pins,
76 .num_leds = ARRAY_SIZE(ib62x0_led_pins),
77};
78
79static struct platform_device ib62x0_led_device = {
80 .name = "leds-gpio",
81 .id = -1,
82 .dev = {
83 .platform_data = &ib62x0_led_data,
84 }
85};
86
87static void ib62x0_power_off(void) 52static void ib62x0_power_off(void)
88{ 53{
89 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1); 54 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
@@ -98,7 +63,6 @@ void __init ib62x0_init(void)
98 63
99 kirkwood_ehci_init(); 64 kirkwood_ehci_init();
100 kirkwood_ge00_init(&ib62x0_ge00_data); 65 kirkwood_ge00_init(&ib62x0_ge00_data);
101 platform_device_register(&ib62x0_led_device);
102 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 && 66 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
103 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0) 67 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
104 pm_power_off = ib62x0_power_off; 68 pm_power_off = ib62x0_power_off;