blob: 0ac3150860730b805897dc4776983f7ccc6abe74 [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 = {
Lei Chen72b0fce2018-03-09 16:29:06 +080050 1080, 2160, 42, 42, 10, 0, 10, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0
Lei Chen84755442017-11-28 18:28:15 +080051};
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[] = {
Lei Chen72b0fce2018-03-09 16:29:06 +080074 0x0C, 0x00, 0x39, 0xC0,
75 0xB1, 0x02, 0x04, 0x72,
76 0x92, 0x01, 0x32, 0xAA,
77 0x11, 0x11, 0x52, 0x57,
Lei Chen84755442017-11-28 18:28:15 +080078};
79
80static char hx8399c_fhd_pluse_video_on_cmd3[] = {
81 0x10, 0x00, 0x39, 0xC0,
82 0xB2, 0x00, 0x80, 0x80,
83 0xCC, 0x05, 0x07, 0x5A,
84 0x11, 0x10, 0x10, 0x00,
85 0x1E, 0x70, 0x03, 0xD4,
86};
87
88static char hx8399c_fhd_pluse_video_on_cmd4[] = {
89 0x2D, 0x00, 0x39, 0xC0,
90 0xB4, 0x00, 0xFF, 0x59,
Lei Chen72b0fce2018-03-09 16:29:06 +080091 0x59, 0x01, 0xAB, 0x00,
92 0x00, 0x09, 0x00, 0x03,
93 0x05, 0x00, 0x28, 0x03,
94 0x0B, 0x0D, 0x21, 0x03,
95 0x02, 0x00, 0x0C, 0xA3,
96 0x80, 0x59, 0x59, 0x02,
97 0xAB, 0x00, 0x00, 0x09,
98 0x00, 0x03, 0x05, 0x00,
99 0x28, 0x03, 0x0B, 0x0D,
100 0x02, 0x00, 0x0C, 0xA3,
Lei Chen84755442017-11-28 18:28:15 +0800101 0x01, 0xFF, 0xFF, 0xFF,
102};
103
104static char hx8399c_fhd_pluse_video_on_cmd5[] = {
105 0x22, 0x00, 0x39, 0xC0,
Lei Chen72b0fce2018-03-09 16:29:06 +0800106 0xD3, 0x00, 0x0C, 0x03,
107 0x03, 0x00, 0x00, 0x10,
Lei Chen84755442017-11-28 18:28:15 +0800108 0x10, 0x00, 0x00, 0x03,
109 0x00, 0x03, 0x00, 0x08,
110 0x78, 0x08, 0x78, 0x00,
111 0x00, 0x00, 0x00, 0x00,
112 0x24, 0x02, 0x05, 0x05,
113 0x03, 0x00, 0x00, 0x00,
114 0x05, 0x40, 0xFF, 0xFF,
115};
116
117static char hx8399c_fhd_pluse_video_on_cmd6[] = {
118 0x21, 0x00, 0x39, 0xC0,
119 0xD5, 0x20, 0x20, 0x19,
120 0x19, 0x18, 0x18, 0x02,
121 0x03, 0x00, 0x01, 0x24,
122 0x24, 0x18, 0x18, 0x18,
123 0x18, 0x24, 0x24, 0x00,
124 0x00, 0x00, 0x00, 0x00,
125 0x00, 0x00, 0x00, 0x2F,
126 0x2F, 0x30, 0x30, 0x31,
127 0x31, 0xFF, 0xFF, 0xFF,
128};
129
130static char hx8399c_fhd_pluse_video_on_cmd7[] = {
131 0x21, 0x00, 0x39, 0xC0,
132 0xD6, 0x24, 0x24, 0x18,
133 0x18, 0x19, 0x19, 0x01,
134 0x00, 0x03, 0x02, 0x24,
135 0x24, 0x18, 0x18, 0x18,
136 0x18, 0x20, 0x20, 0x40,
137 0x40, 0x40, 0x40, 0x40,
138 0x40, 0x40, 0x40, 0x2F,
139 0x2F, 0x30, 0x30, 0x31,
140 0x31, 0xFF, 0xFF, 0xFF,
141};
142
143static char hx8399c_fhd_pluse_video_on_cmd8[] = {
144 0x02, 0x00, 0x39, 0xC0,
145 0xBD, 0x00, 0xFF, 0xFF,
146};
147
148static char hx8399c_fhd_pluse_video_on_cmd9[] = {
149 0x11, 0x00, 0x39, 0xC0,
150 0xD8, 0xAA, 0xAA, 0xAA,
151 0xAA, 0xAA, 0xAA, 0xAA,
152 0xAA, 0xAA, 0xBA, 0xAA,
153 0xAA, 0xAA, 0xBA, 0xAA,
154 0xAA, 0xFF, 0xFF, 0xFF,
155};
156
157static char hx8399c_fhd_pluse_video_on_cmd10[] = {
158 0x02, 0x00, 0x39, 0xC0,
159 0xBD, 0x01, 0xFF, 0xFF,
160};
161
162static char hx8399c_fhd_pluse_video_on_cmd11[] = {
163 0x11, 0x00, 0x39, 0xC0,
Lei Chen72b0fce2018-03-09 16:29:06 +0800164 0xD8, 0x00, 0x00, 0x00,
165 0x00, 0x00, 0x00, 0x00,
166 0x00, 0x82, 0xEA, 0xAA,
Lei Chen84755442017-11-28 18:28:15 +0800167 0xAA, 0x82, 0xEA, 0xAA,
168 0xAA, 0xFF, 0xFF, 0xFF,
169};
170
171static char hx8399c_fhd_pluse_video_on_cmd12[] = {
172 0x02, 0x00, 0x39, 0xC0,
173 0xBD, 0x02, 0xFF, 0xFF,
174};
175
176static char hx8399c_fhd_pluse_video_on_cmd13[] = {
177 0x09, 0x00, 0x39, 0xC0,
178 0xD8, 0xFF, 0xFF, 0xC0,
179 0x3F, 0xFF, 0xFF, 0xC0,
180 0x3F, 0xFF, 0xFF, 0xFF,
181};
182
183static char hx8399c_fhd_pluse_video_on_cmd14[] = {
184 0x02, 0x00, 0x39, 0xC0,
185 0xBD, 0x00, 0xFF, 0xFF,
186};
187
188static char hx8399c_fhd_pluse_video_on_cmd15[] = {
189 0x37, 0x00, 0x39, 0xC0,
Lei Chen72b0fce2018-03-09 16:29:06 +0800190 0xE0, 0x01, 0x21, 0x31,
191 0x2D, 0x66, 0x6F, 0x7B,
192 0x75, 0x7A, 0x81, 0x86,
193 0x89, 0x8C, 0x90, 0x95,
194 0x97, 0x9A, 0xA1, 0xA2,
195 0xAA, 0x9E, 0xAD, 0xB0,
196 0x5B, 0x57, 0x63, 0x7A,
197 0x01, 0x21, 0x31, 0x2D,
198 0x66, 0x6F, 0x7B, 0x75,
199 0x7A, 0x81, 0x86, 0x89,
200 0x9C, 0x90, 0x95, 0x97,
201 0x9A, 0xA1, 0xA2, 0xAA,
202 0x9E, 0xAD, 0xB0, 0x5B,
203 0x57, 0x63, 0x7A, 0xFF,
Lei Chen84755442017-11-28 18:28:15 +0800204};
205
206static char hx8399c_fhd_pluse_video_on_cmd16[] = {
207 0x03, 0x00, 0x39, 0xC0,
208 0xB6, 0x7E, 0x7E, 0xFF,
209};
210
211static char hx8399c_fhd_pluse_video_on_cmd17[] = {
212 0x02, 0x00, 0x39, 0xC0,
213 0xCC, 0x08, 0xFF, 0xFF,
214};
215
216static char hx8399c_fhd_pluse_video_on_cmd18[] = {
Lei Chen84755442017-11-28 18:28:15 +0800217 0x11, 0x00, 0x05, 0x80,
218};
219
Lei Chen72b0fce2018-03-09 16:29:06 +0800220static char hx8399c_fhd_pluse_video_on_cmd19[] = {
Lei Chen84755442017-11-28 18:28:15 +0800221 0x29, 0x00, 0x05, 0x80,
222};
223
224static struct mipi_dsi_cmd hx8399c_fhd_pluse_video_on_command[] = {
225 {0x08, hx8399c_fhd_pluse_video_on_cmd0, 0x00},
226 {0x08, hx8399c_fhd_pluse_video_on_cmd1, 0x00},
Lei Chen72b0fce2018-03-09 16:29:06 +0800227 {0x10, hx8399c_fhd_pluse_video_on_cmd2, 0x00},
Lei Chen84755442017-11-28 18:28:15 +0800228 {0x14, hx8399c_fhd_pluse_video_on_cmd3, 0x00},
229 {0x34, hx8399c_fhd_pluse_video_on_cmd4, 0x00},
230 {0x28, hx8399c_fhd_pluse_video_on_cmd5, 0x05},
231 {0x28, hx8399c_fhd_pluse_video_on_cmd6, 0x05},
232 {0x28, hx8399c_fhd_pluse_video_on_cmd7, 0x05},
233 {0x08, hx8399c_fhd_pluse_video_on_cmd8, 0x00},
234 {0x18, hx8399c_fhd_pluse_video_on_cmd9, 0x00},
235 {0x08, hx8399c_fhd_pluse_video_on_cmd10, 0x00},
236 {0x18, hx8399c_fhd_pluse_video_on_cmd11, 0x00},
237 {0x08, hx8399c_fhd_pluse_video_on_cmd12, 0x00},
238 {0x10, hx8399c_fhd_pluse_video_on_cmd13, 0x00},
239 {0x08, hx8399c_fhd_pluse_video_on_cmd14, 0x00},
240 {0x3C, hx8399c_fhd_pluse_video_on_cmd15, 0x05},
241 {0x08, hx8399c_fhd_pluse_video_on_cmd16, 0x00},
242 {0x08, hx8399c_fhd_pluse_video_on_cmd17, 0x00},
Lei Chen72b0fce2018-03-09 16:29:06 +0800243 {0x04, hx8399c_fhd_pluse_video_on_cmd18, 0x78},
244 {0x04, hx8399c_fhd_pluse_video_on_cmd19, 0x14}
Lei Chen84755442017-11-28 18:28:15 +0800245};
246
Lei Chen72b0fce2018-03-09 16:29:06 +0800247#define HX8399C_FHD_PLUSE_VIDEO_ON_COMMAND 20
Lei Chen84755442017-11-28 18:28:15 +0800248
249
250static char hx8399c_fhd_pluse_videooff_cmd0[] = {
251 0x28, 0x00, 0x05, 0x80
252};
253
254static char hx8399c_fhd_pluse_videooff_cmd1[] = {
255 0x10, 0x00, 0x05, 0x80
256};
257
258static struct mipi_dsi_cmd hx8399c_fhd_pluse_video_off_command[] = {
259 {0x4, hx8399c_fhd_pluse_videooff_cmd0, 0x32},
Lei Chen72b0fce2018-03-09 16:29:06 +0800260 {0x4, hx8399c_fhd_pluse_videooff_cmd1, 0x96}
Lei Chen84755442017-11-28 18:28:15 +0800261};
262
263#define HX8399C_FHD_PLUSE_VIDEO_OFF_COMMAND 2
264
265
266static struct command_state hx8399c_fhd_pluse_video_state = {
267 0, 1
268};
269
270/*---------------------------------------------------------------------------*/
271/* Command mode panel information */
272/*---------------------------------------------------------------------------*/
273static struct commandpanel_info hx8399c_fhd_pluse_video_command_panel = {
274 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
275};
276
277/*---------------------------------------------------------------------------*/
278/* Video mode panel information */
279/*---------------------------------------------------------------------------*/
280static struct videopanel_info hx8399c_fhd_pluse_video_video_panel = {
281 1, 0, 0, 0, 1, 1, 2, 0, 0x9
282};
283
284/*---------------------------------------------------------------------------*/
285/* Lane configuration */
286/*---------------------------------------------------------------------------*/
287static struct lane_configuration hx8399c_fhd_pluse_video_lane_config = {
288 4, 0, 1, 1, 1, 1, 0
289};
290
291/*---------------------------------------------------------------------------*/
292/* Panel timing */
293/*---------------------------------------------------------------------------*/
294static const uint32_t hx8399c_fhd_pluse_video_timings[] = {
295 0x24, 0x1C, 0x34, 0x00, 0x58, 0x4d, 0x36, 0x3f, 0x53, 0x03, 0x04, 0x00
296};
297
Padmanabhan Komanduruc570f302018-04-30 09:32:31 +0530298static const uint32_t hx8399c_fhd_pluse_video_12nm_timings[] = {
299 0x18, 0x0A, 0x10, 0x06, 0x03, 0x08, 0x06, 0x0E
300};
301
Lei Chen84755442017-11-28 18:28:15 +0800302static const uint32_t hx8399c_fhd_pluse_14nm_video_timings[] = {
303 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
304 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
305 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
306 0x24, 0x1f, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
307 0x24, 0x1c, 0x08, 0x09, 0x05, 0x03, 0x04, 0xa0,
308};
309static struct panel_timing hx8399c_fhd_pluse_video_timing_info = {
310 0, 4, 0x0e, 0x31
311};
312
313static struct labibb_desc hx8399c_fhd_pluse_video_labibb = {
Vishnuvardhan Prodduturid2418a82018-05-29 17:57:54 +0530314 0, 0, 5700000, 5700000, 5700000, 5700000, 3, 3, 1, 0
Lei Chen84755442017-11-28 18:28:15 +0800315};
316
317/*---------------------------------------------------------------------------*/
318/* Panel reset sequence */
319/*---------------------------------------------------------------------------*/
320static struct panel_reset_sequence hx8399c_fhd_pluse_video_panel_reset_seq = {
321 {1, 0, 1, }, {20, 2, 20, }, 2
322};
323
324/*---------------------------------------------------------------------------*/
325/* Backlight setting */
326/*---------------------------------------------------------------------------*/
327static struct backlight hx8399c_fhd_pluse_video_backlight = {
Padmanabhan Komanduruc570f302018-04-30 09:32:31 +0530328 0, 1, 4095, 100, 1, "PMIC_8941"
Lei Chen84755442017-11-28 18:28:15 +0800329};
330
331#define HX8399C_FHD_PLUSE_VIDEO_SIGNATURE 0xA0000
332
333#endif /*_PANEL_HX8399C_FHD_PLUSE_VIDEO_H_*/