]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: fdt: look for 'backlight' alias or '/backlight0' if no '/backlight' node exists
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 6 Mar 2014 11:07:09 +0000 (12:07 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 6 Mar 2014 11:07:09 +0000 (12:07 +0100)
board/karo/common/fdt.c

index 08fe69588c723db2765473250afaef21a91a08c4..af85f0612b87416dc1ce79d6021203bb10b3256d 100644 (file)
@@ -789,13 +789,25 @@ u8 karo_fdt_get_lvds_channels(const void *blob)
 
 int karo_fdt_get_backlight_polarity(const void *blob)
 {
-       int off = fdt_path_offset(blob, "/backlight");
+#ifdef CONFIG_SYS_LVDS_IF
+       const char *backlight_node = "/backlight0";
+#else
+       const char *backlight_node = "/backlight";
+#endif
+       int off = fdt_path_offset(blob, "backlight"); /* first try alias */
        const struct fdt_property *prop;
        int len;
 
        if (off < 0) {
-               printf("/backlight node not found in DT\n");
-               return off;
+               /*
+                * if no 'backlight' alias exists try finding '/backlight0'
+                * or '/backlight' depending on LVDS or not
+                */
+               off = fdt_path_offset(blob, backlight_node);
+               if (off < 0) {
+                       printf("/backlight node not found in DT\n");
+                       return off;
+               }
        }
 
        prop = fdt_get_property(blob, off, "pwms", &len);