blob: a7c4df087a23e44dd6de7f7bd7eed943d88a7467 [file] [log] [blame]
Ray Zhang960d1342015-06-25 15:32:00 +08001/* Copyright (c) 2015, 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_HX8399A_1080P_VIDEO_H_
31
32#define _PANEL_HX8399A_1080P_VIDEO_H_
33/*---------------------------------------------------------------------------*/
34/* HEADER files */
35/*---------------------------------------------------------------------------*/
36#include "panel.h"
37
38/*---------------------------------------------------------------------------*/
39/* Panel configuration */
40/*---------------------------------------------------------------------------*/
41static struct panel_config hx8399a_1080p_video_panel_data = {
42 "qcom,mdss_dsi_hx8399a_1080p_video", "dsi:0:", "qcom,mdss-dsi-panel",
Ray Zhang4f77ff42015-08-17 18:48:49 +080043 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 866400000, 0, 0, 0, NULL
Ray Zhang960d1342015-06-25 15:32:00 +080044};
45
46/*---------------------------------------------------------------------------*/
47/* Panel resolution */
48/*---------------------------------------------------------------------------*/
49static struct panel_resolution hx8399a_1080p_video_panel_res = {
50 1080, 1920, 90, 60, 20, 0, 9, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0
51};
52
53/*---------------------------------------------------------------------------*/
54/* Panel color information */
55/*---------------------------------------------------------------------------*/
56static struct color_info hx8399a_1080p_video_color = {
57 24, 0, 0xff, 0, 0, 0
58};
59
60/*---------------------------------------------------------------------------*/
61/* Panel on/off command information */
62/*---------------------------------------------------------------------------*/
63static char hx8399a_1080p_video_on_cmd0[] = {
64 0x04, 0x00, 0x29, 0xC0,
65 0xB9, 0xFF, 0x83, 0x99,
66};
67
68static char hx8399a_1080p_video_on_cmd1[] = {
Ray Zhang18adc282015-10-21 09:55:20 +080069 0x03, 0x00, 0x29, 0xC0,
70 0xBA, 0x63, 0x82, 0xFF,
71};
72
73static char hx8399a_1080p_video_on_cmd2[] = {
Ray Zhang960d1342015-06-25 15:32:00 +080074 0x0D, 0x00, 0x29, 0xC0,
75 0xB1, 0x00, 0x74, 0x31,
76 0x31, 0x44, 0x09, 0x22,
77 0x22, 0x71, 0xF1, 0x63,
78 0x6D, 0xFF, 0xFF, 0xFF,
79};
80
Ray Zhang18adc282015-10-21 09:55:20 +080081static char hx8399a_1080p_video_on_cmd3[] = {
Ray Zhang960d1342015-06-25 15:32:00 +080082 0x0B, 0x00, 0x29, 0xC0,
83 0xB2, 0x00, 0x80, 0x00,
84 0x7F, 0x05, 0x07, 0x23,
85 0x4D, 0x02, 0x02, 0xFF,
86};
87
Ray Zhang18adc282015-10-21 09:55:20 +080088static char hx8399a_1080p_video_on_cmd4[] = {
Ray Zhang960d1342015-06-25 15:32:00 +080089 0x29, 0x00, 0x29, 0xC0,
90 0xB4, 0x00, 0xFF, 0x00,
91 0x40, 0x00, 0x3E, 0x00,
92 0x00, 0x02, 0x00, 0x00,
93 0x01, 0x00, 0x10, 0x01,
94 0x02, 0x04, 0x31, 0x00,
95 0x01, 0x44, 0x00, 0x40,
96 0x00, 0x3E, 0x00, 0x00,
97 0x02, 0x00, 0x00, 0x01,
98 0x00, 0x10, 0x01, 0x02,
99 0x04, 0x01, 0x00, 0x01,
100 0x44, 0xFF, 0xFF, 0xFF,
101};
102
Ray Zhang18adc282015-10-21 09:55:20 +0800103static char hx8399a_1080p_video_on_cmd5[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800104 0x02, 0x00, 0x29, 0xC0,
105 0xD2, 0x00, 0xFF, 0xFF,
106};
107
Ray Zhang18adc282015-10-21 09:55:20 +0800108static char hx8399a_1080p_video_on_cmd6[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800109 0x20, 0x00, 0x29, 0xC0,
110 0xD3, 0x00, 0x01, 0x00,
111 0x00, 0x00, 0x30, 0x00,
112 0x32, 0x10, 0x05, 0x00,
113 0x05, 0x00, 0x00, 0x00,
114 0x00, 0x00, 0x00, 0x00,
115 0x00, 0x00, 0x00, 0x01,
116 0x07, 0x07, 0x03, 0x00,
117 0x00, 0x00, 0x05, 0x08,
118};
119
Ray Zhang18adc282015-10-21 09:55:20 +0800120static char hx8399a_1080p_video_on_cmd7[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800121 0x21, 0x00, 0x29, 0xC0,
122 0xD5, 0x18, 0x18, 0x00,
123 0x00, 0x00, 0x00, 0x00,
124 0x00, 0x19, 0x19, 0x18,
125 0x18, 0x00, 0x00, 0x00,
126 0x00, 0x00, 0x00, 0x00,
127 0x00, 0x03, 0x02, 0x01,
128 0x00, 0x21, 0x20, 0x30,
129 0x30, 0x31, 0x31, 0x32,
130 0x32, 0xFF, 0xFF, 0xFF,
131};
132
Ray Zhang18adc282015-10-21 09:55:20 +0800133static char hx8399a_1080p_video_on_cmd8[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800134 0x21, 0x00, 0x29, 0xC0,
135 0xD6, 0x18, 0x18, 0x40,
136 0x40, 0x40, 0x40, 0x40,
137 0x40, 0x18, 0x18, 0x19,
138 0x19, 0x40, 0x40, 0x40,
139 0x40, 0x40, 0x40, 0x40,
140 0x40, 0x00, 0x01, 0x02,
141 0x03, 0x20, 0x21, 0x30,
142 0x30, 0x31, 0x31, 0x32,
143 0x32, 0xFF, 0xFF, 0xFF,
144};
145
Ray Zhang18adc282015-10-21 09:55:20 +0800146static char hx8399a_1080p_video_on_cmd9[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800147 0x31, 0x00, 0x29, 0xC0,
148 0xD8, 0x00, 0x00, 0x00,
149 0x00, 0x00, 0x00, 0x00,
150 0x00, 0x00, 0x00, 0x00,
151 0x00, 0x00, 0x00, 0x00,
152 0x00, 0x00, 0x00, 0x00,
153 0x00, 0x00, 0x00, 0x00,
154 0x00, 0x00, 0x00, 0x00,
155 0x00, 0x00, 0x00, 0x00,
156 0x00, 0x00, 0x00, 0x00,
157 0x00, 0x00, 0x00, 0x00,
158 0x00, 0xC0, 0x00, 0x0A,
159 0xBF, 0xC0, 0x00, 0x0A,
160 0xBF, 0xFF, 0xFF, 0xFF,
161};
162
Ray Zhang18adc282015-10-21 09:55:20 +0800163static char hx8399a_1080p_video_on_cmd10[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800164 0x03, 0x00, 0x29, 0xC0,
165 0xB6, 0x34, 0x34, 0xFF,
166};
167
Ray Zhang18adc282015-10-21 09:55:20 +0800168static char hx8399a_1080p_video_on_cmd11[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800169 0x02, 0x00, 0x29, 0xC0,
170 0xCC, 0x08, 0xFF, 0xFF,
171};
172
Ray Zhang18adc282015-10-21 09:55:20 +0800173static char hx8399a_1080p_video_on_cmd12[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800174 0x2B, 0x00, 0x29, 0xC0,
175 0xE0, 0x01, 0x10, 0x15,
176 0x2B, 0x32, 0x3E, 0x22,
177 0x3C, 0x07, 0x0C, 0x0F,
178 0x12, 0x15, 0x13, 0x14,
179 0x10, 0x16, 0x0A, 0x17,
180 0x06, 0x12, 0x01, 0x10,
181 0x15, 0x2B, 0x32, 0x3E,
182 0x22, 0x3C, 0x07, 0x0C,
183 0x0F, 0x12, 0x15, 0x13,
184 0x14, 0x10, 0x16, 0x0A,
185 0x17, 0x06, 0x12, 0xFF,
186};
187
Ray Zhang18adc282015-10-21 09:55:20 +0800188static char hx8399a_1080p_video_on_cmd13[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800189 0x04, 0x00, 0x29, 0xC0,
190 0xBF, 0xCF, 0x00, 0x46,
191};
192
Ray Zhang18adc282015-10-21 09:55:20 +0800193static char hx8399a_1080p_video_on_cmd14[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800194 0x02, 0x00, 0x29, 0xC0,
195 0x36, 0xc0, 0xFF, 0xFF,
196};
197
Ray Zhang18adc282015-10-21 09:55:20 +0800198static char hx8399a_1080p_video_on_cmd15[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800199 0x02, 0x00, 0x29, 0xC0,
200 0x11, 0x00, 0xFF, 0xFF,
201};
202
Ray Zhang18adc282015-10-21 09:55:20 +0800203static char hx8399a_1080p_video_on_cmd16[] = {
Ray Zhang960d1342015-06-25 15:32:00 +0800204 0x02, 0x00, 0x29, 0xC0,
205 0x29, 0x00, 0xFF, 0xFF,
206};
207
208static struct mipi_dsi_cmd hx8399a_1080p_video_on_command[] = {
209 {0x8, hx8399a_1080p_video_on_cmd0, 0x00},
Ray Zhang18adc282015-10-21 09:55:20 +0800210 {0x8, hx8399a_1080p_video_on_cmd1, 0x00},
211 {0x14, hx8399a_1080p_video_on_cmd2, 0x00},
212 {0x10, hx8399a_1080p_video_on_cmd3, 0x00},
213 {0x30, hx8399a_1080p_video_on_cmd4, 0x00},
214 {0x8, hx8399a_1080p_video_on_cmd5, 0x00},
215 {0x24, hx8399a_1080p_video_on_cmd6, 0x00},
Ray Zhang960d1342015-06-25 15:32:00 +0800216 {0x28, hx8399a_1080p_video_on_cmd7, 0x00},
Ray Zhang18adc282015-10-21 09:55:20 +0800217 {0x28, hx8399a_1080p_video_on_cmd8, 0x00},
218 {0x38, hx8399a_1080p_video_on_cmd9, 0x00},
Ray Zhang960d1342015-06-25 15:32:00 +0800219 {0x8, hx8399a_1080p_video_on_cmd10, 0x00},
Ray Zhang18adc282015-10-21 09:55:20 +0800220 {0x8, hx8399a_1080p_video_on_cmd11, 0x00},
221 {0x30, hx8399a_1080p_video_on_cmd12, 0x00},
Ray Zhang960d1342015-06-25 15:32:00 +0800222 {0x8, hx8399a_1080p_video_on_cmd13, 0x00},
Ray Zhang18adc282015-10-21 09:55:20 +0800223 {0x8, hx8399a_1080p_video_on_cmd14, 0x00},
224 {0x8, hx8399a_1080p_video_on_cmd15, 0x78},
225 {0x8, hx8399a_1080p_video_on_cmd16, 0x0A}
Ray Zhang960d1342015-06-25 15:32:00 +0800226};
227
Ray Zhang18adc282015-10-21 09:55:20 +0800228#define HX8399A_1080P_VIDEO_ON_COMMAND 17
Ray Zhang960d1342015-06-25 15:32:00 +0800229
230
231static char hx8399a_1080p_videooff_cmd0[] = {
232 0x28, 0x00, 0x05, 0x80
233};
234
235static char hx8399a_1080p_videooff_cmd1[] = {
236 0x10, 0x00, 0x05, 0x80
237};
238
239static struct mipi_dsi_cmd hx8399a_1080p_video_off_command[] = {
240 {0x4, hx8399a_1080p_videooff_cmd0, 0x32},
241 {0x4, hx8399a_1080p_videooff_cmd1, 0x78}
242};
243
244#define HX8399A_1080P_VIDEO_OFF_COMMAND 2
245
246
247static struct command_state hx8399a_1080p_video_state = {
248 0, 1
249};
250
251/*---------------------------------------------------------------------------*/
252/* Command mode panel information */
253/*---------------------------------------------------------------------------*/
254static struct commandpanel_info hx8399a_1080p_video_command_panel = {
255 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
256};
257
258/*---------------------------------------------------------------------------*/
259/* Video mode panel information */
260/*---------------------------------------------------------------------------*/
261static struct videopanel_info hx8399a_1080p_video_video_panel = {
262 0, 0, 0, 0, 1, 1, 2, 0, 0x9
263};
264
265/*---------------------------------------------------------------------------*/
266/* Lane configuration */
267/*---------------------------------------------------------------------------*/
268static struct lane_configuration hx8399a_1080p_video_lane_config = {
269 4, 0, 1, 1, 1, 1, 0
270};
271
272/*---------------------------------------------------------------------------*/
273/* Panel timing */
274/*---------------------------------------------------------------------------*/
275static const uint32_t hx8399a_1080p_video_timings[] = {
276 0xf9, 0x3d, 0x34, 0x00, 0x58, 0x4d, 0x36, 0x3f, 0x53, 0x03, 0x04, 0x00
277};
278
279static struct panel_timing hx8399a_1080p_video_timing_info = {
280 0, 4, 0x1e, 0x38
281};
282
283/*---------------------------------------------------------------------------*/
284/* Panel reset sequence */
285/*---------------------------------------------------------------------------*/
286static struct panel_reset_sequence hx8399a_1080p_video_reset_seq = {
287 {1, 0, 1, }, {20, 2, 20, }, 2
288};
289
290/*---------------------------------------------------------------------------*/
291/* Backlight setting */
292/*---------------------------------------------------------------------------*/
293static struct backlight hx8399a_1080p_video_backlight = {
294 1, 1, 4095, 100, 1, "PMIC_8941"
295};
296
297#define HX8399A_1080P_VIDEO_SIGNATURE 0xA0000
298
299#endif /*_PANEL_HX8399A_1080P_VIDEO_H_*/