]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
set/evaluate de-active and pixelclk-active in DT where pssible
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 11 Oct 2013 10:51:50 +0000 (12:51 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 11 Oct 2013 10:51:50 +0000 (12:51 +0200)
board/karo/common/fdt.c

index b0c828324bbd6a887f6536ed36c76d70f10eb7f2..c942e8af52753b73fb70a3ecf41bb53a2b1474d7 100644 (file)
@@ -20,6 +20,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <nand.h>
+#include <mxcfb.h>
 #include <linux/list.h>
 #include <linux/fb.h>
 #include <jffs2/load_kernel.h>
@@ -319,14 +320,14 @@ static int fdt_init_fb_mode(const void *blob, int off, struct fb_videomode *fb_m
        prop = fdt_getprop(blob, off, "vsync-active", NULL);
        if (prop)
                fb_mode->sync |= *prop ? FB_SYNC_VERT_HIGH_ACT : 0;
-#if 0
+#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6)
        prop = fdt_getprop(blob, off, "de-active", NULL);
        if (prop)
-               fb_mode->sync |= *prop ? FB_SYNC_DATA_ENABLE_HIGH_ACT : 0;
+               fb_mode->sync |= *prop ? 0 : FB_SYNC_OE_LOW_ACT;
 
        prop = fdt_getprop(blob, off, "pixelclk-active", NULL);
        if (prop)
-               fb_mode->sync |= *prop ? FB_SYNC_DOTCLK_FALLING_ACT : 0;
+               fb_mode->sync |= *prop ? 0 : FB_SYNC_CLK_LAT_FALL;
 #endif
        return 0;
 }
@@ -510,14 +511,24 @@ int karo_fdt_create_fb_mode(void *blob, const char *name,
        if (ret)
                goto out;
 
-       /* TOTO: make these configurable */
+#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || defined(CONFIG_MX6)
+       ret = SET_FB_PROP("de-active",
+                       !(fb_mode->sync & FB_SYNC_OE_LOW_ACT));
+       if (ret)
+               goto out;
+       ret = SET_FB_PROP("pixelclk-active",
+                       !(fb_mode->sync & FB_SYNC_CLK_LAT_FALL));
+       if (ret)
+               goto out;
+#else
+       /* TODO: make these configurable */
        ret = SET_FB_PROP("de-active", 1);
        if (ret)
                goto out;
        ret = SET_FB_PROP("pixelclk-active", 1);
        if (ret)
                goto out;
-
+#endif
 out:
        karo_set_fdtsize(blob);
        return ret;