8f9ca8be5a75fef5cad26227905ada3b718ec929
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-2.6.32 / 140-new_bcm96348gw_leds.patch
1 Index: linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- linux-2.6.32.13.orig/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:36:02.000000000 -0400
4 +++ linux-2.6.32.13/arch/mips/bcm63xx/boards/board_bcm963xx.c 2010-05-27 21:40:56.000000000 -0400
5 @@ -331,29 +331,28 @@
6
7 .leds = {
8 {
9 - .name = "adsl-fail",
10 - .gpio = 2,
11 + .name = "line1",
12 + .gpio = 4,
13 .active_low = 1,
14 },
15 {
16 - .name = "ppp",
17 - .gpio = 3,
18 + .name = "line2",
19 + .gpio = 5,
20 .active_low = 1,
21 },
22 {
23 - .name = "ppp-fail",
24 - .gpio = 4,
25 + .name = "line3",
26 + .gpio = 6,
27 .active_low = 1,
28 },
29 {
30 - .name = "power",
31 - .gpio = 0,
32 + .name = "tel",
33 + .gpio = 7,
34 .active_low = 1,
35 - .default_trigger = "default-on",
36 },
37 {
38 - .name = "stop",
39 - .gpio = 1,
40 + .name = "eth",
41 + .gpio = 35,
42 .active_low = 1,
43 },
44 },
45 @@ -855,6 +854,7 @@
46 int __init board_register_devices(void)
47 {
48 u32 val;
49 + int led_count = 0;
50 int button_count = 0;
51
52 if (board.has_pccard)
53 @@ -902,7 +902,11 @@
54
55 platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1);
56
57 - bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds);
58 + /* count number of LEDs defined by this device */
59 + while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
60 + led_count++;
61 +
62 + bcm63xx_led_data.num_leds = led_count;
63 bcm63xx_led_data.leds = board.leds;
64
65 platform_device_register(&bcm63xx_gpio_leds);