add support for 2.6.32, dropped the SPI patch for now
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-2.6.32 / 140-new_bcm96348gw_leds.patch
1 Index: linux-2.6.32.9/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- linux-2.6.32.9.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-02-28 18:50:37.000000000 +0100
4 +++ linux-2.6.32.9/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-02-28 18:54:31.000000000 +0100
5 @@ -336,24 +336,39 @@
6 .active_low = 1,
7 },
8 {
9 - .name = "ppp",
10 - .gpio = 3,
11 + .name = "power",
12 + .gpio = 0,
13 .active_low = 1,
14 + .default_trigger = "default-on",
15 },
16 {
17 - .name = "ppp-fail",
18 + .name = "stop",
19 + .gpio = 1,
20 + .active_low = 1,
21 + },
22 + {
23 + .name = "line1",
24 .gpio = 4,
25 .active_low = 1,
26 },
27 {
28 - .name = "power",
29 - .gpio = 0,
30 + .name = "line2",
31 + .gpio = 5,
32 .active_low = 1,
33 - .default_trigger = "default-on",
34 },
35 {
36 - .name = "stop",
37 - .gpio = 1,
38 + .name = "line3",
39 + .gpio = 6,
40 + .active_low = 1,
41 + },
42 + {
43 + .name = "tel",
44 + .gpio = 7,
45 + .active_low = 1,
46 + },
47 + {
48 + .name = "eth",
49 + .gpio = 35,
50 .active_low = 1,
51 },
52 },
53 @@ -855,6 +870,7 @@
54 int __init board_register_devices(void)
55 {
56 u32 val;
57 + int led_count = 0;
58
59 if (board.has_pccard)
60 bcm63xx_pcmcia_register();
61 @@ -901,7 +917,11 @@
62
63 platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
64
65 - bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
66 + /* count number of LEDs defined by this device */
67 + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
68 + led_count++;
69 +
70 + bcm63xx_led_data.num_leds = led_count;
71 bcm63xx_led_data.leds = board.leds;
72
73 platform_device_register(&bcm63xx_gpio_leds);
74 Index: linux-2.6.32.9/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
75 ===================================================================
76 --- linux-2.6.32.9.orig/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-02-28 18:54:39.000000000 +0100
77 +++ linux-2.6.32.9/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h 2010-02-28 18:54:49.000000000 +0100
78 @@ -54,7 +54,7 @@
79 struct bcm63xx_dsp_platform_data dsp;
80
81 /* GPIO LEDs */
82 - struct gpio_led leds[5];
83 + struct gpio_led leds[8];
84
85 /* Reset button */
86 struct gpio_button reset_buttons[1];