From: Lothar Waßmann Date: Wed, 9 Jul 2014 08:53:15 +0000 (+0200) Subject: video: mxc: use of_get_videomode() to set up the video timing X-Git-Tag: KARO-TX6-2014-07-10~12 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=46808261757b25a4d2a2fcddac345169afaa8251;p=karo-tx-linux.git video: mxc: use of_get_videomode() to set up the video timing --- diff --git a/arch/arm/boot/dts/imx6dl-tx6dl-comtft.dts b/arch/arm/boot/dts/imx6dl-tx6dl-comtft.dts index 1c602a4e733c..98e3e04c0771 100644 --- a/arch/arm/boot/dts/imx6dl-tx6dl-comtft.dts +++ b/arch/arm/boot/dts/imx6dl-tx6dl-comtft.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,26 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6dl-tx6u-801x.dts b/arch/arm/boot/dts/imx6dl-tx6u-801x.dts index 288fe3762298..924c412e28bf 100644 --- a/arch/arm/boot/dts/imx6dl-tx6u-801x.dts +++ b/arch/arm/boot/dts/imx6dl-tx6u-801x.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,120 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6dl-tx6u-811x.dts b/arch/arm/boot/dts/imx6dl-tx6u-811x.dts index 75e8be8b8424..37dcbba082f2 100644 --- a/arch/arm/boot/dts/imx6dl-tx6u-811x.dts +++ b/arch/arm/boot/dts/imx6dl-tx6u-811x.dts @@ -19,6 +19,7 @@ aliases { display = &lvds0; + lvds0 = &lvds0; mxcfb0 = &lvds0; }; @@ -113,6 +114,24 @@ 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 { diff --git a/arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dts b/arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dts index 8c6f6b9d8ad1..e170d4e69a58 100644 --- a/arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dts +++ b/arch/arm/boot/dts/imx6q-tx6q-1010-comtft.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6q-tx6q", "fsl,imx6q"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,26 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6q-tx6q-1010.dts b/arch/arm/boot/dts/imx6q-tx6q-1010.dts index 01c141442881..f20b774e46b8 100644 --- a/arch/arm/boot/dts/imx6q-tx6q-1010.dts +++ b/arch/arm/boot/dts/imx6q-tx6q-1010.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6q-tx6q", "fsl,imx6q"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,120 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts b/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts index 70655fede362..8f8a26146093 100644 --- a/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts +++ b/arch/arm/boot/dts/imx6q-tx6q-1020-comtft.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6q-tx6q", "fsl,imx6q"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,26 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6q-tx6q-1020.dts b/arch/arm/boot/dts/imx6q-tx6q-1020.dts index c33206d1d39c..33fab4db03c6 100644 --- a/arch/arm/boot/dts/imx6q-tx6q-1020.dts +++ b/arch/arm/boot/dts/imx6q-tx6q-1020.dts @@ -18,7 +18,7 @@ compatible = "karo,imx6q-tx6q", "fsl,imx6q"; aliases { - display = &display; + display = &lcd; mxcfb0 = &display; }; @@ -42,20 +42,20 @@ 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>; @@ -63,6 +63,120 @@ 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>; + }; + }; }; }; diff --git a/arch/arm/boot/dts/imx6q-tx6q-1110.dts b/arch/arm/boot/dts/imx6q-tx6q-1110.dts index 75fdbde8e058..bbd3c6036f01 100644 --- a/arch/arm/boot/dts/imx6q-tx6q-1110.dts +++ b/arch/arm/boot/dts/imx6q-tx6q-1110.dts @@ -20,6 +20,7 @@ aliases { display = &lvds0; ipu1 = &ipu2; + lvds0 = &lvds0; mxcfb0 = &lvds0; }; @@ -118,6 +119,24 @@ 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 { diff --git a/drivers/video/mxc/Kconfig b/drivers/video/mxc/Kconfig index 2269de1e02cb..8aa05618727b 100644 --- a/drivers/video/mxc/Kconfig +++ b/drivers/video/mxc/Kconfig @@ -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" diff --git a/drivers/video/mxc/ldb.c b/drivers/video/mxc/ldb.c index f19499599049..bc4a7539c70f 100644 --- a/drivers/video/mxc/ldb.c +++ b/drivers/video/mxc/ldb.c @@ -38,6 +38,10 @@ #include #include #include +#include