summaryrefslogtreecommitdiff
path: root/packages/linux/ixp4xx-kernel/2.6.16/96-loft-leds.patch
blob: 60fcf52cbbed9cb2325d679bd2691bc085c41791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
NEW_LEDS support for the loft board

Signed-off-by: John Bowler <jbowler@acm.org>

--- linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c	1970-01-01 00:00:00.000000000 +0000
@@ -15,6 +15,7 @@
 #include <linux/tty.h>
 #include <linux/serial_8250.h>
 #include <linux/eeprom.h>
+#include <linux/leds.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
@@ -200,6 +201,29 @@ MACHINE_END
  * maybe the ixdp425 too.
  */
 #ifdef CONFIG_MACH_LOFT
+#ifdef CONFIG_LEDS_CLASS
+static struct resource loft_led_resources[] = {
+	{
+		.name		= "ready",  /* green led, also J8 pin 7 */
+		.start		= 3,
+		.end		= 3,
+		.flags		= IXP4XX_GPIO_LOW,
+	},
+};
+
+static struct platform_device loft_leds = {
+	.name			= "IXP4XX-GPIO-LED",
+	.id			= -1,
+	.num_resources		= ARRAY_SIZE(loft_led_resources),
+	.resource		= loft_led_resources,
+};
+#endif
+
+static struct platform_device *loft_devices[] __initdata = {
+	&ixdp425_i2c_controller,
+	&ixdp425_flash,
+};
+
 /*
  * When the EEPROM is added the MAC address are read from it.
  */
@@ -244,7 +268,16 @@ static void __init loft_init(void)
 
 	ixp4xx_sys_init();
 
-	platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
+	/* Put the UART in first for debugging, don't care if it fails. */
+	(void)platform_device_register(&ixdp425_uart);
+
+	/* These should work... */
+	platform_add_devices(loft_devices, ARRAY_SIZE(loft_devices));
+
+#ifdef CONFIG_LEDS_CLASS
+	/* We don't care if this fails. */
+	(void)platform_device_register(&loft_leds);
+#endif
 }
 
 MACHINE_START(LOFT, "Giant Shoulder Inc Loft board")