blob: 93317553312b55a8c7406bb41d60ffe7b792872a [file] [log] [blame]
Lei Chen84755442017-11-28 18:28:15 +08001/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions
5 * are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in
10 * the documentation and/or other materials provided with the
11 * distribution.
12 * * Neither the name of The Linux Foundation nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#ifndef _PANEL_HX8399C_FHD_PLUSE_VIDEO_H_
31
32#define _PANEL_HX8399C_FHD_PLUSE_VIDEO_H_
33/*---------------------------------------------------------------------------*/
34/* HEADER files */
35/*---------------------------------------------------------------------------*/
36#include "panel.h"
37
38/*---------------------------------------------------------------------------*/
39/* Panel configuration */
40/*---------------------------------------------------------------------------*/
41static struct panel_config hx8399c_fhd_pluse_video_panel_data = {
42 "qcom,mdss_dsi_hx8399c_truly_video", "dsi:0:", "qcom,mdss-dsi-panel",
43 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
44};
45
46/*---------------------------------------------------------------------------*/
47/* Panel resolution */
48/*---------------------------------------------------------------------------*/
49static struct panel_resolution hx8399c_fhd_pluse_video_panel_res = {
50 1080, 2160, 24, 24, 16, 0, 36, 40, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0
51};
52
53/*---------------------------------------------------------------------------*/
54/* Panel color information */
55/*---------------------------------------------------------------------------*/
56static struct color_info hx8399c_fhd_pluse_video_color = {
57 24, 0, 0xff, 0, 0, 0
58};
59
60/*---------------------------------------------------------------------------*/
61/* Panel on/off command information */
62/*---------------------------------------------------------------------------*/
63static char hx8399c_fhd_pluse_video_on_cmd0[] = {
64 0x04, 0x00, 0x39, 0xC0,
65 0xB9, 0xFF, 0x83, 0x99,
66};
67
68static char hx8399c_fhd_pluse_video_on_cmd1[] = {
69 0x02, 0x00, 0x39, 0xC0,
70 0xD2, 0x88, 0xFF, 0xFF,
71};
72
73static char hx8399c_fhd_pluse_video_on_cmd2[] = {
74 0x10, 0x00, 0x39, 0xC0,
75 0xB1, 0x02, 0x04, 0x74,
76 0x94, 0x01, 0x32, 0x33,
77 0x11, 0x11, 0xE6, 0x5D,
78 0x56, 0x73, 0x02, 0x02,
79};
80
81static char hx8399c_fhd_pluse_video_on_cmd3[] = {
82 0x10, 0x00, 0x39, 0xC0,
83 0xB2, 0x00, 0x80, 0x80,
84 0xCC, 0x05, 0x07, 0x5A,
85 0x11, 0x10, 0x10, 0x00,
86 0x1E, 0x70, 0x03, 0xD4,
87};
88
89static char hx8399c_fhd_pluse_video_on_cmd4[] = {
90 0x2D, 0x00, 0x39, 0xC0,
91 0xB4, 0x00, 0xFF, 0x59,
92 0x59, 0x0C, 0xAC, 0x00,
93 0x00, 0x0C, 0x00, 0x07,
94 0x0A, 0x00, 0x28, 0x07,
95 0x08, 0x0C, 0x21, 0x03,
96 0x00, 0x00, 0x00, 0xAE,
97 0x87, 0x59, 0x59, 0x0C,
98 0xAC, 0x00, 0x00, 0x0C,
99 0x00, 0x07, 0x0A, 0x00,
100 0x28, 0x07, 0x08, 0x0C,
101 0x01, 0x00, 0x00, 0xAE,
102 0x01, 0xFF, 0xFF, 0xFF,
103};
104
105static char hx8399c_fhd_pluse_video_on_cmd5[] = {
106 0x22, 0x00, 0x39, 0xC0,
107 0xD3, 0x00, 0x00, 0x01,
108 0x01, 0x00, 0x00, 0x10,
109 0x10, 0x00, 0x00, 0x03,
110 0x00, 0x03, 0x00, 0x08,
111 0x78, 0x08, 0x78, 0x00,
112 0x00, 0x00, 0x00, 0x00,
113 0x24, 0x02, 0x05, 0x05,
114 0x03, 0x00, 0x00, 0x00,
115 0x05, 0x40, 0xFF, 0xFF,
116};
117
118static char hx8399c_fhd_pluse_video_on_cmd6[] = {
119 0x21, 0x00, 0x39, 0xC0,
120 0xD5, 0x20, 0x20, 0x19,
121 0x19, 0x18, 0x18, 0x02,
122 0x03, 0x00, 0x01, 0x24,
123 0x24, 0x18, 0x18, 0x18,
124 0x18, 0x24, 0x24, 0x00,
125 0x00, 0x00, 0x00, 0x00,
126 0x00, 0x00, 0x00, 0x2F,
127 0x2F, 0x30, 0x30, 0x31,
128 0x31, 0xFF, 0xFF, 0xFF,
129};
130
131static char hx8399c_fhd_pluse_video_on_cmd7[] = {
132 0x21, 0x00, 0x39, 0xC0,
133 0xD6, 0x24, 0x24, 0x18,
134 0x18, 0x19, 0x19, 0x01,
135 0x00, 0x03, 0x02, 0x24,
136 0x24, 0x18, 0x18, 0x18,
137 0x18, 0x20, 0x20, 0x40,
138 0x40, 0x40, 0x40, 0x40,
139 0x40, 0x40, 0x40, 0x2F,
140 0x2F, 0x30, 0x30, 0x31,
141 0x31, 0xFF, 0xFF, 0xFF,
142};
143
144static char hx8399c_fhd_pluse_video_on_cmd8[] = {
145 0x02, 0x00, 0x39, 0xC0,
146 0xBD, 0x00, 0xFF, 0xFF,
147};
148
149static char hx8399c_fhd_pluse_video_on_cmd9[] = {
150 0x11, 0x00, 0x39, 0xC0,
151 0xD8, 0xAA, 0xAA, 0xAA,
152 0xAA, 0xAA, 0xAA, 0xAA,
153 0xAA, 0xAA, 0xBA, 0xAA,
154 0xAA, 0xAA, 0xBA, 0xAA,
155 0xAA, 0xFF, 0xFF, 0xFF,
156};
157
158static char hx8399c_fhd_pluse_video_on_cmd10[] = {
159 0x02, 0x00, 0x39, 0xC0,
160 0xBD, 0x01, 0xFF, 0xFF,
161};
162
163static char hx8399c_fhd_pluse_video_on_cmd11[] = {
164 0x11, 0x00, 0x39, 0xC0,
165 0xD8, 0x82, 0xEA, 0xAA,
166 0xAA, 0x82, 0xEA, 0xAA,
167 0xAA, 0x82, 0xEA, 0xAA,
168 0xAA, 0x82, 0xEA, 0xAA,
169 0xAA, 0xFF, 0xFF, 0xFF,
170};
171
172static char hx8399c_fhd_pluse_video_on_cmd12[] = {
173 0x02, 0x00, 0x39, 0xC0,
174 0xBD, 0x02, 0xFF, 0xFF,
175};
176
177static char hx8399c_fhd_pluse_video_on_cmd13[] = {
178 0x09, 0x00, 0x39, 0xC0,
179 0xD8, 0xFF, 0xFF, 0xC0,
180 0x3F, 0xFF, 0xFF, 0xC0,
181 0x3F, 0xFF, 0xFF, 0xFF,
182};
183
184static char hx8399c_fhd_pluse_video_on_cmd14[] = {
185 0x02, 0x00, 0x39, 0xC0,
186 0xBD, 0x00, 0xFF, 0xFF,
187};
188
189static char hx8399c_fhd_pluse_video_on_cmd15[] = {
190 0x37, 0x00, 0x39, 0xC0,
191 0xE0, 0x08, 0x2A, 0x39,
192 0x35, 0x74, 0x7C, 0x87,
193 0x7F, 0x84, 0x8A, 0x8E,
194 0x91, 0x93, 0x96, 0x9B,
195 0x9C, 0x9E, 0xA5, 0xA6,
196 0xAE, 0xA1, 0xAF, 0xB2,
197 0x5C, 0x58, 0x63, 0x74,
198 0x08, 0x2A, 0x39, 0x35,
199 0x74, 0x7C, 0x87, 0x7F,
200 0x84, 0x8A, 0x8E, 0x91,
201 0x93, 0x96, 0x9B, 0x9C,
202 0x9E, 0xA5, 0xA6, 0xAE,
203 0xA1, 0xAF, 0xB2, 0x5C,
204 0x58, 0x63, 0x74, 0xFF,
205};
206
207static char hx8399c_fhd_pluse_video_on_cmd16[] = {
208 0x03, 0x00, 0x39, 0xC0,
209 0xB6, 0x7E, 0x7E, 0xFF,
210};
211
212static char hx8399c_fhd_pluse_video_on_cmd17[] = {
213 0x02, 0x00, 0x39, 0xC0,
214 0xCC, 0x08, 0xFF, 0xFF,
215};
216
217static char hx8399c_fhd_pluse_video_on_cmd18[] = {
218 0x06, 0x00, 0x39, 0xC0,
219 0xC7, 0x00, 0x08, 0x00,
220 0x01, 0x08, 0xFF, 0x00,
221};
222
223static char hx8399c_fhd_pluse_video_on_cmd19[] = {
224 0x03, 0x00, 0x39, 0xC0,
225 0xC0, 0x25, 0x5A, 0xFF,
226};
227
228static char hx8399c_fhd_pluse_video_on_cmd20[] = {
229 0x11, 0x00, 0x05, 0x80,
230};
231
232static char hx8399c_fhd_pluse_video_on_cmd21[] = {
233 0x29, 0x00, 0x05, 0x80,
234};
235
236static struct mipi_dsi_cmd hx8399c_fhd_pluse_video_on_command[] = {
237 {0x08, hx8399c_fhd_pluse_video_on_cmd0, 0x00},
238 {0x08, hx8399c_fhd_pluse_video_on_cmd1, 0x00},
239 {0x14, hx8399c_fhd_pluse_video_on_cmd2, 0x00},
240 {0x14, hx8399c_fhd_pluse_video_on_cmd3, 0x00},
241 {0x34, hx8399c_fhd_pluse_video_on_cmd4, 0x00},
242 {0x28, hx8399c_fhd_pluse_video_on_cmd5, 0x05},
243 {0x28, hx8399c_fhd_pluse_video_on_cmd6, 0x05},
244 {0x28, hx8399c_fhd_pluse_video_on_cmd7, 0x05},
245 {0x08, hx8399c_fhd_pluse_video_on_cmd8, 0x00},
246 {0x18, hx8399c_fhd_pluse_video_on_cmd9, 0x00},
247 {0x08, hx8399c_fhd_pluse_video_on_cmd10, 0x00},
248 {0x18, hx8399c_fhd_pluse_video_on_cmd11, 0x00},
249 {0x08, hx8399c_fhd_pluse_video_on_cmd12, 0x00},
250 {0x10, hx8399c_fhd_pluse_video_on_cmd13, 0x00},
251 {0x08, hx8399c_fhd_pluse_video_on_cmd14, 0x00},
252 {0x3C, hx8399c_fhd_pluse_video_on_cmd15, 0x05},
253 {0x08, hx8399c_fhd_pluse_video_on_cmd16, 0x00},
254 {0x08, hx8399c_fhd_pluse_video_on_cmd17, 0x00},
255 {0x0C, hx8399c_fhd_pluse_video_on_cmd18, 0x00},
256 {0x08, hx8399c_fhd_pluse_video_on_cmd19, 0x00},
257 {0x04, hx8399c_fhd_pluse_video_on_cmd20, 0x78},
258 {0x04, hx8399c_fhd_pluse_video_on_cmd21, 0x14}
259};
260
261#define HX8399C_FHD_PLUSE_VIDEO_ON_COMMAND 22
262
263
264static char hx8399c_fhd_pluse_videooff_cmd0[] = {
265 0x28, 0x00, 0x05, 0x80
266};
267
268static char hx8399c_fhd_pluse_videooff_cmd1[] = {
269 0x10, 0x00, 0x05, 0x80
270};
271
272static struct mipi_dsi_cmd hx8399c_fhd_pluse_video_off_command[] = {
273 {0x4, hx8399c_fhd_pluse_videooff_cmd0, 0x32},
274 {0x4, hx8399c_fhd_pluse_videooff_cmd1, 0x78}
275};
276
277#define HX8399C_FHD_PLUSE_VIDEO_OFF_COMMAND 2
278
279
280static struct command_state hx8399c_fhd_pluse_video_state = {
281 0, 1
282};
283
284/*---------------------------------------------------------------------------*/
285/* Command mode panel information */
286/*---------------------------------------------------------------------------*/
287static struct commandpanel_info hx8399c_fhd_pluse_video_command_panel = {
288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
289};
290
291/*---------------------------------------------------------------------------*/
292/* Video mode panel information */
293/*---------------------------------------------------------------------------*/
294static struct videopanel_info hx8399c_fhd_pluse_video_video_panel = {
295 1, 0, 0, 0, 1, 1, 2, 0, 0x9
296};
297
298/*---------------------------------------------------------------------------*/
299/* Lane configuration */
300/*---------------------------------------------------------------------------*/
301static struct lane_configuration hx8399c_fhd_pluse_video_lane_config = {
302 4, 0, 1, 1, 1, 1, 0
303};
304
305/*---------------------------------------------------------------------------*/
306/* Panel timing */
307/*---------------------------------------------------------------------------*/
308static const uint32_t hx8399c_fhd_pluse_video_timings[] = {
309 0x24, 0x1C, 0x34, 0x00, 0x58, 0x4d, 0x36, 0x3f, 0x53, 0x03, 0x04, 0x00
310};
311
312static const uint32_t hx8399c_fhd_pluse_14nm_video_timings[] = {
313 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
314 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
315 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
316 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
317 0x24, 0x1c, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
318};
319static struct panel_timing hx8399c_fhd_pluse_video_timing_info = {
320 0, 4, 0x0e, 0x31
321};
322
323static struct labibb_desc hx8399c_fhd_pluse_video_labibb = {
324 0, 1, 5700000, 5700000, 5700000, 5700000, 3, 3, 1, 0
325};
326
327/*---------------------------------------------------------------------------*/
328/* Panel reset sequence */
329/*---------------------------------------------------------------------------*/
330static struct panel_reset_sequence hx8399c_fhd_pluse_video_panel_reset_seq = {
331 {1, 0, 1, }, {20, 2, 20, }, 2
332};
333
334/*---------------------------------------------------------------------------*/
335/* Backlight setting */
336/*---------------------------------------------------------------------------*/
337static struct backlight hx8399c_fhd_pluse_video_backlight = {
338 1, 1, 4095, 100, 1, "PMIC_8941"
339};
340
341#define HX8399C_FHD_PLUSE_VIDEO_SIGNATURE 0xA0000
342
343#endif /*_PANEL_HX8399C_FHD_PLUSE_VIDEO_H_*/