aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/dsmg600-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ixp4xx/dsmg600-setup.c')
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index a1c44efc45f6..d0e129566fbc 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/serial.h> 15#include <linux/serial.h>
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/leds.h>
17#include <linux/i2c.h> 18#include <linux/i2c.h>
18#include <linux/i2c-gpio.h> 19#include <linux/i2c-gpio.h>
19 20
@@ -58,29 +59,28 @@ static struct i2c_board_info __initdata dsmg600_i2c_board_info [] = {
58 }, 59 },
59}; 60};
60 61
61#ifdef CONFIG_LEDS_CLASS 62static struct gpio_led dsmg600_led_pins[] = {
62static struct resource dsmg600_led_resources[] = {
63 { 63 {
64 .name = "power", 64 .name = "power",
65 .start = DSMG600_LED_PWR_GPIO, 65 .gpio = DSMG600_LED_PWR_GPIO,
66 .end = DSMG600_LED_PWR_GPIO,
67 .flags = IXP4XX_GPIO_HIGH,
68 }, 66 },
69 { 67 {
70 .name = "wlan", 68 .name = "wlan",
71 .start = DSMG600_LED_WLAN_GPIO, 69 .gpio = DSMG600_LED_WLAN_GPIO,
72 .end = DSMG600_LED_WLAN_GPIO, 70 .active_low = true,
73 .flags = IXP4XX_GPIO_LOW,
74 }, 71 },
75}; 72};
76 73
74static struct gpio_led_platform_data dsmg600_led_data = {
75 .num_leds = ARRAY_SIZE(dsmg600_led_pins),
76 .leds = dsmg600_led_pins,
77};
78
77static struct platform_device dsmg600_leds = { 79static struct platform_device dsmg600_leds = {
78 .name = "IXP4XX-GPIO-LED", 80 .name = "leds-gpio",
79 .id = -1, 81 .id = -1,
80 .num_resources = ARRAY_SIZE(dsmg600_led_resources), 82 .dev.platform_data = &dsmg600_led_data,
81 .resource = dsmg600_led_resources,
82}; 83};
83#endif
84 84
85static struct resource dsmg600_uart_resources[] = { 85static struct resource dsmg600_uart_resources[] = {
86 { 86 {
@@ -128,6 +128,7 @@ static struct platform_device dsmg600_uart = {
128static struct platform_device *dsmg600_devices[] __initdata = { 128static struct platform_device *dsmg600_devices[] __initdata = {
129 &dsmg600_i2c_gpio, 129 &dsmg600_i2c_gpio,
130 &dsmg600_flash, 130 &dsmg600_flash,
131 &dsmg600_leds,
131}; 132};
132 133
133static void dsmg600_power_off(void) 134static void dsmg600_power_off(void)
@@ -175,11 +176,6 @@ static void __init dsmg600_init(void)
175 (void)platform_device_register(&dsmg600_uart); 176 (void)platform_device_register(&dsmg600_uart);
176 177
177 platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices)); 178 platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
178
179#ifdef CONFIG_LEDS_CLASS
180 /* We don't care whether or not this works. */
181 (void)platform_device_register(&dsmg600_leds);
182#endif
183} 179}
184 180
185MACHINE_START(DSMG600, "D-Link DSM-G600 RevA") 181MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")