]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/video/mxc/ldb.c
video: mxc: use of_get_videomode() to set up the video timing
[karo-tx-linux.git] / drivers / video / mxc / ldb.c
index f194995990499ab87c04443b0e83a07bb1db0a7f..bc4a7539c70f874a57cbf4261c1db4c9675f6bbf 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/of_device.h>
 #include <linux/mod_devicetable.h>
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+#include <video/videomode.h>
+
 #include "mxc_dispdrv.h"
 
 #define DISPDRV_LDB    "ldb"
@@ -287,6 +291,16 @@ static int ldb_get_of_property(struct platform_device *pdev,
                return err;
        }
 
+       if (of_display_timings_exist(np) == 1) {
+               struct videomode vm = { };
+
+               err = of_get_videomode(np, &vm, OF_USE_NATIVE_MODE);
+               if (err == 0) {
+                       fb_videomode_from_videomode(&vm, &ldb_modedb[0]);
+                       ldb_modedb_sz = 1;
+               }
+       }
+
        plat_data->mode = parse_ldb_mode(mode);
        plat_data->ext_ref = ext_ref;
        plat_data->ipu_id = ipu_id;