blob: f607946636b314656a3c8561236d5b8f461c834a [file] [log] [blame]
Ray Zhang132c8a42016-01-14 14:13:20 +08001/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
Ray Zhang99f68bb2015-09-23 17:39:15 +08002 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * 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
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the 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 "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef _PANEL_HX8394F_720P_VIDEO_H_
30#define _PANEL_HX8394F_720P_VIDEO_H_
31/*---------------------------------------------------------------------------*/
32/* HEADER files */
33/*---------------------------------------------------------------------------*/
34#include "panel.h"
35
36/*---------------------------------------------------------------------------*/
37/* Panel configuration */
38/*---------------------------------------------------------------------------*/
39static struct panel_config hx8394f_720p_video_panel_data = {
40 "qcom,mdss_dsi_hx8394f_720p_video", "dsi:0:", "qcom,mdss-dsi-panel",
Ray Zhang712663b2015-12-04 16:05:50 +080041 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL
Ray Zhang99f68bb2015-09-23 17:39:15 +080042};
43
44/*---------------------------------------------------------------------------*/
45/* Panel resolution */
46/*---------------------------------------------------------------------------*/
47static struct panel_resolution hx8394f_720p_video_panel_res = {
48 720, 1280, 16, 16, 10, 0, 15, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0
49};
50
51/*---------------------------------------------------------------------------*/
52/* Panel color information */
53/*---------------------------------------------------------------------------*/
54static struct color_info hx8394f_720p_video_color = {
55 24, 0, 0xff, 0, 0, 0
56};
57
58/*---------------------------------------------------------------------------*/
59/* Panel on/off command information */
60/*---------------------------------------------------------------------------*/
61static char hx8394f_720p_video_on_cmd0[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080062 0x04, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +080063 0xB9, 0xFF, 0x83, 0x94,
Ray Zhang99f68bb2015-09-23 17:39:15 +080064};
65
66static char hx8394f_720p_video_on_cmd1[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080067 0x07, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +080068 0xBA, 0x63, 0x03, 0x68,
Ray Zhang5dc75d82016-02-19 16:16:44 +080069 0x6B, 0xB2, 0xC0, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +080070};
71
72static char hx8394f_720p_video_on_cmd2[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080073 0x0B, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +080074 0xB1, 0x50, 0x12, 0x72,
Ray Zhang5dc75d82016-02-19 16:16:44 +080075 0x09, 0x33, 0x54, 0xB1,
76 0x31, 0x6B, 0x2F, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +080077};
78
79static char hx8394f_720p_video_on_cmd3[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080080 0x07, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +080081 0xB2, 0x00, 0x80, 0x64,
82 0x0E, 0x0D, 0x2F, 0xFF,
83};
84
85static char hx8394f_720p_video_on_cmd4[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080086 0x16, 0x00, 0x39, 0xC0,
Ray Zhang5dc75d82016-02-19 16:16:44 +080087 0xB4, 0x73, 0x74, 0x73,
88 0x74, 0x73, 0x74, 0x01,
89 0x0C, 0x86, 0x75, 0x00,
90 0x3F, 0x73, 0x74, 0x73,
91 0x74, 0x73, 0x74, 0x01,
92 0x0C, 0x86, 0xFF, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +080093};
94
95static char hx8394f_720p_video_on_cmd5[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +080096 0x22, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +080097 0xD3, 0x00, 0x00, 0x07,
98 0x07, 0x40, 0x07, 0x10,
99 0x00, 0x08, 0x10, 0x08,
100 0x00, 0x08, 0x54, 0x15,
101 0x0E, 0x05, 0x0E, 0x02,
102 0x15, 0x06, 0x05, 0x06,
103 0x47, 0x44, 0x0A, 0x0A,
104 0x4B, 0x10, 0x07, 0x07,
Ray Zhang5dc75d82016-02-19 16:16:44 +0800105 0x0E, 0x40, 0xFF, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800106};
107
108static char hx8394f_720p_video_on_cmd6[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800109 0x2D, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800110 0xD5, 0x1A, 0x1A, 0x1B,
111 0x1B, 0x00, 0x01, 0x02,
112 0x03, 0x04, 0x05, 0x06,
113 0x07, 0x08, 0x09, 0x0A,
114 0x0B, 0x24, 0x25, 0x18,
115 0x18, 0x26, 0x27, 0x18,
116 0x18, 0x18, 0x18, 0x18,
117 0x18, 0x18, 0x18, 0x18,
118 0x18, 0x18, 0x18, 0x18,
119 0x18, 0x18, 0x18, 0x20,
120 0x21, 0x18, 0x18, 0x18,
121 0x18, 0xFF, 0xFF, 0xFF,
122};
123
124static char hx8394f_720p_video_on_cmd7[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800125 0x2D, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800126 0xD6, 0x1A, 0x1A, 0x1B,
127 0x1B, 0x0B, 0x0A, 0x09,
128 0x08, 0x07, 0x06, 0x05,
129 0x04, 0x03, 0x02, 0x01,
130 0x00, 0x21, 0x20, 0x18,
131 0x18, 0x27, 0x26, 0x18,
132 0x18, 0x18, 0x18, 0x18,
133 0x18, 0x18, 0x18, 0x18,
134 0x18, 0x18, 0x18, 0x18,
135 0x18, 0x18, 0x18, 0x25,
136 0x24, 0x18, 0x18, 0x18,
137 0x18, 0xFF, 0xFF, 0xFF,
138};
139
140static char hx8394f_720p_video_on_cmd8[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800141 0x3B, 0x00, 0x39, 0xC0,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800142 0xE0, 0x00, 0x0C, 0x19,
143 0x20, 0x23, 0x26, 0x29,
144 0x28, 0x51, 0x61, 0x70,
145 0x6F, 0x76, 0x86, 0x89,
146 0x8D, 0x99, 0x9A, 0x95,
147 0xA1, 0xB0, 0x57, 0x55,
148 0x58, 0x5C, 0x5e, 0x64,
Ray Zhangf46113c2016-02-03 15:15:32 +0800149 0x6B, 0x7F, 0x00, 0x0C,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800150 0x19, 0x20, 0x23, 0x26,
151 0x29, 0x28, 0x51, 0x61,
152 0x70, 0x6F, 0x76, 0x86,
153 0x89, 0x8D, 0x99, 0x9A,
154 0x95, 0xA1, 0xB0, 0x57,
Ray Zhang5dc75d82016-02-19 16:16:44 +0800155 0x55, 0x58, 0x5C, 0x5E,
Ray Zhangf46113c2016-02-03 15:15:32 +0800156 0x64, 0x6B, 0x7F, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800157};
158
159static char hx8394f_720p_video_on_cmd9[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800160 0x03, 0x00, 0x39, 0xC0,
Ray Zhang5dc75d82016-02-19 16:16:44 +0800161 0xC0, 0x1F, 0x31, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800162};
163
164static char hx8394f_720p_video_on_cmd10[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800165 0xCC, 0x0B, 0x15, 0x80
Ray Zhang99f68bb2015-09-23 17:39:15 +0800166};
167
168static char hx8394f_720p_video_on_cmd11[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800169 0xD4, 0x02, 0x15, 0x80
Ray Zhang99f68bb2015-09-23 17:39:15 +0800170};
171
172static char hx8394f_720p_video_on_cmd12[] = {
Ray Zhang5dc75d82016-02-19 16:16:44 +0800173 0xBD, 0x02, 0x15, 0x80
Ray Zhang99f68bb2015-09-23 17:39:15 +0800174};
175
176static char hx8394f_720p_video_on_cmd13[] = {
Ray Zhang5dc75d82016-02-19 16:16:44 +0800177 0x0D, 0x00, 0x39, 0xC0,
178 0xD8, 0xFF, 0xFF, 0xFF,
179 0xFF, 0xFF, 0xFF, 0xFF,
180 0xFF, 0xFF, 0xFF, 0xFF,
181 0xFF, 0xFF, 0xFF, 0xFF,
182};
183
184static char hx8394f_720p_video_on_cmd14[] = {
185 0xBD, 0x00, 0x15, 0x80
186};
187
188static char hx8394f_720p_video_on_cmd15[] = {
189 0xBD, 0x01, 0x15, 0x80
190};
191
192static char hx8394f_720p_video_on_cmd16[] = {
193 0xB1, 0x00, 0x15, 0x80
194};
195
196static char hx8394f_720p_video_on_cmd17[] = {
197 0xBD, 0x00, 0x15, 0x80
198};
199
200static char hx8394f_720p_video_on_cmd18[] = {
201 0x08, 0x00, 0x39, 0xC0,
202 0xBF, 0x40, 0x81, 0x50,
203 0x00, 0x1A, 0xFC, 0x01,
204};
205
206static char hx8394f_720p_video_on_cmd19[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800207 0x03, 0x00, 0x39, 0xC0,
208 0xB6, 0x7D, 0x7D, 0xFF,
Ray Zhang99f68bb2015-09-23 17:39:15 +0800209};
210
Ray Zhang5dc75d82016-02-19 16:16:44 +0800211static char hx8394f_720p_video_on_cmd20[] = {
Ray Zhangf46113c2016-02-03 15:15:32 +0800212 0x11, 0x00, 0x05, 0x80
213};
214
Ray Zhang5dc75d82016-02-19 16:16:44 +0800215static char hx8394f_720p_video_on_cmd21[] = {
216 0x0D, 0x00, 0x39, 0xC0,
217 0xB2, 0x00, 0x80, 0x64,
218 0x0E, 0x0D, 0x2F, 0x00,
219 0x00, 0x00, 0x00, 0xC0,
220 0x18, 0xFF, 0xFF, 0xFF,
221};
222
223static char hx8394f_720p_video_on_cmd22[] = {
Ray Zhang99f68bb2015-09-23 17:39:15 +0800224 0x29, 0x00, 0x05, 0x80
225};
226
227static struct mipi_dsi_cmd hx8394f_720p_video_on_command[] = {
228 {0x8, hx8394f_720p_video_on_cmd0, 0x00},
229 {0xc, hx8394f_720p_video_on_cmd1, 0x00},
230 {0x10, hx8394f_720p_video_on_cmd2, 0x00},
231 {0xc, hx8394f_720p_video_on_cmd3, 0x00},
232 {0x1c, hx8394f_720p_video_on_cmd4, 0x00},
233 {0x28, hx8394f_720p_video_on_cmd5, 0x00},
234 {0x34, hx8394f_720p_video_on_cmd6, 0x00},
235 {0x34, hx8394f_720p_video_on_cmd7, 0x00},
236 {0x40, hx8394f_720p_video_on_cmd8, 0x00},
237 {0x8, hx8394f_720p_video_on_cmd9, 0x00},
Ray Zhangf46113c2016-02-03 15:15:32 +0800238 {0x4, hx8394f_720p_video_on_cmd10, 0x00},
239 {0x4, hx8394f_720p_video_on_cmd11, 0x00},
Ray Zhang5dc75d82016-02-19 16:16:44 +0800240 {0x4, hx8394f_720p_video_on_cmd12, 0x00},
241 {0x14, hx8394f_720p_video_on_cmd13, 0x00},
242 {0x4, hx8394f_720p_video_on_cmd14, 0x00},
243 {0x4, hx8394f_720p_video_on_cmd15, 0x00},
244 {0x4, hx8394f_720p_video_on_cmd16, 0x00},
245 {0x4, hx8394f_720p_video_on_cmd17, 0x00},
246 {0xc, hx8394f_720p_video_on_cmd18, 0x00},
247 {0x8, hx8394f_720p_video_on_cmd19, 0x00},
248 {0x4, hx8394f_720p_video_on_cmd20, 0x78},
249 {0x14, hx8394f_720p_video_on_cmd21, 0x00},
250 {0x4, hx8394f_720p_video_on_cmd22, 0x14}
Ray Zhang99f68bb2015-09-23 17:39:15 +0800251};
252
Ray Zhang5dc75d82016-02-19 16:16:44 +0800253#define HX8394F_720P_VIDEO_ON_COMMAND 23
Ray Zhang99f68bb2015-09-23 17:39:15 +0800254
255static char hx8394f_720p_videooff_cmd0[] = {
256 0x28, 0x00, 0x05, 0x80
257};
258
259static char hx8394f_720p_videooff_cmd1[] = {
260 0x10, 0x00, 0x05, 0x80
261};
262
263static struct mipi_dsi_cmd hx8394f_720p_video_off_command[] = {
264 {0x4, hx8394f_720p_videooff_cmd0, 0x78},
265 {0x4, hx8394f_720p_videooff_cmd1, 0x96}
266};
267
268#define HX8394F_720P_VIDEO_OFF_COMMAND 2
269
270
271static struct command_state hx8394f_720p_video_state = {
272 0, 1
273};
274
275/*---------------------------------------------------------------------------*/
276/* Command mode panel information */
277/*---------------------------------------------------------------------------*/
278static struct commandpanel_info hx8394f_720p_video_command_panel = {
279 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
280};
281
282/*---------------------------------------------------------------------------*/
283/* Video mode panel information */
284/*---------------------------------------------------------------------------*/
285static struct videopanel_info hx8394f_720p_video_video_panel = {
286 1, 0, 0, 0, 1, 1, 2, 0, 0x9
287};
288
289/*---------------------------------------------------------------------------*/
290/* Lane configuration */
291/*---------------------------------------------------------------------------*/
292
293static struct lane_configuration hx8394f_720p_video_lane_config = {
294 4, 0, 1, 1, 1, 1, 0
295};
296
297/*---------------------------------------------------------------------------*/
298/* Panel timing */
299/*---------------------------------------------------------------------------*/
300static const uint32_t hx8394f_720p_video_timings[] = {
301 0x72, 0x16, 0x0e, 0x00, 0x38, 0x3c, 0x12, 0x1a, 0x10, 0x03, 0x04, 0x00
302};
303
304static struct panel_timing hx8394f_720p_video_timing_info = {
305 0, 4, 0x04, 0x18
306};
307
308/*---------------------------------------------------------------------------*/
309/* Panel reset sequence */
310/*---------------------------------------------------------------------------*/
311static struct panel_reset_sequence hx8394f_720p_video_reset_seq = {
312 {1, 0, 1, }, {20, 2, 20, }, 2
313};
314
315/*---------------------------------------------------------------------------*/
316/* Backlight setting */
317/*---------------------------------------------------------------------------*/
318static struct backlight hx8394f_720p_video_backlight = {
319 1, 1, 4095, 100, 1, "PMIC_8941"
320};
321
322#define HX8394F_720P_VIDEO_SIGNATURE 0xFFFF
323
324#endif /*_PANEL_HX8394F_720P_VIDEO_H_*/