xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/video/rockchip_mipidsi_lcd.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDevice-Tree bindings for rockchip mipi dsi lcd driver
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunRequired properties:
4*4882a593Smuzhiyun - rockchip,screen_init: Whether you need this screen initialization.
5*4882a593Smuzhiyun	<0>: Don't need to be initialized.
6*4882a593Smuzhiyun	<1>: Do need to be initialized.
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun - rockchip,dsi_lane: mipi lcd data lane number.
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun - rockchip,dsi_hs_clk: mipi lcd high speed clock.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun - rockchip,mipi_dsi_num: mipi lcd dsi number.
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun - mipi_lcd_rst:mipi_lcd_rst: Should specify pin control groups used for reset this lcd.
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun - mipi_lcd_en:mipi_lcd_en: Should specify pin control groups used for enable this lcd.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun - rockchip,gpios: gpio pin
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun - rockchip,delay: delay the millisecond.
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun - rockchip,cmd_debug : debug the cammands.
23*4882a593Smuzhiyun	<0>: close the debug;
24*4882a593Smuzhiyun	<1>: open the debug;
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun - rockchip,on-cmds1: write cammand to mipi lcd.
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun- rockchip,cmd_type:
29*4882a593Smuzhiyun	<LPDT>: close the debug;
30*4882a593Smuzhiyun	<HSDT>: open the debug;
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun - rockchip,dsi_id: write cammand to mipi lcd(left and right).
33*4882a593Smuzhiyun	<0>: left dsi;
34*4882a593Smuzhiyun	<1>: right dsi;
35*4882a593Smuzhiyun	<2>: left and right dsis;
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun - rockchip,cmd: cammand context.
38*4882a593Smuzhiyun 	The first parameter was data type;
39*4882a593Smuzhiyun 	The second parameter was index(register);
40*4882a593Smuzhiyun 	The third and ... parameter are cammand context;
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun - rockchip,cmd_delay: delay the millisecond.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun - screen-type: mipi lcd type.
45*4882a593Smuzhiyun 	<SCREEN_DUAL_MIPI>: Dual channel mipi lcd.
46*4882a593Smuzhiyun 	<SCREEN_MIPI>: single channel mipi lcd.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun - lvds-format:No relationship.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun - out-face: DPI color coding as follows:
51*4882a593Smuzhiyun 	<OUT_P888>:24bit
52*4882a593Smuzhiyun 	<OUT_P666>:18bit
53*4882a593Smuzhiyun 	<OUT_P565>:16bit
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun - hactive, vactive: display resolution
56*4882a593Smuzhiyun - hfront-porch, hback-porch, hsync-len: horizontal display timing parameters
57*4882a593Smuzhiyun   in pixels
58*4882a593Smuzhiyun   vfront-porch, vback-porch, vsync-len: vertical display timing parameters in
59*4882a593Smuzhiyun   lines
60*4882a593Smuzhiyun - clock-frequency: display clock in Hz
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun - swap-rb :exchange of red and blue.
63*4882a593Smuzhiyun - swap-rg :exchange of red and green.
64*4882a593Smuzhiyun - swap-gb :exchange of green and blue.
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun - hsync-active: hsync pulse is active low/high/ignored
67*4882a593Smuzhiyun - vsync-active: vsync pulse is active low/high/ignored
68*4882a593Smuzhiyun - de-active: data-enable pulse is active low/high/ignored
69*4882a593Smuzhiyun - pixelclk-active: with
70*4882a593Smuzhiyun			- active high = drive pixel data on rising edge/
71*4882a593Smuzhiyun					sample data on falling edge
72*4882a593Smuzhiyun			- active low  = drive pixel data on falling edge/
73*4882a593Smuzhiyun					sample data on rising edge
74*4882a593Smuzhiyun			- ignored     = ignored
75*4882a593Smuzhiyun - interlaced (bool): boolean to enable interlaced mode
76*4882a593Smuzhiyun - doublescan (bool): boolean to enable doublescan mode
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunAll the optional properties that are not bool follow the following logic:
79*4882a593Smuzhiyun    <1>: high active
80*4882a593Smuzhiyun    <0>: low active
81*4882a593Smuzhiyun    omitted: not used on hardware
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunThere are different ways of describing the capabilities of a display. The
84*4882a593Smuzhiyundevicetree representation corresponds to the one commonly found in datasheets
85*4882a593Smuzhiyunfor displays. If a display supports multiple signal timings, the native-mode
86*4882a593Smuzhiyuncan be specified.
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunThe parameters are defined as:
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun  +----------+-------------------------------------+----------+-------+
91*4882a593Smuzhiyun  |          |        ��                            |          |       |
92*4882a593Smuzhiyun  |          |        |vback_porch                 |          |       |
93*4882a593Smuzhiyun  |          |        ��                            |          |       |
94*4882a593Smuzhiyun  +----------#######################################----------+-------+
95*4882a593Smuzhiyun  |          #        ��                            #          |       |
96*4882a593Smuzhiyun  |          #        |                            #          |       |
97*4882a593Smuzhiyun  |  hback   #        |                            #  hfront  | hsync |
98*4882a593Smuzhiyun  |   porch  #        |       hactive              #  porch   |  len  |
99*4882a593Smuzhiyun  |<-------->#<-------+--------------------------->#<-------->|<----->|
100*4882a593Smuzhiyun  |          #        |                            #          |       |
101*4882a593Smuzhiyun  |          #        |vactive                     #          |       |
102*4882a593Smuzhiyun  |          #        |                            #          |       |
103*4882a593Smuzhiyun  |          #        ��                            #          |       |
104*4882a593Smuzhiyun  +----------#######################################----------+-------+
105*4882a593Smuzhiyun  |          |        ��                            |          |       |
106*4882a593Smuzhiyun  |          |        |vfront_porch                |          |       |
107*4882a593Smuzhiyun  |          |        ��                            |          |       |
108*4882a593Smuzhiyun  +----------+-------------------------------------+----------+-------+
109*4882a593Smuzhiyun  |          |        ��                            |          |       |
110*4882a593Smuzhiyun  |          |        |vsync_len                   |          |       |
111*4882a593Smuzhiyun  |          |        ��                            |          |       |
112*4882a593Smuzhiyun  +----------+-------------------------------------+----------+-------+
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunExample:
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun{
118*4882a593Smuzhiyun		/* about mipi */
119*4882a593Smuzhiyun		disp_mipi_init: mipi_dsi_init{
120*4882a593Smuzhiyun					rockchip,screen_init	= <1>;
121*4882a593Smuzhiyun					rockchip,dsi_lane		= <4>;
122*4882a593Smuzhiyun					rockchip,dsi_hs_clk		= <1020>;
123*4882a593Smuzhiyun					rockchip,mipi_dsi_num	= <2>;
124*4882a593Smuzhiyun		};
125*4882a593Smuzhiyun		disp_mipi_power_ctr: mipi_power_ctr {
126*4882a593Smuzhiyun					mipi_lcd_rst:mipi_lcd_rst{
127*4882a593Smuzhiyun							rockchip,gpios = <&gpio7 GPIO_B2 GPIO_ACTIVE_HIGH>;
128*4882a593Smuzhiyun							rockchip,delay = <10>;
129*4882a593Smuzhiyun					};
130*4882a593Smuzhiyun					/*mipi_lcd_en:mipi_lcd_en {
131*4882a593Smuzhiyun							rockchip,gpios = <&gpio6 GPIO_A7 GPIO_ACTIVE_HIGH>;
132*4882a593Smuzhiyun							rockchip,delay = <10>;
133*4882a593Smuzhiyun					};*/
134*4882a593Smuzhiyun		};
135*4882a593Smuzhiyun		disp_mipi_init_cmds: screen-on-cmds {
136*4882a593Smuzhiyun					rockchip,cmd_debug = <0>;
137*4882a593Smuzhiyun                    rockchip,on-cmds1 {
138*4882a593Smuzhiyun							rockchip,cmd_type = <LPDT>;
139*4882a593Smuzhiyun							rockchip,dsi_id = <2>;
140*4882a593Smuzhiyun							rockchip,cmd = <0x05 0x01>; //set soft reset
141*4882a593Smuzhiyun							rockchip,cmd_delay = <10>;
142*4882a593Smuzhiyun					};
143*4882a593Smuzhiyun		};
144*4882a593Smuzhiyun
145*4882a593Smuzhiyun		disp_timings: display-timings {
146*4882a593Smuzhiyun                        native-mode = <&timing0>;
147*4882a593Smuzhiyun                        timing0: timing0 {
148*4882a593Smuzhiyun				screen-type = <SCREEN_DUAL_MIPI>;
149*4882a593Smuzhiyun				lvds-format = <LVDS_8BIT_2>;
150*4882a593Smuzhiyun				out-face    = <OUT_P888>;
151*4882a593Smuzhiyun				clock-frequency = <285000000>;
152*4882a593Smuzhiyun				hactive = <2560>;
153*4882a593Smuzhiyun				vactive = <1600>;
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun				hsync-len = <38>;//19
156*4882a593Smuzhiyun				hback-porch = <80>;//40
157*4882a593Smuzhiyun				hfront-porch = <246>;//123
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun				vsync-len = <4>;
160*4882a593Smuzhiyun				vback-porch = <4>;
161*4882a593Smuzhiyun				vfront-porch = <12>;
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun				hsync-active = <0>;
164*4882a593Smuzhiyun				vsync-active = <0>;
165*4882a593Smuzhiyun				de-active = <0>;
166*4882a593Smuzhiyun				pixelclk-active = <0>;
167*4882a593Smuzhiyun				swap-rb = <0>;
168*4882a593Smuzhiyun				swap-rg = <0>;
169*4882a593Smuzhiyun				swap-gb = <0>;
170*4882a593Smuzhiyun                     	};
171*4882a593Smuzhiyun               };
172*4882a593Smuzhiyun};
173*4882a593Smuzhiyun
174