MIPS: OCTEON: add GPIO LED support for DSR-1000N
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sun, 29 Mar 2015 21:04:56 +0000 (00:04 +0300)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 1 Apr 2015 15:22:10 +0000 (17:22 +0200)
DSR-1000N board has two GPIO LEDs next to USB ports. Add support for them.

[ralf@linux-mips.org: Resolved conflict due to the moving of the DTS files
into vendor subdirectories.]

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9624/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/boot/dts/cavium-octeon/octeon_3xxx.dts
arch/mips/cavium-octeon/octeon-platform.c

index fa33115bde3337914f913767fcd4e8fbaf8d7e6c..9c48e0586ba770ccb40a0e6e41c3878e8d015dca 100644 (file)
                usbn = &usbn;
                led0 = &led0;
        };
+
+       dsr1000n-leds {
+               compatible = "gpio-leds";
+               usb1 {
+                       label = "usb1";
+                       gpios = <&gpio 9 1>; /* Active low */
+               };
+               usb2 {
+                       label = "usb2";
+                       gpios = <&gpio 10 1>; /* Active low */
+               };
+       };
  };
index 12410a2788d8299ab37edd1c604eb98543236320..e1d56f32f784abc09eb6fe1d89643bf41ee024a4 100644 (file)
@@ -958,6 +958,13 @@ end_led:
                }
        }
 
+       if (octeon_bootinfo->board_type != CVMX_BOARD_TYPE_CUST_DSR1000N) {
+               int dsr1000n_leds = fdt_path_offset(initial_boot_params,
+                                                   "/dsr1000n-leds");
+               if (dsr1000n_leds >= 0)
+                       fdt_nop_node(initial_boot_params, dsr1000n_leds);
+       }
+
        return 0;
 }