blob: 1470faf903ae64c38ace1f053c7037b3b529b7ad [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);
Kuogee Hsiehd58c8092015-07-07 10:31:34 -0700254
255 pinfo->compression_mode = COMPRESSION_FBC;
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700256 memcpy(&panelstruct->fbcinfo, &jdi_4k_dualdsi_video_fbc,
257 sizeof(struct fb_compression));
Ingrid Gallardod4d3cd62014-12-01 21:30:13 -0800258 break;
Ingrid Gallardodfb1d492014-10-31 16:54:26 -0700259 case JDI_1080P_VIDEO_PANEL:
260 pan_type = PANEL_TYPE_DSI;
261 pinfo->lcd_reg_en = 1;
262 panelstruct->paneldata = &jdi_1080p_video_panel_data;
263 panelstruct->panelres = &jdi_1080p_video_panel_res;
264 panelstruct->color = &jdi_1080p_video_color;
265 panelstruct->videopanel = &jdi_1080p_video_video_panel;
266 panelstruct->commandpanel = &jdi_1080p_video_command_panel;
267 panelstruct->state = &jdi_1080p_video_state;
268 panelstruct->laneconfig = &jdi_1080p_video_lane_config;
269 panelstruct->paneltiminginfo
270 = &jdi_1080p_video_timing_info;
271 panelstruct->panelresetseq
272 = &jdi_1080p_video_panel_reset_seq;
273 panelstruct->backlightinfo = &jdi_1080p_video_backlight;
274 pinfo->mipi.panel_on_cmds
275 = jdi_1080p_video_on_command;
276 pinfo->mipi.num_of_panel_on_cmds
277 = JDI_1080P_VIDEO_ON_COMMAND;
278 pinfo->mipi.panel_off_cmds
279 = jdi_1080p_video_off_command;
280 pinfo->mipi.num_of_panel_off_cmds
281 = JDI_1080P_VIDEO_OFF_COMMAND;
282 memcpy(phy_db->timing,
283 jdi_1080p_video_timings, TIMING_SIZE);
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700284 break;
Veera Sundaram Sankaran7f4f5a52015-02-25 19:09:56 -0800285 case SHARP_1080P_CMD_PANEL:
286 pan_type = PANEL_TYPE_DSI;
287 pinfo->lcd_reg_en = 0;
288 panelstruct->paneldata = &sharp_1080p_cmd_panel_data;
289 panelstruct->panelres = &sharp_1080p_cmd_panel_res;
290 panelstruct->color = &sharp_1080p_cmd_color;
291 panelstruct->videopanel = &sharp_1080p_cmd_video_panel;
292 panelstruct->commandpanel = &sharp_1080p_cmd_command_panel;
293 panelstruct->state = &sharp_1080p_cmd_state;
294 panelstruct->laneconfig = &sharp_1080p_cmd_lane_config;
295 panelstruct->paneltiminginfo
296 = &sharp_1080p_cmd_timing_info;
297 panelstruct->panelresetseq
298 = &sharp_1080p_cmd_panel_reset_seq;
299 panelstruct->backlightinfo = &sharp_1080p_cmd_backlight;
300 pinfo->mipi.panel_on_cmds
301 = sharp_1080p_cmd_on_command;
302 pinfo->mipi.num_of_panel_on_cmds
303 = SHARP_1080P_CMD_ON_COMMAND;
304 pinfo->mipi.panel_off_cmds
305 = sharp_1080p_cmd_off_command;
306 pinfo->mipi.num_of_panel_off_cmds
307 = SHARP_1080P_CMD_OFF_COMMAND;
308 memcpy(phy_db->timing,
309 sharp_1080p_cmd_timings, TIMING_SIZE);
310 break;
Ilia Lin45668192014-11-23 16:15:03 +0200311 case HX8379A_TRULY_FWVGA_VIDEO_PANEL:
312 pan_type = PANEL_TYPE_DSI;
313 pinfo->lcd_reg_en = 1;
314 panelstruct->paneldata = &hx8379a_truly_fwvga_video_panel_data;
315 panelstruct->panelres = &hx8379a_truly_fwvga_video_panel_res;
316 panelstruct->color = &hx8379a_truly_fwvga_video_color;
317 panelstruct->videopanel = &hx8379a_truly_fwvga_video_video_panel;
318 panelstruct->commandpanel = &hx8379a_truly_fwvga_video_command_panel;
319 panelstruct->state = &hx8379a_truly_fwvga_video_state;
320 panelstruct->laneconfig = &hx8379a_truly_fwvga_video_lane_config;
321 panelstruct->paneltiminginfo
322 = &hx8379a_truly_fwvga_video_timing_info;
323 panelstruct->panelresetseq
324 = &hx8379a_truly_fwvga_video_reset_seq;
325 panelstruct->backlightinfo = &hx8379a_truly_fwvga_video_backlight;
326 pinfo->mipi.panel_on_cmds
327 = hx8379a_truly_fwvga_video_on_command;
328 pinfo->mipi.num_of_panel_on_cmds
329 = HX8379A_TRULY_FWVGA_VIDEO_ON_COMMAND;
330 pinfo->mipi.panel_off_cmds
331 = hx8379a_truly_fwvga_video_off_command;
332 pinfo->mipi.num_of_panel_off_cmds
333 = HX8379A_TRULY_FWVGA_VIDEO_OFF_COMMAND;
334 pinfo->mipi.broadcast = 0;
335 memcpy(phy_db->timing,
336 hx8379a_truly_fwvga_video_timings, TIMING_SIZE);
Jeevan Shriram5ed1b822014-11-30 22:10:57 -0800337 case NOVATEK_WQXGA_VIDEO_PANEL:
338 dprintf(ALWAYS, " Novatek 35597 panel selected\n");
339 pan_type = PANEL_TYPE_DSI;
340 pinfo->lcd_reg_en = 0;
341 panelstruct->paneldata = &nt35597_wqxga_video_panel_data;
342 panelstruct->paneldata->panel_with_enable_gpio = 0;
343 panelstruct->panelres = &nt35597_wqxga_video_panel_res;
344 panelstruct->color = &nt35597_wqxga_video_color;
345 panelstruct->videopanel = &nt35597_wqxga_video_video_panel;
346 panelstruct->commandpanel = &nt35597_wqxga_video_command_panel;
347 panelstruct->state = &nt35597_wqxga_video_state;
348 panelstruct->laneconfig = &nt35597_wqxga_video_lane_config;
349 panelstruct->paneltiminginfo
350 = &nt35597_wqxga_video_timing_info;
351 panelstruct->panelresetseq
352 = &nt35597_wqxga_video_reset_seq;
353 panelstruct->backlightinfo = &nt35597_wqxga_video_backlight;
354 pinfo->mipi.panel_on_cmds
355 = nt35597_wqxga_video_on_command;
356 pinfo->mipi.num_of_panel_on_cmds
357 = NT35597_WQXGA_VIDEO_ON_COMMAND;
358 pinfo->mipi.panel_off_cmds
359 = nt35597_wqxga_video_off_command;
360 pinfo->mipi.num_of_panel_off_cmds
361 = NT35597_WQXGA_VIDEO_OFF_COMMAND;
362 memcpy(phy_db->timing,
363 nt35597_wqxga_video_timings, TIMING_SIZE);
364 memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_video_fbc,
365 sizeof(struct fb_compression));
366 break;
367 case NOVATEK_WQXGA_CMD_PANEL:
368 dprintf(ALWAYS, " Novatek 35597 command mode panel selected\n");
369 pan_type = PANEL_TYPE_DSI;
370 pinfo->lcd_reg_en = 1;
371 panelstruct->paneldata = &nt35597_wqxga_cmd_panel_data;
372 panelstruct->paneldata->panel_with_enable_gpio = 0;
373 panelstruct->panelres = &nt35597_wqxga_cmd_panel_res;
374 panelstruct->color = &nt35597_wqxga_cmd_color;
375 panelstruct->videopanel = &nt35597_wqxga_cmd_video_panel;
376 panelstruct->commandpanel = &nt35597_wqxga_cmd_command_panel;
377 panelstruct->state = &nt35597_wqxga_cmd_state;
378 panelstruct->laneconfig = &nt35597_wqxga_cmd_lane_config;
379 panelstruct->paneltiminginfo
380 = &nt35597_wqxga_cmd_timing_info;
381 panelstruct->panelresetseq
382 = &nt35597_wqxga_cmd_reset_seq;
383 panelstruct->backlightinfo = &nt35597_wqxga_cmd_backlight;
384 pinfo->mipi.panel_on_cmds
385 = nt35597_wqxga_cmd_on_command;
386 pinfo->mipi.num_of_panel_on_cmds
387 = NT35597_WQXGA_CMD_ON_COMMAND;
388 pinfo->mipi.panel_off_cmds
389 = nt35597_wqxga_cmd_off_command;
390 pinfo->mipi.num_of_panel_off_cmds
391 = NT35597_WQXGA_CMD_OFF_COMMAND;
392 memcpy(phy_db->timing,
393 nt35597_wqxga_cmd_timings, TIMING_SIZE);
394 memcpy(&panelstruct->fbcinfo, &nt35597_wqxga_cmd_fbc,
395 sizeof(struct fb_compression));
Ilia Lin45668192014-11-23 16:15:03 +0200396 break;
Dhaval Patel019057a2014-08-12 13:52:25 -0700397 default:
398 case UNKNOWN_PANEL:
399 pan_type = PANEL_TYPE_UNKNOWN;
400 break;
401 }
402 return pan_type;
403}
404
Veera Sundaram Sankaranded347c2014-12-17 17:22:52 -0800405int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
Dhaval Patel019057a2014-08-12 13:52:25 -0700406 struct msm_panel_info *pinfo,
407 struct mdss_dsi_phy_ctrl *phy_db)
408{
409 uint32_t hw_id = board_hardware_id();
410 int32_t panel_override_id;
411
Dhaval Patel8b9a5822015-03-16 13:01:26 -0700412 phy_db->pll_type = DSI_PLL_TYPE_20NM;
413
Dhaval Patel019057a2014-08-12 13:52:25 -0700414 if (panel_name) {
415 panel_override_id = panel_name_to_id(supp_panels,
416 ARRAY_SIZE(supp_panels), panel_name);
417
418 if (panel_override_id < 0) {
419 dprintf(CRITICAL, "Not able to search the panel:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530420 panel_name);
Dhaval Patel019057a2014-08-12 13:52:25 -0700421 } else if (panel_override_id < UNKNOWN_PANEL) {
422 /* panel override using fastboot oem command */
423 panel_id = panel_override_id;
424
425 dprintf(INFO, "OEM panel override:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530426 panel_name);
Dhaval Patel019057a2014-08-12 13:52:25 -0700427 goto panel_init;
428 }
429 }
430
431 switch (hw_id) {
432 case HW_PLATFORM_MTP:
433 case HW_PLATFORM_FLUID:
434 case HW_PLATFORM_SURF:
435 panel_id = SHARP_WQXGA_DUALDSI_VIDEO_PANEL;
436 break;
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700437 case HW_PLATFORM_LIQUID:
438 panel_id = JDI_4K_DUALDSI_VIDEO_PANEL;
439 break;
Dhaval Patel019057a2014-08-12 13:52:25 -0700440 default:
441 dprintf(CRITICAL, "Display not enabled for %d HW type\n"
442 , hw_id);
443 return PANEL_TYPE_UNKNOWN;
444 }
445
446panel_init:
Ilia Lin45668192014-11-23 16:15:03 +0200447 if (panel_id == JDI_4K_DUALDSI_VIDEO_PANEL || panel_id == HX8379A_TRULY_FWVGA_VIDEO_PANEL)
Siddhartha Agrawalcddb0b82014-10-14 15:07:18 -0700448 phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE;
Dhaval Patel019057a2014-08-12 13:52:25 -0700449 return init_panel_data(panelstruct, pinfo, phy_db);
450}