aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/nslu2-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ixp4xx/nslu2-setup.c')
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 55411f21d838..749a337494d3 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -7,6 +7,7 @@
7 * Copyright (C) 2003-2004 MontaVista Software, Inc. 7 * Copyright (C) 2003-2004 MontaVista Software, Inc.
8 * 8 *
9 * Author: Mark Rakes <mrakes at mac.com> 9 * Author: Mark Rakes <mrakes at mac.com>
10 * Author: Rod Whitby <rod@whitby.id.au>
10 * Maintainers: http://www.nslu2-linux.org/ 11 * Maintainers: http://www.nslu2-linux.org/
11 * 12 *
12 * Fixed missing init_time in MACHINE_START kas11 10/22/04 13 * Fixed missing init_time in MACHINE_START kas11 10/22/04
@@ -16,6 +17,7 @@
16#include <linux/kernel.h> 17#include <linux/kernel.h>
17#include <linux/serial.h> 18#include <linux/serial.h>
18#include <linux/serial_8250.h> 19#include <linux/serial_8250.h>
20#include <linux/leds.h>
19 21
20#include <asm/mach-types.h> 22#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -43,6 +45,42 @@ static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = {
43 .scl_pin = NSLU2_SCL_PIN, 45 .scl_pin = NSLU2_SCL_PIN,
44}; 46};
45 47
48#ifdef CONFIG_LEDS_IXP4XX
49static struct resource nslu2_led_resources[] = {
50 {
51 .name = "ready", /* green led */
52 .start = NSLU2_LED_GRN,
53 .end = NSLU2_LED_GRN,
54 .flags = IXP4XX_GPIO_HIGH,
55 },
56 {
57 .name = "status", /* red led */
58 .start = NSLU2_LED_RED,
59 .end = NSLU2_LED_RED,
60 .flags = IXP4XX_GPIO_HIGH,
61 },
62 {
63 .name = "disk-1",
64 .start = NSLU2_LED_DISK1,
65 .end = NSLU2_LED_DISK1,
66 .flags = IXP4XX_GPIO_LOW,
67 },
68 {
69 .name = "disk-2",
70 .start = NSLU2_LED_DISK2,
71 .end = NSLU2_LED_DISK2,
72 .flags = IXP4XX_GPIO_LOW,
73 },
74};
75
76static struct platform_device nslu2_leds = {
77 .name = "IXP4XX-GPIO-LED",
78 .id = -1,
79 .num_resources = ARRAY_SIZE(nslu2_led_resources),
80 .resource = nslu2_led_resources,
81};
82#endif
83
46static struct platform_device nslu2_i2c_controller = { 84static struct platform_device nslu2_i2c_controller = {
47 .name = "IXP4XX-I2C", 85 .name = "IXP4XX-I2C",
48 .id = 0, 86 .id = 0,
@@ -102,8 +140,10 @@ static struct platform_device nslu2_uart = {
102static struct platform_device *nslu2_devices[] __initdata = { 140static struct platform_device *nslu2_devices[] __initdata = {
103 &nslu2_i2c_controller, 141 &nslu2_i2c_controller,
104 &nslu2_flash, 142 &nslu2_flash,
105 &nslu2_uart,
106 &nslu2_beeper, 143 &nslu2_beeper,
144#ifdef CONFIG_LEDS_IXP4XX
145 &nslu2_leds,
146#endif
107}; 147};
108 148
109static void nslu2_power_off(void) 149static void nslu2_power_off(void)
@@ -127,6 +167,12 @@ static void __init nslu2_init(void)
127 167
128 pm_power_off = nslu2_power_off; 168 pm_power_off = nslu2_power_off;
129 169
170 /* This is only useful on a modified machine, but it is valuable
171 * to have it first in order to see debug messages, and so that
172 * it does *not* get removed if platform_add_devices fails!
173 */
174 (void)platform_device_register(&nslu2_uart);
175
130 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); 176 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
131} 177}
132 178