blob: 8e98d95918161747baa7177338154fc17b1aa2e2 [file] [log] [blame]
Dhaval Patelb95039c2015-03-16 11:14:06 -07001/* Copyright (c) 2013-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#include <debug.h>
31#include <string.h>
32#include <err.h>
33#include <smem.h>
34#include <msm_panel.h>
35#include <board.h>
36#include <mipi_dsi.h>
37#include <qtimer.h>
38#include <platform.h>
39
Ujwal Patel41a665a2015-07-17 13:51:30 -070040#include "gcdb_display.h"
Dhaval Patelb95039c2015-03-16 11:14:06 -070041#include "include/panel.h"
42#include "target/display.h"
43#include "panel_display.h"
44#include <mipi_dsi.h>
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070045#include <mdp5.h>
Dhaval Patelb95039c2015-03-16 11:14:06 -070046
47/*---------------------------------------------------------------------------*/
48/* GCDB Panel Database */
49/*---------------------------------------------------------------------------*/
Dhaval Patel989d4fc2015-04-01 19:04:46 -070050#include "include/panel_nt35597_wqxga_dualdsi_video.h"
Kuogee Hsieh9d7e7142015-06-16 10:36:19 -070051#include "include/panel_nt35597_wqxga_dualdsi_cmd.h"
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070052#include "include/panel_nt35597_wqxga_dsc_video.h"
53#include "include/panel_nt35597_wqxga_dsc_cmd.h"
Dhaval Patelb95039c2015-03-16 11:14:06 -070054#include "include/panel_sharp_wqxga_dualdsi_video.h"
55#include "include/panel_jdi_qhd_dualdsi_video.h"
56#include "include/panel_jdi_qhd_dualdsi_cmd.h"
feifanz76fe6482015-09-02 15:25:16 +080057#include "include/panel_r69007_wqxga_cmd.h"
Kuogee Hsiehb976dfc2015-08-28 13:21:30 -070058#include "include/panel_jdi_4k_dualdsi_video_nofbc.h"
Dhaval Patelb95039c2015-03-16 11:14:06 -070059
60/*---------------------------------------------------------------------------*/
61/* static panel selection variable */
62/*---------------------------------------------------------------------------*/
63enum {
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070064 SHARP_WQXGA_DUALDSI_VIDEO_PANEL,
Dhaval Patel989d4fc2015-04-01 19:04:46 -070065 NT35597_WQXGA_DUALDSI_VIDEO_PANEL,
Kuogee Hsieh9d7e7142015-06-16 10:36:19 -070066 NT35597_WQXGA_DUALDSI_CMD_PANEL,
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070067 NT35597_WQXGA_DSC_VIDEO_PANEL,
68 NT35597_WQXGA_DSC_CMD_PANEL,
Dhaval Patelb95039c2015-03-16 11:14:06 -070069 JDI_QHD_DUALDSI_VIDEO_PANEL,
70 JDI_QHD_DUALDSI_CMD_PANEL,
feifanz76fe6482015-09-02 15:25:16 +080071 R69007_WQXGA_CMD_PANEL,
Kuogee Hsiehb976dfc2015-08-28 13:21:30 -070072 JDI_4K_DUALDSI_VIDEO_NOFBC_PANEL,
Dhaval Patelb95039c2015-03-16 11:14:06 -070073 UNKNOWN_PANEL
74};
75
76/*
77 * The list of panels that are supported on this target.
78 * Any panel in this list can be selected using fastboot oem command.
79 */
80static struct panel_list supp_panels[] = {
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070081 {"sharp_wqxga_dualdsi_video", SHARP_WQXGA_DUALDSI_VIDEO_PANEL},
Dhaval Patel989d4fc2015-04-01 19:04:46 -070082 {"nt35597_wqxga_dualdsi_video", NT35597_WQXGA_DUALDSI_VIDEO_PANEL},
Kuogee Hsieh9d7e7142015-06-16 10:36:19 -070083 {"nt35597_wqxga_dualdsi_cmd", NT35597_WQXGA_DUALDSI_CMD_PANEL},
Kuogee Hsieh0b492c92015-07-08 13:02:36 -070084 {"nt35597_wqxga_dsc_video", NT35597_WQXGA_DSC_VIDEO_PANEL},
85 {"nt35597_wqxga_dsc_cmd", NT35597_WQXGA_DSC_CMD_PANEL},
Dhaval Patelb95039c2015-03-16 11:14:06 -070086 {"jdi_qhd_dualdsi_video", JDI_QHD_DUALDSI_VIDEO_PANEL},
87 {"jdi_qhd_dualdsi_cmd", JDI_QHD_DUALDSI_CMD_PANEL},
feifanz76fe6482015-09-02 15:25:16 +080088 {"r69007_wqxga_cmd", R69007_WQXGA_CMD_PANEL},
Kuogee Hsiehb976dfc2015-08-28 13:21:30 -070089 {"jdi_4k_dualdsi_video_nofbc", JDI_4K_DUALDSI_VIDEO_NOFBC_PANEL},
Dhaval Patelb95039c2015-03-16 11:14:06 -070090};
91
92static uint32_t panel_id;
93
94int oem_panel_rotation()
95{
96 return NO_ERROR;
97}
98
99int oem_panel_on()
100{
101 if (panel_id == JDI_QHD_DUALDSI_CMD_PANEL) {
102 /* needs extra delay to avoid unexpected artifacts */
103 mdelay(JDI_QHD_DUALDSI_CMD_PANEL_ON_DELAY);
104
105 }
106 return NO_ERROR;
107}
108
109int oem_panel_off()
110{
111 return NO_ERROR;
112}
113
114static bool init_panel_data(struct panel_struct *panelstruct,
115 struct msm_panel_info *pinfo,
116 struct mdss_dsi_phy_ctrl *phy_db)
117{
118 int pan_type;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700119 struct oem_panel_data *oem_data = mdss_dsi_get_oem_data_ptr();
Dhaval Patelb95039c2015-03-16 11:14:06 -0700120
121 switch (panel_id) {
122 case SHARP_WQXGA_DUALDSI_VIDEO_PANEL:
123 pan_type = PANEL_TYPE_DSI;
124 pinfo->lcd_reg_en = 0;
125 panelstruct->paneldata = &sharp_wqxga_dualdsi_video_panel_data;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700126 panelstruct->paneldata->panel_operating_mode = 11;
127 panelstruct->paneldata->panel_with_enable_gpio = 0;
128
129 panelstruct->panelres = &sharp_wqxga_dualdsi_video_panel_res;
130 panelstruct->color = &sharp_wqxga_dualdsi_video_color;
131 panelstruct->videopanel = &sharp_wqxga_dualdsi_video_video_panel;
132 panelstruct->commandpanel = &sharp_wqxga_dualdsi_video_command_panel;
133 panelstruct->state = &sharp_wqxga_dualdsi_video_state;
134 panelstruct->laneconfig = &sharp_wqxga_dualdsi_video_lane_config;
135 panelstruct->paneltiminginfo
136 = &sharp_wqxga_dualdsi_video_timing_info;
137 panelstruct->panelresetseq
138 = &sharp_wqxga_dualdsi_video_reset_seq;
139 panelstruct->backlightinfo = &sharp_wqxga_dualdsi_video_backlight;
140
141 pinfo->labibb = &sharp_wqxga_dualdsi_video_labibb;
142
143 pinfo->mipi.panel_on_cmds
144 = sharp_wqxga_dualdsi_video_on_command;
145 pinfo->mipi.num_of_panel_on_cmds
146 = SHARP_WQXGA_DUALDSI_VIDEO_ON_COMMAND;
147 pinfo->mipi.panel_off_cmds
148 = sharp_wqxga_dualdsi_video_off_command;
149 pinfo->mipi.num_of_panel_off_cmds
150 = SHARP_WQXGA_DUALDSI_VIDEO_OFF_COMMAND;
151 memcpy(phy_db->timing,
152 sharp_wqxga_dualdsi_thulium_video_timings,
153 MAX_TIMING_CONFIG * sizeof(uint32_t));
Jeevan Shrirama3860092015-08-03 15:16:57 -0700154 pinfo->dfps.panel_dfps = sharp_wqxga_dualdsi_video_dfps;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700155 pinfo->mipi.tx_eot_append = true;
Ujwal Patelf4c6d2d2015-08-12 14:48:02 -0700156
157 /*
158 * remove DUAL_PIPE_FLAG because on this target for this panel,
159 * it will be added based on one of the selected configurations.
160 */
161 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
162 panelstruct->config = &sharp_wqxga_dualdsi_video_config0;
163 if (oem_data) {
164 switch (oem_data->cfg_num[0]) {
165 case -1: /* default */
166 case 0:
167 panelstruct->config =
168 &sharp_wqxga_dualdsi_video_config0;
169 break;
170 case 1:
171 panelstruct->config =
172 &sharp_wqxga_dualdsi_video_config1;
173 break;
174 default:
175 dprintf(CRITICAL, "topology config%d not supported. fallback to default config0\n",
176 oem_data->cfg_num[0]);
177 panelstruct->config = &sharp_wqxga_dualdsi_video_config0;
178 }
179 }
180 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
181 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
Dhaval Patelb95039c2015-03-16 11:14:06 -0700182 break;
Dhaval Patel989d4fc2015-04-01 19:04:46 -0700183 case NT35597_WQXGA_DUALDSI_VIDEO_PANEL:
184 pan_type = PANEL_TYPE_DSI;
185 pinfo->lcd_reg_en = 0;
186 panelstruct->paneldata = &nt35597_wqxga_dualdsi_video_panel_data;
Dhaval Patel989d4fc2015-04-01 19:04:46 -0700187 panelstruct->panelres = &nt35597_wqxga_dualdsi_video_panel_res;
188 panelstruct->color = &nt35597_wqxga_dualdsi_video_color;
189 panelstruct->videopanel = &nt35597_wqxga_dualdsi_video_video_panel;
190 panelstruct->commandpanel = &nt35597_wqxga_dualdsi_video_command_panel;
191 panelstruct->state = &nt35597_wqxga_dualdsi_video_state;
192 panelstruct->laneconfig = &nt35597_wqxga_dualdsi_video_lane_config;
193 panelstruct->paneltiminginfo
194 = &nt35597_wqxga_dualdsi_video_timing_info;
195 panelstruct->panelresetseq
196 = &nt35597_wqxga_dualdsi_video_reset_seq;
197 panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_video_backlight;
198
199 pinfo->labibb = &nt35597_wqxga_dualdsi_video_labibb;
200
201 pinfo->mipi.panel_on_cmds
202 = nt35597_wqxga_dualdsi_video_on_command;
203 pinfo->mipi.num_of_panel_on_cmds
204 = NT35597_WQXGA_DUALDSI_VIDEO_ON_COMMAND;
205 pinfo->mipi.panel_off_cmds
206 = nt35597_wqxga_dualdsi_video_off_command;
207 pinfo->mipi.num_of_panel_off_cmds
208 = NT35597_WQXGA_DUALDSI_VIDEO_OFF_COMMAND;
209 memcpy(phy_db->timing,
210 nt35597_wqxga_dualdsi_thulium_video_timings,
211 MAX_TIMING_CONFIG * sizeof(uint32_t));
212 pinfo->mipi.tx_eot_append = true;
Ujwal Patelf4c6d2d2015-08-12 14:48:02 -0700213
214 /*
215 * remove DUAL_PIPE_FLAG because on this target for this panel,
216 * it will be added based on one of the selected configurations.
217 */
218 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
219 panelstruct->config = &nt35597_wqxga_dualdsi_video_config0;
220 if (oem_data) {
221 switch (oem_data->cfg_num[0]) {
222 case -1: /* default */
223 case 0:
224 panelstruct->config =
225 &nt35597_wqxga_dualdsi_video_config0;
226 break;
227 case 1:
228 panelstruct->config =
229 &nt35597_wqxga_dualdsi_video_config1;
230 break;
231 default:
232 dprintf(CRITICAL, "topology config%d not supported. fallback to default config0\n",
233 oem_data->cfg_num[0]);
234 panelstruct->config = &nt35597_wqxga_dualdsi_video_config0;
235 }
236 }
237 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
238 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
Dhaval Patel989d4fc2015-04-01 19:04:46 -0700239 break;
Kuogee Hsieh9d7e7142015-06-16 10:36:19 -0700240 case NT35597_WQXGA_DUALDSI_CMD_PANEL:
241 pan_type = PANEL_TYPE_DSI;
242 pinfo->lcd_reg_en = 0;
243 panelstruct->paneldata = &nt35597_wqxga_dualdsi_cmd_panel_data;
244 panelstruct->panelres = &nt35597_wqxga_dualdsi_cmd_panel_res;
245 panelstruct->color = &nt35597_wqxga_dualdsi_cmd_color;
246 panelstruct->videopanel = &nt35597_wqxga_dualdsi_cmd_video_panel;
247 panelstruct->commandpanel = &nt35597_wqxga_dualdsi_cmd_command_panel;
248 panelstruct->state = &nt35597_wqxga_dualdsi_cmd_state;
249 panelstruct->laneconfig = &nt35597_wqxga_dualdsi_cmd_lane_config;
250 panelstruct->paneltiminginfo
251 = &nt35597_wqxga_dualdsi_cmd_timing_info;
252 panelstruct->panelresetseq
253 = &nt35597_wqxga_dualdsi_cmd_reset_seq;
254 panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_cmd_backlight;
255
256 pinfo->labibb = &nt35597_wqxga_dualdsi_cmd_labibb;
257
258 pinfo->mipi.panel_on_cmds
259 = nt35597_wqxga_dualdsi_cmd_on_command;
260 pinfo->mipi.num_of_panel_on_cmds
261 = NT35597_WQXGA_DUALDSI_CMD_ON_COMMAND;
262 pinfo->mipi.panel_off_cmds
263 = nt35597_wqxga_dualdsi_cmd_off_command;
264 pinfo->mipi.num_of_panel_off_cmds
265 = NT35597_WQXGA_DUALDSI_CMD_OFF_COMMAND;
266 memcpy(phy_db->timing,
267 nt35597_wqxga_dualdsi_thulium_cmd_timings,
268 MAX_TIMING_CONFIG * sizeof(uint32_t));
269 pinfo->mipi.tx_eot_append = true;
Ujwal Patelf4c6d2d2015-08-12 14:48:02 -0700270
271 /*
272 * remove DUAL_PIPE_FLAG because on this target for this panel,
273 * it will be added based on one of the selected configurations.
274 */
275 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
276 panelstruct->config = &nt35597_wqxga_dualdsi_cmd_config0;
277 if (oem_data) {
278 switch (oem_data->cfg_num[0]) {
279 case -1: /* default */
280 case 0:
281 panelstruct->config =
282 &nt35597_wqxga_dualdsi_cmd_config0;
283 break;
284 case 1:
285 panelstruct->config =
286 &nt35597_wqxga_dualdsi_cmd_config1;
287 break;
288 default:
289 dprintf(CRITICAL, "topology config%d not supported. fallback to default config0\n",
290 oem_data->cfg_num[0]);
291 panelstruct->config = &nt35597_wqxga_dualdsi_cmd_config0;
292 }
293 }
294 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
295 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
Kuogee Hsieh9d7e7142015-06-16 10:36:19 -0700296 break;
Kuogee Hsieh0b492c92015-07-08 13:02:36 -0700297 case NT35597_WQXGA_DSC_VIDEO_PANEL:
298 pan_type = PANEL_TYPE_DSI;
299 pinfo->lcd_reg_en = 0;
300 panelstruct->paneldata = &nt35597_wqxga_dsc_video_panel_data;
301 panelstruct->panelres = &nt35597_wqxga_dsc_video_panel_res;
302 panelstruct->color = &nt35597_wqxga_dsc_video_color;
303 panelstruct->videopanel = &nt35597_wqxga_dsc_video_video_panel;
304 panelstruct->commandpanel = &nt35597_wqxga_dsc_video_command_panel;
305 panelstruct->state = &nt35597_wqxga_dsc_video_state;
306 panelstruct->laneconfig = &nt35597_wqxga_dsc_video_lane_config;
307 panelstruct->paneltiminginfo
308 = &nt35597_wqxga_dsc_video_timing_info;
309 panelstruct->panelresetseq
310 = &nt35597_wqxga_dsc_video_reset_seq;
311 panelstruct->backlightinfo = &nt35597_wqxga_dsc_video_backlight;
312
313 pinfo->labibb = &nt35597_wqxga_dsc_video_labibb;
314
315 pinfo->mipi.panel_on_cmds
316 = nt35597_wqxga_dsc_video_on_command;
317 pinfo->mipi.num_of_panel_on_cmds
318 = NT35597_WQXGA_DSC_VIDEO_ON_COMMAND;
319 pinfo->mipi.panel_off_cmds
320 = nt35597_wqxga_dsc_video_off_command;
321 pinfo->mipi.num_of_panel_off_cmds
322 = NT35597_WQXGA_DSC_VIDEO_OFF_COMMAND;
323 memcpy(phy_db->timing,
324 nt35597_wqxga_dsc_thulium_video_timings,
325 MAX_TIMING_CONFIG * sizeof(uint32_t));
326 pinfo->mipi.tx_eot_append = true;
327
Ujwal Patel41a665a2015-07-17 13:51:30 -0700328 /*
329 * remove DUAL_PIPE_FLAG because on this target for this panel,
330 * it will be added based on one of the selected configurations.
331 */
332 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
333 panelstruct->config = &nt35597_wqxga_dsc_video_config2;
334 if (oem_data) {
335 switch (oem_data->cfg_num[0]) {
336 case -1: /* default */
337 case 0:
338 panelstruct->config =
339 &nt35597_wqxga_dsc_video_config0;
340 break;
341 case 1:
342 panelstruct->config =
343 &nt35597_wqxga_dsc_video_config1;
344 break;
345 case 2:
346 panelstruct->config =
347 &nt35597_wqxga_dsc_video_config2;
348 break;
349 default:
350 dprintf(CRITICAL, "topology config%d not supported. fallback to default config2\n",
351 oem_data->cfg_num[0]);
352 panelstruct->config = &nt35597_wqxga_dsc_video_config2;
353 }
354 }
355 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
356 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
357 pinfo->num_dsc_enc = panelstruct->config->num_dsc_enc;
358
Kuogee Hsieh0b492c92015-07-08 13:02:36 -0700359 pinfo->compression_mode = COMPRESSION_DSC;
Kuogee Hsieh0b492c92015-07-08 13:02:36 -0700360 pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc;
361 pinfo->dsc.dsc2buf = mdss_dsc_to_buf;
362 pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config;
363 pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config;
364 break;
365 case NT35597_WQXGA_DSC_CMD_PANEL:
366 pan_type = PANEL_TYPE_DSI;
367 pinfo->lcd_reg_en = 0;
368 panelstruct->paneldata = &nt35597_wqxga_dsc_cmd_panel_data;
369 panelstruct->panelres = &nt35597_wqxga_dsc_cmd_panel_res;
370 panelstruct->color = &nt35597_wqxga_dsc_cmd_color;
371 panelstruct->videopanel = &nt35597_wqxga_dsc_cmd_video_panel;
372 panelstruct->commandpanel = &nt35597_wqxga_dsc_cmd_command_panel;
373 panelstruct->state = &nt35597_wqxga_dsc_cmd_state;
374 panelstruct->laneconfig = &nt35597_wqxga_dsc_cmd_lane_config;
375 panelstruct->paneltiminginfo
376 = &nt35597_wqxga_dsc_cmd_timing_info;
377 panelstruct->panelresetseq
378 = &nt35597_wqxga_dsc_cmd_reset_seq;
379 panelstruct->backlightinfo = &nt35597_wqxga_dsc_cmd_backlight;
380
381 pinfo->labibb = &nt35597_wqxga_dsc_cmd_labibb;
382
383 pinfo->mipi.panel_on_cmds
384 = nt35597_wqxga_dsc_cmd_on_command;
385 pinfo->mipi.num_of_panel_on_cmds
386 = NT35597_WQXGA_DSC_CMD_ON_COMMAND;
387 pinfo->mipi.panel_off_cmds
388 = nt35597_wqxga_dsc_cmd_off_command;
389 pinfo->mipi.num_of_panel_off_cmds
390 = NT35597_WQXGA_DSC_CMD_OFF_COMMAND;
391 memcpy(phy_db->timing,
392 nt35597_wqxga_dsc_thulium_cmd_timings,
393 MAX_TIMING_CONFIG * sizeof(uint32_t));
394 pinfo->mipi.tx_eot_append = true;
395
Ujwal Patel41a665a2015-07-17 13:51:30 -0700396 /*
397 * remove DUAL_PIPE_FLAG because on this target for this panel,
398 * it will be added based on one of the selected configurations.
399 */
400 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
401 panelstruct->config = &nt35597_wqxga_dsc_cmd_config2;
402 if (oem_data) {
403 switch (oem_data->cfg_num[0]) {
404 case 0:
405 panelstruct->config =
406 &nt35597_wqxga_dsc_cmd_config0;
407 break;
408 case 1:
409 panelstruct->config =
410 &nt35597_wqxga_dsc_cmd_config1;
411 break;
412 case -1: /* default */
413 case 2:
414 panelstruct->config =
415 &nt35597_wqxga_dsc_cmd_config2;
416 break;
417 default:
418 dprintf(CRITICAL, "topology config%d not supported. fallback to default config2\n",
419 oem_data->cfg_num[0]);
420 panelstruct->config = &nt35597_wqxga_dsc_cmd_config2;
421 }
422 }
423
424 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
425 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
426 pinfo->num_dsc_enc = panelstruct->config->num_dsc_enc;
427
Kuogee Hsieh0b492c92015-07-08 13:02:36 -0700428 pinfo->compression_mode = COMPRESSION_DSC;
Kuogee Hsieh0b492c92015-07-08 13:02:36 -0700429 pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc;
430 pinfo->dsc.dsc2buf = mdss_dsc_to_buf;
431 pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config;
432 pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config;
433 break;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700434 case JDI_QHD_DUALDSI_VIDEO_PANEL:
435 pan_type = PANEL_TYPE_DSI;
436 pinfo->lcd_reg_en = 1;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700437 panelstruct->paneldata = &jdi_qhd_dualdsi_video_panel_data;
438
439 panelstruct->panelres = &jdi_qhd_dualdsi_video_panel_res;
440 panelstruct->color = &jdi_qhd_dualdsi_video_color;
441 panelstruct->videopanel = &jdi_qhd_dualdsi_video_video_panel;
442 panelstruct->commandpanel = &jdi_qhd_dualdsi_video_command_panel;
443 panelstruct->state = &jdi_qhd_dualdsi_video_state;
444 panelstruct->laneconfig = &jdi_qhd_dualdsi_video_lane_config;
445 panelstruct->paneltiminginfo
446 = &jdi_qhd_dualdsi_video_timing_info;
447 panelstruct->panelresetseq
448 = &jdi_qhd_dualdsi_video_reset_seq;
449 panelstruct->backlightinfo = &jdi_qhd_dualdsi_video_backlight;
450 pinfo->mipi.panel_on_cmds
451 = jdi_qhd_dualdsi_video_on_command;
452 pinfo->mipi.num_of_panel_on_cmds
453 = JDI_QHD_DUALDSI_VIDEO_ON_COMMAND;
454 pinfo->mipi.panel_off_cmds
455 = jdi_qhd_dualdsi_video_off_command;
456 pinfo->mipi.num_of_panel_off_cmds
457 = JDI_QHD_DUALDSI_VIDEO_OFF_COMMAND;
458 memcpy(phy_db->timing,
459 jdi_qhd_dualdsi_thulium_cmd_timings,
460 MAX_TIMING_CONFIG * sizeof(uint32_t));
461 break;
462 case JDI_QHD_DUALDSI_CMD_PANEL:
463 pan_type = PANEL_TYPE_DSI;
464 pinfo->lcd_reg_en = 1;
465 panelstruct->paneldata = &jdi_qhd_dualdsi_cmd_panel_data;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700466
467 panelstruct->panelres = &jdi_qhd_dualdsi_cmd_panel_res;
468 panelstruct->color = &jdi_qhd_dualdsi_cmd_color;
469 panelstruct->videopanel = &jdi_qhd_dualdsi_cmd_video_panel;
470 panelstruct->commandpanel = &jdi_qhd_dualdsi_cmd_command_panel;
471 panelstruct->state = &jdi_qhd_dualdsi_cmd_state;
472 panelstruct->laneconfig = &jdi_qhd_dualdsi_cmd_lane_config;
473 panelstruct->paneltiminginfo
474 = &jdi_qhd_dualdsi_cmd_timing_info;
475 panelstruct->panelresetseq
476 = &jdi_qhd_dualdsi_cmd_reset_seq;
477 panelstruct->backlightinfo = &jdi_qhd_dualdsi_cmd_backlight;
478 pinfo->mipi.panel_on_cmds
479 = jdi_qhd_dualdsi_cmd_on_command;
480 pinfo->mipi.num_of_panel_on_cmds
481 = JDI_QHD_DUALDSI_CMD_ON_COMMAND;
482 pinfo->mipi.panel_off_cmds
483 = jdi_qhd_dualdsi_cmd_off_command;
484 pinfo->mipi.num_of_panel_off_cmds
485 = JDI_QHD_DUALDSI_CMD_OFF_COMMAND;
486 memcpy(phy_db->timing,
487 jdi_qhd_dualdsi_thulium_video_timings,
488 MAX_TIMING_CONFIG * sizeof(uint32_t));
489 break;
feifanz76fe6482015-09-02 15:25:16 +0800490 case R69007_WQXGA_CMD_PANEL:
491 pan_type = PANEL_TYPE_DSI;
492 pinfo->lcd_reg_en = 0;
493 panelstruct->paneldata = &r69007_wqxga_cmd_panel_data;
494 panelstruct->panelres = &r69007_wqxga_cmd_panel_res;
495 panelstruct->color = &r69007_wqxga_cmd_color;
496 panelstruct->videopanel = &r69007_wqxga_cmd_video_panel;
497 panelstruct->commandpanel = &r69007_wqxga_cmd_command_panel;
498 panelstruct->state = &r69007_wqxga_cmd_state;
499 panelstruct->laneconfig = &r69007_wqxga_cmd_lane_config;
500 panelstruct->paneltiminginfo
501 = &r69007_wqxga_cmd_timing_info;
502 panelstruct->panelresetseq
503 = &r69007_wqxga_cmd_reset_seq;
504 panelstruct->backlightinfo = &r69007_wqxga_cmd_backlight;
505
506 pinfo->labibb = &r69007_wqxga_cmd_labibb;
507
508 pinfo->mipi.panel_on_cmds
509 = r69007_wqxga_cmd_on_command;
510 pinfo->mipi.num_of_panel_on_cmds
511 = R69007_WQXGA_CMD_ON_COMMAND;
512 pinfo->mipi.panel_off_cmds
513 = r69007_wqxga_cmd_off_command;
514 pinfo->mipi.num_of_panel_off_cmds
515 = R69007_WQXGA_CMD_OFF_COMMAND;
516 memcpy(phy_db->timing,
517 r69007_wqxga_thulium_cmd_timings,
518 MAX_TIMING_CONFIG * sizeof(uint32_t));
519 break;
Kuogee Hsiehb976dfc2015-08-28 13:21:30 -0700520 case JDI_4K_DUALDSI_VIDEO_NOFBC_PANEL:
521 pan_type = PANEL_TYPE_DSI;
522 /*
523 * send on_cmds at HS mode by setting cmds_post_tg so that
524 * on_cmds are sent after timing generator on
525 */
526 pinfo->mipi.cmds_post_tg = 1;
527 panelstruct->paneldata = &jdi_4k_dualdsi_video_nofbc_panel_data;
528
529 panelstruct->panelres = &jdi_4k_dualdsi_video_nofbc_panel_res;
530 panelstruct->color = &jdi_4k_dualdsi_video_nofbc_color;
531 panelstruct->videopanel = &jdi_4k_dualdsi_video_nofbc_video_panel;
532 panelstruct->commandpanel = &jdi_4k_dualdsi_video_nofbc_command_panel;
533 panelstruct->state = &jdi_4k_dualdsi_video_nofbc_state;
534 panelstruct->laneconfig = &jdi_4k_dualdsi_video_nofbc_lane_config;
535 panelstruct->paneltiminginfo
536 = &jdi_4k_dualdsi_video_nofbc_timing_info;
537 panelstruct->panelresetseq
538 = &jdi_4k_dualdsi_video_nofbc_reset_seq;
539 panelstruct->backlightinfo = &jdi_4k_dualdsi_video_nofbc_backlight;
540 pinfo->labibb = &jdi_4k_dualdsi_video_nofbc_labibb;
541
542 pinfo->mipi.panel_on_cmds
543 = jdi_4k_dualdsi_video_nofbc_on_command;
544 pinfo->mipi.num_of_panel_on_cmds
545 = JDI_4K_DUALDSI_VIDEO_NOFBC_ON_COMMAND;
546 pinfo->mipi.panel_off_cmds
547 = jdi_4k_dualdsi_video_nofbc_off_command;
548 pinfo->mipi.num_of_panel_off_cmds
549 = JDI_4K_DUALDSI_VIDEO_NOFBC_OFF_COMMAND;
550 memcpy(phy_db->timing,
551 jdi_4k_dualdsi_thulium_video_nofbc_timings,
552 MAX_TIMING_CONFIG * sizeof(uint32_t));
553 break;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700554 default:
555 case UNKNOWN_PANEL:
556 pan_type = PANEL_TYPE_UNKNOWN;
557 break;
558 }
Ujwal Patel41a665a2015-07-17 13:51:30 -0700559
560 dprintf(SPEW, "lm_split[0]=%d lm_split[1]=%d mode=0x%x\n",
561 pinfo->lm_split[0], pinfo->lm_split[1],
562 panelstruct->paneldata->panel_operating_mode);
563
Dhaval Patelb95039c2015-03-16 11:14:06 -0700564 return pan_type;
565}
566
567int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
568 struct msm_panel_info *pinfo,
569 struct mdss_dsi_phy_ctrl *phy_db)
570{
571 uint32_t hw_id = board_hardware_id();
572 int32_t panel_override_id;
573
574 phy_db->pll_type = DSI_PLL_TYPE_THULIUM;
575
576 if (panel_name) {
577 panel_override_id = panel_name_to_id(supp_panels,
578 ARRAY_SIZE(supp_panels), panel_name);
579
580 if (panel_override_id < 0) {
581 dprintf(CRITICAL, "Not able to search the panel:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530582 panel_name);
Dhaval Patelb95039c2015-03-16 11:14:06 -0700583 } else if (panel_override_id < UNKNOWN_PANEL) {
584 /* panel override using fastboot oem command */
585 panel_id = panel_override_id;
586
587 dprintf(INFO, "OEM panel override:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530588 panel_name);
Dhaval Patelb95039c2015-03-16 11:14:06 -0700589 goto panel_init;
590 }
591 }
592
593 switch (hw_id) {
594 case HW_PLATFORM_MTP:
595 case HW_PLATFORM_FLUID:
596 case HW_PLATFORM_SURF:
597 panel_id = SHARP_WQXGA_DUALDSI_VIDEO_PANEL;
598 break;
feifanz76fe6482015-09-02 15:25:16 +0800599 case HW_PLATFORM_QRD:
600 panel_id = R69007_WQXGA_CMD_PANEL;
601 break;
Kuogee Hsiehb976dfc2015-08-28 13:21:30 -0700602 case HW_PLATFORM_LIQUID:
603 panel_id = JDI_4K_DUALDSI_VIDEO_NOFBC_PANEL;
604 break;
Dhaval Patelb95039c2015-03-16 11:14:06 -0700605 default:
606 dprintf(CRITICAL, "Display not enabled for %d HW type\n"
607 , hw_id);
608 return PANEL_TYPE_UNKNOWN;
609 }
610
611panel_init:
612 return init_panel_data(panelstruct, pinfo, phy_db);
613}