]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
video: mxc: use of_get_videomode() to set up the video timing
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Jul 2014 08:53:15 +0000 (10:53 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Jul 2014 08:53:15 +0000 (10:53 +0200)
13 files changed:
arch/arm/boot/dts/imx6dl-tx6dl-comtft.dts
arch/arm/boot/dts/imx6dl-tx6u-801x.dts
arch/arm/boot/dts/imx6dl-tx6u-811x.dts
arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dts
arch/arm/boot/dts/imx6q-tx6q-1010.dts
arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts
arch/arm/boot/dts/imx6q-tx6q-1020.dts
arch/arm/boot/dts/imx6q-tx6q-1110.dts
drivers/video/mxc/Kconfig
drivers/video/mxc/ldb.c
drivers/video/mxc/mxc_dispdrv.h
drivers/video/mxc/mxc_ipuv3_fb.c
drivers/video/mxc/mxc_lcdif.c

index 1c602a4e733cd04f45859c83568348bfe5fe2e1f..98e3e04c0771a7681acb6a69c46007e095cc9b5f 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       native-mode = <&ET070001DM6>;
+
+                       ET070001DM6: CoMTFT { /* same as ET0700 but with inverted pixel clock */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+               };
        };
 };
 
index 288fe3762298f352c9dbac6fa9a2227c7b033133..924c412e28bf708321c311c0c98e86e4e790e6f6 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       VGA {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <48>;
+                               hsync-len = <96>;
+                               hfront-porch = <16>;
+                               vback-porch = <31>;
+                               vsync-len = <2>;
+                               vfront-porch = <12>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETV570 {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <114>;
+                               hsync-len = <30>;
+                               hfront-porch = <16>;
+                               vback-porch = <32>;
+                               vsync-len = <3>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0350 {
+                               clock-frequency = <6413760>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <34>;
+                               hsync-len = <34>;
+                               hfront-porch = <20>;
+                               vback-porch = <15>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0430 {
+                               clock-frequency = <9009000>;
+                               hactive = <480>;
+                               vactive = <272>;
+                               hback-porch = <2>;
+                               hsync-len = <41>;
+                               hfront-porch = <2>;
+                               vback-porch = <2>;
+                               vsync-len = <10>;
+                               vfront-porch = <2>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+
+                       ET0500 {
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0700 { /* same as ET0500 */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETQ570 {
+                               clock-frequency = <6596040>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <38>;
+                               hsync-len = <30>;
+                               hfront-porch = <30>;
+                               vback-porch = <16>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+               };
        };
 };
 
index 75e8be8b84247c0f5f92ab213d99de270c4d6d07..37dcbba082f2343661cfaf706e3e44fd98821957 100644 (file)
@@ -19,6 +19,7 @@
 
        aliases {
                display = &lvds0;
+               lvds0 = &lvds0;
                mxcfb0 = &lvds0;
        };
 
        sec_ipu_id = <1>;
        sec_disp_id = <1>;
        status = "okay";
+
+       display-timings {
+               native-mode = <&lvds_timing0>;
+
+               lvds_timing0: hsd100pxn1 {
+                       clock-frequency = <65000000>;
+                       hactive = <1024>;
+                       vactive = <768>;
+                       hback-porch = <220>;
+                       hfront-porch = <40>;
+                       vback-porch = <21>;
+                       vfront-porch = <7>;
+                       hsync-len = <60>;
+                       vsync-len = <10>;
+                       de-active = <1>;
+                       pixelclk-active = <1>;
+               };
+       };
 };
 
 &pwm1 {
index 8c6f6b9d8ad1ab5d955664b4e02ba5d72b284463..e170d4e69a5879c852b80ed92ff6bb4eebd4aaf2 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6q-tx6q", "fsl,imx6q";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       native-mode = <&ET070001DM6>;
+
+                       ET070001DM6: CoMTFT { /* same as ET0700 but with inverted pixel clock */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+               };
        };
 };
 
index 01c1414428817724fdbfbbb64d3a31316a1f52ee..f20b774e46b8df399e993492f1e519cfdff8fa8d 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6q-tx6q", "fsl,imx6q";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       VGA {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <48>;
+                               hsync-len = <96>;
+                               hfront-porch = <16>;
+                               vback-porch = <31>;
+                               vsync-len = <2>;
+                               vfront-porch = <12>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETV570 {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <114>;
+                               hsync-len = <30>;
+                               hfront-porch = <16>;
+                               vback-porch = <32>;
+                               vsync-len = <3>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0350 {
+                               clock-frequency = <6413760>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <34>;
+                               hsync-len = <34>;
+                               hfront-porch = <20>;
+                               vback-porch = <15>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0430 {
+                               clock-frequency = <9009000>;
+                               hactive = <480>;
+                               vactive = <272>;
+                               hback-porch = <2>;
+                               hsync-len = <41>;
+                               hfront-porch = <2>;
+                               vback-porch = <2>;
+                               vsync-len = <10>;
+                               vfront-porch = <2>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+
+                       ET0500 {
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0700 { /* same as ET0500 */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETQ570 {
+                               clock-frequency = <6596040>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <38>;
+                               hsync-len = <30>;
+                               hfront-porch = <30>;
+                               vback-porch = <16>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+               };
        };
 };
 
index 70655fede36249acb4babcfd83b47251480bbf25..8f8a26146093cedaae516f84d2d2ea9470049635 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6q-tx6q", "fsl,imx6q";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       native-mode = <&ET070001DM6>;
+
+                       ET070001DM6: CoMTFT { /* same as ET0700 but with inverted pixel clock */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+               };
        };
 };
 
index c33206d1d39ccb32d38914e54a92f5b76a501827..33fab4db03c60f6f0f7d2f12e9dd4506ab699544 100644 (file)
@@ -18,7 +18,7 @@
        compatible = "karo,imx6q-tx6q", "fsl,imx6q";
 
        aliases {
-               display = &display;
+               display = &lcd;
                mxcfb0 = &display;
        };
 
                                     90 91 92 93 94 95 96 97 98 99
                                    100>;
                default-brightness-level = <50>;
-        };
+       };
 
        display: fb@2 {
                compatible = "fsl,mxc_sdc_fb";
                disp_dev = "lcd";
                interface_pix_fmt = "RGB24";
-               mode_str ="ET0500";
+               mode_str = "";
                default_bpp = <32>;
                int_clk = <1>;
                late_init = <0>;
                status = "okay";
        };
 
-       lcd@0 {
+       lcd: lcd@0 {
                compatible = "fsl,lcd";
                ipu_id = <0>;
                disp_id = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_disp0_2>;
                status = "okay";
+
+               display-timings {
+                       VGA {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <48>;
+                               hsync-len = <96>;
+                               hfront-porch = <16>;
+                               vback-porch = <31>;
+                               vsync-len = <2>;
+                               vfront-porch = <12>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETV570 {
+                               clock-frequency = <25200000>;
+                               hactive = <640>;
+                               vactive = <480>;
+                               hback-porch = <114>;
+                               hsync-len = <30>;
+                               hfront-porch = <16>;
+                               vback-porch = <32>;
+                               vsync-len = <3>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0350 {
+                               clock-frequency = <6413760>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <34>;
+                               hsync-len = <34>;
+                               hfront-porch = <20>;
+                               vback-porch = <15>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0430 {
+                               clock-frequency = <9009000>;
+                               hactive = <480>;
+                               vactive = <272>;
+                               hback-porch = <2>;
+                               hsync-len = <41>;
+                               hfront-porch = <2>;
+                               vback-porch = <2>;
+                               vsync-len = <10>;
+                               vfront-porch = <2>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <1>;
+                       };
+
+                       ET0500 {
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ET0700 { /* same as ET0500 */
+                               clock-frequency = <33264000>;
+                               hactive = <800>;
+                               vactive = <480>;
+                               hback-porch = <88>;
+                               hsync-len = <128>;
+                               hfront-porch = <40>;
+                               vback-porch = <33>;
+                               vsync-len = <2>;
+                               vfront-porch = <10>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+
+                       ETQ570 {
+                               clock-frequency = <6596040>;
+                               hactive = <320>;
+                               vactive = <240>;
+                               hback-porch = <38>;
+                               hsync-len = <30>;
+                               hfront-porch = <30>;
+                               vback-porch = <16>;
+                               vsync-len = <3>;
+                               vfront-porch = <4>;
+                               hsync-active = <0>;
+                               vsync-active = <0>;
+                               de-active = <1>;
+                               pixelclk-active = <0>;
+                       };
+               };
        };
 };
 
index 75fdbde8e058c3349e647db6a1c16bcbcff32282..bbd3c6036f013d421739e7dca9bf2209121076ad 100644 (file)
@@ -20,6 +20,7 @@
        aliases {
                display = &lvds0;
                ipu1 = &ipu2;
+               lvds0 = &lvds0;
                mxcfb0 = &lvds0;
        };
 
        sec_ipu_id = <1>;
        sec_disp_id = <1>;
        status = "okay";
+
+       display-timings {
+               native-mode = <&lvds_timing0>;
+
+               lvds_timing0: hsd100pxn1 {
+                       clock-frequency = <65000000>;
+                       hactive = <1024>;
+                       vactive = <768>;
+                       hback-porch = <220>;
+                       hfront-porch = <40>;
+                       vback-porch = <21>;
+                       vfront-porch = <7>;
+                       hsync-len = <60>;
+                       vsync-len = <10>;
+                       de-active = <1>;
+                       pixelclk-active = <1>;
+               };
+       };
 };
 
 &pwm1 {
index 2269de1e02cbc3f564bd34042d3886d10c6fba00..8aa05618727b0dbb86cf03dcb610d0604b3be971 100644 (file)
@@ -17,11 +17,13 @@ config FB_MXC
 config FB_MXC_SYNC_PANEL
        depends on FB_MXC
        tristate "Synchronous Panel Framebuffer"
+       select VIDEOMODE_HELPERS
 
 config FB_MXC_LDB
        tristate "MXC LDB"
        depends on FB_MXC_SYNC_PANEL
        depends on MXC_IPU_V3
+       select VIDEOMODE_HELPERS
 
 config FB_MXC_MIPI_DSI
        tristate "MXC MIPI_DSI"
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;
index 127fd08ea391b13df979ad672b8ce9cfc2d51b70..8c8877c06ddc0ef29597b34438113f94452b087d 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef __MXC_DISPDRV_H__
 #define __MXC_DISPDRV_H__
 #include <linux/fb.h>
+#include <video/display_timing.h>
 
 struct mxc_dispdrv_handle {
        struct mxc_dispdrv_driver *drv;
@@ -28,6 +29,7 @@ struct mxc_dispdrv_setting {
        /*feedback parameter*/
        int dev_id;
        int disp_id;
+       enum display_flags disp_flags;
 };
 
 struct mxc_dispdrv_driver {
index f022b557ee60675ec63d4c86422765d6df8b80a5..0da0c9bfa54560f8c64d23326636eac482e6f384 100644 (file)
@@ -87,7 +87,7 @@ struct mxcfb_info {
 
        u32 pseudo_palette[16];
 
-       bool mode_found;
+       enum display_flags disp_flags;
        struct completion flip_complete;
        struct completion alpha_flip_complete;
        struct completion vsync_complete;
@@ -595,7 +595,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
                        sig_cfg.Hsync_pol = true;
                if (fbi->var.sync & FB_SYNC_VERT_HIGH_ACT)
                        sig_cfg.Vsync_pol = true;
-               if (!(fbi->var.sync & FB_SYNC_CLK_LAT_FALL))
+               if (mxc_fbi->disp_flags & DISPLAY_FLAGS_PIXDATA_POSEDGE)
                        sig_cfg.clk_pol = true;
                if (fbi->var.sync & FB_SYNC_DATA_INVERT)
                        sig_cfg.data_pol = true;
@@ -1894,7 +1894,7 @@ static int mxcfb_dispdrv_init(struct platform_device *pdev,
 {
        struct ipuv3_fb_platform_data *plat_data = pdev->dev.platform_data;
        struct mxcfb_info *mxcfbi = (struct mxcfb_info *)fbi->par;
-       struct mxc_dispdrv_setting setting;
+       struct mxc_dispdrv_setting setting = {};
        char disp_dev[32], *default_dev = "lcd";
        int ret = 0;
 
@@ -1925,6 +1925,7 @@ static int mxcfb_dispdrv_init(struct platform_device *pdev,
                /* setting */
                mxcfbi->ipu_id = setting.dev_id;
                mxcfbi->ipu_di = setting.disp_id;
+               mxcfbi->disp_flags = setting.disp_flags;
                dev_dbg(&pdev->dev, "di_pixfmt:0x%x, bpp:0x%x, di:%d, ipu:%d\n",
                                setting.if_fmt, setting.default_bpp,
                                setting.disp_id, setting.dev_id);
index 3ec736068aa44826271357dc00ab8d90f5433f8e..e18731e238d91dd6cffefeac02a54171c0085e73 100644 (file)
@@ -19,6 +19,9 @@
 #include <linux/of_device.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+#include <video/videomode.h>
 
 #include "mxc_dispdrv.h"
 
@@ -26,6 +29,7 @@ struct mxc_lcd_platform_data {
        u32 default_ifmt;
        u32 ipu_id;
        u32 disp_id;
+       enum display_flags disp_flags;
 };
 
 struct mxc_lcdif_data {
@@ -207,6 +211,18 @@ static int lcd_get_of_property(struct device *dev,
                return err;
        }
 
+       {
+               struct videomode vm = { };
+
+               err = of_get_videomode(np, &vm, OF_USE_NATIVE_MODE);
+               if (err == 0) {
+                       dev_dbg(dev, "Copying videomode from display-timings\n");
+                       fb_videomode_from_videomode(&vm, &lcdif_modedb[0]);
+                       plat_data->disp_flags = vm.flags;
+                       lcdif_modedb_sz = 1;
+               }
+       }
+
        plat_data->ipu_id = ipu_id;
        plat_data->disp_id = disp_id;
        if (!strncmp(default_ifmt, "RGB24", 5))