blob: de71ef9332edf8a3840877c68e4e425b3d1c16f6 [file] [log] [blame]
Jeevan Shrirambeadd012015-01-07 19:10:10 -08001/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
Dhaval Patel019057a2014-08-12 13:52:25 -07002 *
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>
Veera Sundaram Sankaran089f70d2014-12-09 14:17:05 -080031#include <string.h>
Dhaval Patel019057a2014-08-12 13:52:25 -070032#include <err.h>
33#include <smem.h>
34#include <msm_panel.h>
35#include <board.h>
36#include <mipi_dsi.h>
Veera Sundaram Sankaran089f70d2014-12-09 14:17:05 -080037#include <qtimer.h>
Jeevan Shrirambeadd012015-01-07 19:10:10 -080038#include <platform.h>
Dhaval Patel019057a2014-08-12 13:52:25 -070039
40#include "include/panel.h"
41#include "panel_display.h"
42
43/*---------------------------------------------------------------------------*/
44/* GCDB Panel Database */
45/*---------------------------------------------------------------------------*/
46#include "include/panel_sharp_wqxga_dualdsi_video.h"
47#include "include/panel_jdi_qhd_dualdsi_video.h"
48#include "include/panel_jdi_qhd_dualdsi_cmd.h"
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -070049#include "include/panel_jdi_4k_dualdsi_video.h"
Ingrid Gallardodfb1d492014-10-31 16:54:26 -070050#include "include/panel_jdi_1080p_video.h"
Veera Sundaram Sankaran7f4f5a52015-02-25 19:09:56 -080051#include "include/panel_sharp_1080p_cmd.h"
Ilia Lin45668192014-11-23 16:15:03 +020052#include "include/panel_hx8379a_truly_fwvga_video.h"
Jeevan Shriram5ed1b822014-11-30 22:10:57 -080053#include "include/panel_nt35597_wqxga_video.h"
54#include "include/panel_nt35597_wqxga_cmd.h"
Dhaval Patel019057a2014-08-12 13:52:25 -070055
56/*---------------------------------------------------------------------------*/
57/* static panel selection variable */
58/*---------------------------------------------------------------------------*/
59enum {
60SHARP_WQXGA_DUALDSI_VIDEO_PANEL,
61JDI_QHD_DUALDSI_VIDEO_PANEL,
62JDI_QHD_DUALDSI_CMD_PANEL,
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -070063JDI_4K_DUALDSI_VIDEO_PANEL,
Ingrid Gallardodfb1d492014-10-31 16:54:26 -070064JDI_1080P_VIDEO_PANEL,
Veera Sundaram Sankaran7f4f5a52015-02-25 19:09:56 -080065SHARP_1080P_CMD_PANEL,
Ilia Lin45668192014-11-23 16:15:03 +020066HX8379A_TRULY_FWVGA_VIDEO_PANEL,
Jeevan Shriram5ed1b822014-11-30 22:10:57 -080067NOVATEK_WQXGA_VIDEO_PANEL,
68NOVATEK_WQXGA_CMD_PANEL,
Dhaval Patel019057a2014-08-12 13:52:25 -070069UNKNOWN_PANEL
70};
71
72/*
73 * The list of panels that are supported on this target.
74 * Any panel in this list can be selected using fastboot oem command.
75 */
76static struct panel_list supp_panels[] = {
77 {"sharp_wqxga_dualdsi_video", SHARP_WQXGA_DUALDSI_VIDEO_PANEL},
78 {"jdi_qhd_dualdsi_video", JDI_QHD_DUALDSI_VIDEO_PANEL},
79 {"jdi_qhd_dualdsi_cmd", JDI_QHD_DUALDSI_CMD_PANEL},
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -070080 {"jdi_4k_dualdsi_video", JDI_4K_DUALDSI_VIDEO_PANEL},
Ingrid Gallardodfb1d492014-10-31 16:54:26 -070081 {"jdi_1080p_video", JDI_1080P_VIDEO_PANEL},
Veera Sundaram Sankaran7f4f5a52015-02-25 19:09:56 -080082 {"sharp_1080p_cmd", SHARP_1080P_CMD_PANEL},
Ilia Lin45668192014-11-23 16:15:03 +020083 {"hx8379a_truly_fwvga_video", HX8379A_TRULY_FWVGA_VIDEO_PANEL},
Jeevan Shriram5ed1b822014-11-30 22:10:57 -080084 {"nt35597_wqxga_video", NOVATEK_WQXGA_VIDEO_PANEL},
85 {"nt35597_wqxga_cmd", NOVATEK_WQXGA_CMD_PANEL},
Dhaval Patel019057a2014-08-12 13:52:25 -070086};
87
88static uint32_t panel_id;
89
90int oem_panel_rotation()
91{
92 /* OEM can keep there panel specific on instructions in this
93 function */
94 return NO_ERROR;
95}
96
97int oem_panel_on()
98{
99 /* OEM can keep there panel specific on instructions in this
100 function */
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 /* OEM can keep there panel specific off instructions in this
112 function */
113 return NO_ERROR;
114}
115
116static bool init_panel_data(struct panel_struct *panelstruct,
117 struct msm_panel_info *pinfo,
118 struct mdss_dsi_phy_ctrl *phy_db)
119{
120 int pan_type;
121
Dhaval Patel019057a2014-08-12 13:52:25 -0700122 switch (panel_id) {
123 case SHARP_WQXGA_DUALDSI_VIDEO_PANEL:
124 pan_type = PANEL_TYPE_DSI;
Kuogee Hsieh208736d2014-08-22 14:16:55 -0700125 pinfo->lcd_reg_en = 0;
Dhaval Patel019057a2014-08-12 13:52:25 -0700126 panelstruct->paneldata = &sharp_wqxga_dualdsi_video_panel_data;
127 panelstruct->paneldata->panel_operating_mode = 11;
128 panelstruct->paneldata->panel_with_enable_gpio = 0;
Jeevan Shrirambeadd012015-01-07 19:10:10 -0800129
130 /*
131 * Even though this panel can be supported with a single pipe,
132 * enable ping-pong split and use two pipes for simplicity sake.
133 */
134 if (platform_is_msm8992())
135 panelstruct->paneldata->panel_operating_mode |= DST_SPLIT_FLAG;
136
Dhaval Patel019057a2014-08-12 13:52:25 -0700137 panelstruct->panelres = &sharp_wqxga_dualdsi_video_panel_res;
138 panelstruct->color = &sharp_wqxga_dualdsi_video_color;
139 panelstruct->videopanel = &sharp_wqxga_dualdsi_video_video_panel;
140 panelstruct->commandpanel = &sharp_wqxga_dualdsi_video_command_panel;
141 panelstruct->state = &sharp_wqxga_dualdsi_video_state;
142 panelstruct->laneconfig = &sharp_wqxga_dualdsi_video_lane_config;
143 panelstruct->paneltiminginfo
144 = &sharp_wqxga_dualdsi_video_timing_info;
145 panelstruct->panelresetseq
146 = &sharp_wqxga_dualdsi_video_reset_seq;
147 panelstruct->backlightinfo = &sharp_wqxga_dualdsi_video_backlight;
Kuogee Hsieh099022f2014-12-05 15:43:40 -0800148
149 pinfo->labibb = &sharp_wqxga_dualdsi_video_labibb;
150
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530151 pinfo->mipi.panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700152 = sharp_wqxga_dualdsi_video_on_command;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530153 pinfo->mipi.num_of_panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700154 = SHARP_WQXGA_DUALDSI_VIDEO_ON_COMMAND;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530155 pinfo->mipi.panel_off_cmds
156 = sharp_wqxga_dualdsi_video_off_command;
157 pinfo->mipi.num_of_panel_off_cmds
158 = SHARP_WQXGA_DUALDSI_VIDEO_OFF_COMMAND;
Dhaval Patel019057a2014-08-12 13:52:25 -0700159 memcpy(phy_db->timing,
160 sharp_wqxga_dualdsi_video_timings, TIMING_SIZE);
Huaibin Yang6ea820d2014-11-08 12:50:13 -0800161 pinfo->dfps.panel_dfps = sharp_wqxga_dualdsi_video_dfps;
Huaibin Yang6e254e72015-03-03 11:11:11 -0800162 pinfo->mipi.tx_eot_append = true;
Dhaval Patel019057a2014-08-12 13:52:25 -0700163 break;
164 case JDI_QHD_DUALDSI_VIDEO_PANEL:
165 pan_type = PANEL_TYPE_DSI;
Kuogee Hsieh208736d2014-08-22 14:16:55 -0700166 pinfo->lcd_reg_en = 1;
Dhaval Patel019057a2014-08-12 13:52:25 -0700167 panelstruct->paneldata = &jdi_qhd_dualdsi_video_panel_data;
Jeevan Shrirambeadd012015-01-07 19:10:10 -0800168
169 if (platform_is_msm8992())
170 panelstruct->paneldata->panel_operating_mode |= DST_SPLIT_FLAG;
171
Dhaval Patel019057a2014-08-12 13:52:25 -0700172 panelstruct->panelres = &jdi_qhd_dualdsi_video_panel_res;
173 panelstruct->color = &jdi_qhd_dualdsi_video_color;
174 panelstruct->videopanel = &jdi_qhd_dualdsi_video_video_panel;
175 panelstruct->commandpanel = &jdi_qhd_dualdsi_video_command_panel;
176 panelstruct->state = &jdi_qhd_dualdsi_video_state;
177 panelstruct->laneconfig = &jdi_qhd_dualdsi_video_lane_config;
178 panelstruct->paneltiminginfo
179 = &jdi_qhd_dualdsi_video_timing_info;
180 panelstruct->panelresetseq
181 = &jdi_qhd_dualdsi_video_reset_seq;
Dhaval Patel019057a2014-08-12 13:52:25 -0700182 panelstruct->backlightinfo = &jdi_qhd_dualdsi_video_backlight;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530183 pinfo->mipi.panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700184 = jdi_qhd_dualdsi_video_on_command;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530185 pinfo->mipi.num_of_panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700186 = JDI_QHD_DUALDSI_VIDEO_ON_COMMAND;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530187 pinfo->mipi.panel_off_cmds
188 = jdi_qhd_dualdsi_video_off_command;
189 pinfo->mipi.num_of_panel_off_cmds
190 = JDI_QHD_DUALDSI_VIDEO_OFF_COMMAND;
Dhaval Patel019057a2014-08-12 13:52:25 -0700191 memcpy(phy_db->timing,
192 jdi_qhd_dualdsi_video_timings, TIMING_SIZE);
193 break;
194 case JDI_QHD_DUALDSI_CMD_PANEL:
195 pan_type = PANEL_TYPE_DSI;
Kuogee Hsieh208736d2014-08-22 14:16:55 -0700196 pinfo->lcd_reg_en = 1;
Dhaval Patel019057a2014-08-12 13:52:25 -0700197 panelstruct->paneldata = &jdi_qhd_dualdsi_cmd_panel_data;
Jeevan Shrirambeadd012015-01-07 19:10:10 -0800198
199 if (platform_is_msm8992())
200 panelstruct->paneldata->panel_operating_mode |= DST_SPLIT_FLAG;
201
Dhaval Patel019057a2014-08-12 13:52:25 -0700202 panelstruct->panelres = &jdi_qhd_dualdsi_cmd_panel_res;
203 panelstruct->color = &jdi_qhd_dualdsi_cmd_color;
204 panelstruct->videopanel = &jdi_qhd_dualdsi_cmd_video_panel;
205 panelstruct->commandpanel = &jdi_qhd_dualdsi_cmd_command_panel;
206 panelstruct->state = &jdi_qhd_dualdsi_cmd_state;
207 panelstruct->laneconfig = &jdi_qhd_dualdsi_cmd_lane_config;
208 panelstruct->paneltiminginfo
209 = &jdi_qhd_dualdsi_cmd_timing_info;
210 panelstruct->panelresetseq
211 = &jdi_qhd_dualdsi_cmd_reset_seq;
Dhaval Patel019057a2014-08-12 13:52:25 -0700212 panelstruct->backlightinfo = &jdi_qhd_dualdsi_cmd_backlight;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530213 pinfo->mipi.panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700214 = jdi_qhd_dualdsi_cmd_on_command;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530215 pinfo->mipi.num_of_panel_on_cmds
Dhaval Patel019057a2014-08-12 13:52:25 -0700216 = JDI_QHD_DUALDSI_CMD_ON_COMMAND;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530217 pinfo->mipi.panel_off_cmds
218 = jdi_qhd_dualdsi_cmd_off_command;
219 pinfo->mipi.num_of_panel_off_cmds
220 = JDI_QHD_DUALDSI_CMD_OFF_COMMAND;
Dhaval Patel019057a2014-08-12 13:52:25 -0700221 memcpy(phy_db->timing,
222 jdi_qhd_dualdsi_cmd_timings, TIMING_SIZE);
223 break;
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700224 case JDI_4K_DUALDSI_VIDEO_PANEL:
225 pan_type = PANEL_TYPE_DSI;
226 pinfo->lcd_reg_en = 1;
227 pinfo->mipi.cmds_post_tg = 1;
228 panelstruct->paneldata = &jdi_4k_dualdsi_video_panel_data;
Jeevan Shrirambeadd012015-01-07 19:10:10 -0800229
230 if (platform_is_msm8992())
231 panelstruct->paneldata->panel_operating_mode |= DST_SPLIT_FLAG;
232
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700233 panelstruct->panelres = &jdi_4k_dualdsi_video_panel_res;
234 panelstruct->color = &jdi_4k_dualdsi_video_color;
235 panelstruct->videopanel = &jdi_4k_dualdsi_video_video_panel;
236 panelstruct->commandpanel = &jdi_4k_dualdsi_video_command_panel;
237 panelstruct->state = &jdi_4k_dualdsi_video_state;
238 panelstruct->laneconfig = &jdi_4k_dualdsi_video_lane_config;
239 panelstruct->paneltiminginfo
240 = &jdi_4k_dualdsi_video_timing_info;
241 panelstruct->panelresetseq
242 = &jdi_4k_dualdsi_video_reset_seq;
243 panelstruct->backlightinfo = &jdi_4k_dualdsi_video_backlight;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530244 pinfo->mipi.panel_on_cmds
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700245 = jdi_4k_dualdsi_video_on_command;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530246 pinfo->mipi.num_of_panel_on_cmds
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700247 = JDI_4K_DUALDSI_VIDEO_ON_COMMAND;
Padmanabhan Komandurub3d31842014-11-04 15:47:53 +0530248 pinfo->mipi.panel_off_cmds
249 = jdi_4k_dualdsi_video_off_command;
250 pinfo->mipi.num_of_panel_off_cmds
251 = JDI_4K_DUALDSI_VIDEO_OFF_COMMAND;
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700252 memcpy(phy_db->timing,
253 jdi_4k_dualdsi_video_timings, TIMING_SIZE);
254 memcpy(&panelstruct->fbcinfo, &jdi_4k_dualdsi_video_fbc,
255 sizeof(struct fb_compression));
Ingrid Gallardod4d3cd62014-12-01 21:30:13 -0800256 break;
Ingrid Gallardodfb1d492014-10-31 16:54:26 -0700257 case JDI_1080P_VIDEO_PANEL:
258 pan_type = PANEL_TYPE_DSI;
259 pinfo->lcd_reg_en = 1;
260 panelstruct->paneldata = &jdi_1080p_video_panel_data;
261 panelstruct->panelres = &jdi_1080p_video_panel_res;
262 panelstruct->color = &jdi_1080p_video_color;
263 panelstruct->videopanel = &jdi_1080p_video_video_panel;
264 panelstruct->commandpanel = &jdi_1080p_video_command_panel;
265 panelstruct->state = &jdi_1080p_video_state;
266 panelstruct->laneconfig = &jdi_1080p_video_lane_config;
267 panelstruct->paneltiminginfo
268 = &jdi_1080p_video_timing_info;
269 panelstruct->panelresetseq
270 = &jdi_1080p_video_panel_reset_seq;
271 panelstruct->backlightinfo = &jdi_1080p_video_backlight;
272 pinfo->mipi.panel_on_cmds
273 = jdi_1080p_video_on_command;
274 pinfo->mipi.num_of_panel_on_cmds
275 = JDI_1080P_VIDEO_ON_COMMAND;
276 pinfo->mipi.panel_off_cmds
277 = jdi_1080p_video_off_command;
278 pinfo->mipi.num_of_panel_off_cmds
279 = JDI_1080P_VIDEO_OFF_COMMAND;
280 memcpy(phy_db->timing,
281 jdi_1080p_video_timings, TIMING_SIZE);
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700282 break;
Veera Sundaram Sankaran7f4f5a52015-02-25 19:09:56 -0800283 case SHARP_1080P_CMD_PANEL:
284 pan_type = PANEL_TYPE_DSI;
285 pinfo->lcd_reg_en = 0;
286 panelstruct->paneldata = &sharp_1080p_cmd_panel_data;
287 panelstruct->panelres = &sharp_1080p_cmd_panel_res;
288 panelstruct->color = &sharp_1080p_cmd_color;
289 panelstruct->videopanel = &sharp_1080p_cmd_video_panel;
290 panelstruct->commandpanel = &sharp_1080p_cmd_command_panel;
291 panelstruct->state = &sharp_1080p_cmd_state;
292 panelstruct->laneconfig = &sharp_1080p_cmd_lane_config;
293 panelstruct->paneltiminginfo
294 = &sharp_1080p_cmd_timing_info;
295 panelstruct->panelresetseq
296 = &sharp_1080p_cmd_panel_reset_seq;
297 panelstruct->backlightinfo = &sharp_1080p_cmd_backlight;
298 pinfo->mipi.panel_on_cmds
299 = sharp_1080p_cmd_on_command;
300 pinfo->mipi.num_of_panel_on_cmds
301 = SHARP_1080P_CMD_ON_COMMAND;
302 pinfo->mipi.panel_off_cmds
303 = sharp_1080p_cmd_off_command;
304 pinfo->mipi.num_of_panel_off_cmds
305 = SHARP_1080P_CMD_OFF_COMMAND;
306 memcpy(phy_db->timing,
307 sharp_1080p_cmd_timings, TIMING_SIZE);
308 break;
Ilia Lin45668192014-11-23 16:15:03 +0200309 case HX8379A_TRULY_FWVGA_VIDEO_PANEL:
310 pan_type = PANEL_TYPE_DSI;
311 pinfo->lcd_reg_en = 1;
312 panelstruct->paneldata = &hx8379a_truly_fwvga_video_panel_data;
313 panelstruct->panelres = &hx8379a_truly_fwvga_video_panel_res;
314 panelstruct->color = &hx8379a_truly_fwvga_video_color;
315 panelstruct->videopanel = &hx8379a_truly_fwvga_video_video_panel;
316 panelstruct->commandpanel = &hx8379a_truly_fwvga_video_command_panel;
317 panelstruct->state = &hx8379a_truly_fwvga_video_state;
318 panelstruct->laneconfig = &hx8379a_truly_fwvga_video_lane_config;
319 panelstruct->paneltiminginfo
320 = &hx8379a_truly_fwvga_video_timing_info;
321 panelstruct->panelresetseq
322 = &hx8379a_truly_fwvga_video_reset_seq;
323 panelstruct->backlightinfo = &hx8379a_truly_fwvga_video_backlight;
324 pinfo->mipi.panel_on_cmds
325 = hx8379a_truly_fwvga_video_on_command;
326 pinfo->mipi.num_of_panel_on_cmds
327 = HX8379A_TRULY_FWVGA_VIDEO_ON_COMMAND;
328 pinfo->mipi.panel_off_cmds
329 = hx8379a_truly_fwvga_video_off_command;
330 pinfo->mipi.num_of_panel_off_cmds
331 = HX8379A_TRULY_FWVGA_VIDEO_OFF_COMMAND;
332 pinfo->mipi.broadcast = 0;
333 memcpy(phy_db->timing,
334 hx8379a_truly_fwvga_video_timings, TIMING_SIZE);
Jeevan Shriram5ed1b822014-11-30 22:10:57 -0800335 case NOVATEK_WQXGA_VIDEO_PANEL:
336 dprintf(ALWAYS, " Novatek 35597 panel selected\n");
337 pan_type = PANEL_TYPE_DSI;
338 pinfo->lcd_reg_en = 0;
339 panelstruct->paneldata = &nt35597_wqxga_video_panel_data;
340 panelstruct->paneldata->panel_with_enable_gpio = 0;
341 panelstruct->panelres = &nt35597_wqxga_video_panel_res;
342 panelstruct->color = &nt35597_wqxga_video_color;
343 panelstruct->videopanel = &nt35597_wqxga_video_video_panel;
344 panelstruct->commandpanel = &nt35597_wqxga_video_command_panel;
345 panelstruct->state = &nt35597_wqxga_video_state;
346 panelstruct->laneconfig = &nt35597_wqxga_video_lane_config;
347 panelstruct->paneltiminginfo
348 = &nt35597_wqxga_video_timing_info;
349 panelstruct->panelresetseq
350 = &nt35597_wqxga_video_reset_seq;
351 panelstruct->backlightinfo = &nt35597_wqxga_video_backlight;
352 pinfo->mipi.panel_on_cmds
353 = nt35597_wqxga_video_on_command;
354 pinfo->mipi.num_of_panel_on_cmds
355 = NT35597_WQXGA_VIDEO_ON_COMMAND;
356 pinfo->mipi.panel_off_cmds
357 = nt35597_wqxga_video_off_command;
358 pinfo->mipi.num_of_panel_off_cmds
359 = NT35597_WQXGA_VIDEO_OFF_COMMAND;
360 memcpy(phy_db->timing,
361 nt35597_wqxga_video_timings, TIMING_SIZE);
362 memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_video_fbc,
363 sizeof(struct fb_compression));
364 break;
365 case NOVATEK_WQXGA_CMD_PANEL:
366 dprintf(ALWAYS, " Novatek 35597 command mode panel selected\n");
367 pan_type = PANEL_TYPE_DSI;
368 pinfo->lcd_reg_en = 1;
369 panelstruct->paneldata = &nt35597_wqxga_cmd_panel_data;
370 panelstruct->paneldata->panel_with_enable_gpio = 0;
371 panelstruct->panelres = &nt35597_wqxga_cmd_panel_res;
372 panelstruct->color = &nt35597_wqxga_cmd_color;
373 panelstruct->videopanel = &nt35597_wqxga_cmd_video_panel;
374 panelstruct->commandpanel = &nt35597_wqxga_cmd_command_panel;
375 panelstruct->state = &nt35597_wqxga_cmd_state;
376 panelstruct->laneconfig = &nt35597_wqxga_cmd_lane_config;
377 panelstruct->paneltiminginfo
378 = &nt35597_wqxga_cmd_timing_info;
379 panelstruct->panelresetseq
380 = &nt35597_wqxga_cmd_reset_seq;
381 panelstruct->backlightinfo = &nt35597_wqxga_cmd_backlight;
382 pinfo->mipi.panel_on_cmds
383 = nt35597_wqxga_cmd_on_command;
384 pinfo->mipi.num_of_panel_on_cmds
385 = NT35597_WQXGA_CMD_ON_COMMAND;
386 pinfo->mipi.panel_off_cmds
387 = nt35597_wqxga_cmd_off_command;
388 pinfo->mipi.num_of_panel_off_cmds
389 = NT35597_WQXGA_CMD_OFF_COMMAND;
390 memcpy(phy_db->timing,
391 nt35597_wqxga_cmd_timings, TIMING_SIZE);
392 memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_cmd_fbc,
393 sizeof(struct fb_compression));
Ilia Lin45668192014-11-23 16:15:03 +0200394 break;
Dhaval Patel019057a2014-08-12 13:52:25 -0700395 default:
396 case UNKNOWN_PANEL:
397 pan_type = PANEL_TYPE_UNKNOWN;
398 break;
399 }
400 return pan_type;
401}
402
Veera Sundaram Sankaranded347c2014-12-17 17:22:52 -0800403int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
Dhaval Patel019057a2014-08-12 13:52:25 -0700404 struct msm_panel_info *pinfo,
405 struct mdss_dsi_phy_ctrl *phy_db)
406{
407 uint32_t hw_id = board_hardware_id();
408 int32_t panel_override_id;
409
Dhaval Patel8b9a5822015-03-16 13:01:26 -0700410 phy_db->pll_type = DSI_PLL_TYPE_20NM;
411
Dhaval Patel019057a2014-08-12 13:52:25 -0700412 if (panel_name) {
413 panel_override_id = panel_name_to_id(supp_panels,
414 ARRAY_SIZE(supp_panels), panel_name);
415
416 if (panel_override_id < 0) {
417 dprintf(CRITICAL, "Not able to search the panel:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530418 panel_name);
Dhaval Patel019057a2014-08-12 13:52:25 -0700419 } else if (panel_override_id < UNKNOWN_PANEL) {
420 /* panel override using fastboot oem command */
421 panel_id = panel_override_id;
422
423 dprintf(INFO, "OEM panel override:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530424 panel_name);
Dhaval Patel019057a2014-08-12 13:52:25 -0700425 goto panel_init;
426 }
427 }
428
429 switch (hw_id) {
430 case HW_PLATFORM_MTP:
431 case HW_PLATFORM_FLUID:
432 case HW_PLATFORM_SURF:
433 panel_id = SHARP_WQXGA_DUALDSI_VIDEO_PANEL;
434 break;
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700435 case HW_PLATFORM_LIQUID:
436 panel_id = JDI_4K_DUALDSI_VIDEO_PANEL;
437 break;
Dhaval Patel019057a2014-08-12 13:52:25 -0700438 default:
439 dprintf(CRITICAL, "Display not enabled for %d HW type\n"
440 , hw_id);
441 return PANEL_TYPE_UNKNOWN;
442 }
443
444panel_init:
Ilia Lin45668192014-11-23 16:15:03 +0200445 if (panel_id == JDI_4K_DUALDSI_VIDEO_PANEL || panel_id == HX8379A_TRULY_FWVGA_VIDEO_PANEL)
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700446 phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE;
Dhaval Patel019057a2014-08-12 13:52:25 -0700447 return init_panel_data(panelstruct, pinfo, phy_db);
448}