aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2006-06-22 17:21:01 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-22 17:21:01 -0400
commitdf6934b33c43a3ad517244935fe9c19715d9dc15 (patch)
tree6a8a6c66182e98466472aa4ab195e39ead6b1bb2 /arch/arm/mach-ixp4xx
parentf606a6ff222dc7dceeb4d0e214ce4f55d9c6b0e6 (diff)
[ARM] 3595/1: ixp4xx/nas100d: Board support for new LED subsystem
Patch from Rod Whitby This patch implements NEW_LEDS support for the IOMega NAS100d. The NAS100d has three LED indicators, which are the only form of output for an unmodified device - there is no keyboard or display on an NAS100d. For an NAS100d which has been modified to bring out the serial port console, it is important to register that device first separately, to enable debugging of other device support. Signed-off-by: John Bowler <jbowler@acm.org> Signed-off-by: Rod Whitby <rod@whitby.id.au> Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ixp4xx')
-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