aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index a3b4c6ac5708..9a31444d9214 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/serial.h> 16#include <linux/serial.h>
17#include <linux/serial_8250.h> 17#include <linux/serial_8250.h>
18#include <linux/leds.h>
18 19
19#include <asm/mach-types.h> 20#include <asm/mach-types.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -37,6 +38,36 @@ static struct platform_device nas100d_flash = {
37 .resource = &nas100d_flash_resource, 38 .resource = &nas100d_flash_resource,
38}; 39};
39 40
41#ifdef CONFIG_LEDS_IXP4XX
42static struct resource nas100d_led_resources[] = {
43 {
44 .name = "wlan", /* green led */
45 .start = 0,
46 .end = 0,
47 .flags = IXP4XX_GPIO_LOW,
48 },
49 {
50 .name = "ready", /* blue power led (off is flashing!) */
51 .start = 15,
52 .end = 15,
53 .flags = IXP4XX_GPIO_LOW,
54 },
55 {
56 .name = "disk", /* yellow led */
57 .start = 3,
58 .end = 3,
59 .flags = IXP4XX_GPIO_LOW,
60 },
61};
62
63static struct platform_device nas100d_leds = {
64 .name = "IXP4XX-GPIO-LED",
65 .id = -1,
66 .num_resources = ARRAY_SIZE(nas100d_led_resources),
67 .resource = nas100d_led_resources,
68};
69#endif
70
40static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = { 71static struct ixp4xx_i2c_pins nas100d_i2c_gpio_pins = {
41 .sda_pin = NAS100D_SDA_PIN, 72 .sda_pin = NAS100D_SDA_PIN,
42 .scl_pin = NAS100D_SCL_PIN, 73 .scl_pin = NAS100D_SCL_PIN,
@@ -95,7 +126,9 @@ static struct platform_device nas100d_uart = {
95static struct platform_device *nas100d_devices[] __initdata = { 126static struct platform_device *nas100d_devices[] __initdata = {
96 &nas100d_i2c_controller, 127 &nas100d_i2c_controller,
97 &nas100d_flash, 128 &nas100d_flash,
98 &nas100d_uart, 129#ifdef CONFIG_LEDS_IXP4XX
130 &nas100d_leds,
131#endif
99}; 132};
100 133
101static void nas100d_power_off(void) 134static void nas100d_power_off(void)
@@ -122,6 +155,12 @@ static void __init nas100d_init(void)
122 155
123 pm_power_off = nas100d_power_off; 156 pm_power_off = nas100d_power_off;
124 157
158 /* This is only useful on a modified machine, but it is valuable
159 * to have it first in order to see debug messages, and so that
160 * it does *not* get removed if platform_add_devices fails!
161 */
162 (void)platform_device_register(&nas100d_uart);
163
125 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices)); 164 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
126} 165}
127 166