]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: fdt: remove property 'xceiver-supply' if no can xcvr present
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 6 Mar 2014 11:05:26 +0000 (12:05 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 6 Mar 2014 11:05:26 +0000 (12:05 +0100)
board/karo/common/fdt.c

index 9dbe75708488804842d6c2b679ae6cf96831611c..08fe69588c723db2765473250afaef21a91a08c4 100644 (file)
@@ -336,21 +336,32 @@ static inline void karo_fdt_set_lcd_pins(void *blob, const char *name)
 void karo_fdt_fixup_flexcan(void *blob, int xcvr_present)
 {
        int ret;
-       const char *xcvr_status = xcvr_present ? "disabled" : NULL;
+       const char *xcvr_status = "disabled";
        const char *otg_mode = getenv("otg_mode");
 
-#ifndef CONFIG_SYS_LVDS_IF
        if (xcvr_present) {
                if (karo_fdt_flexcan_enabled(blob)) {
-                       karo_fdt_set_lcd_pins(blob, "lcdif_23bit_pins_a");
-                       xcvr_status = NULL;
-               } else {
+                       if (!is_lvds()) {
+                               debug("Changing LCD to use 23bits only\n");
+                               karo_fdt_set_lcd_pins(blob, "lcdif_23bit_pins_a");
+                               xcvr_status = NULL;
+                       }
+               } else if (!is_lvds()) {
+                       debug("Changing LCD to use 24bits\n");
                        karo_fdt_set_lcd_pins(blob, "lcdif_24bit_pins_a");
                }
        } else {
-               karo_fdt_set_lcd_pins(blob, "lcdif_24bit_pins_a");
+               int off = fdt_path_offset(blob, "can0");
+
+               if (off >= 0)
+                       fdt_delprop(blob, off, "xceiver-supply");
+               off = fdt_path_offset(blob, "can1");
+               if (off >= 0)
+                       fdt_delprop(blob, off, "xceiver-supply");
+               if (!is_lvds())
+                       karo_fdt_set_lcd_pins(blob, "lcdif_24bit_pins_a");
        }
-#endif
+
        if (otg_mode && strcmp(otg_mode, "host") == 0)
                karo_fdt_enable_node(blob, "can1", 0);