blob: f792f699ac331e1292240adf53fab2ea9a10e2b9 [file] [log] [blame]
Aravind Venkateswaranc26bb602014-01-23 11:43:02 -08001/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
Arpita Banerjee841fa062013-05-24 14:59:51 -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>
31#include <err.h>
32#include <smem.h>
33#include <msm_panel.h>
34#include <board.h>
35#include <mipi_dsi.h>
36
37#include "include/panel.h"
38#include "panel_display.h"
39
40/*---------------------------------------------------------------------------*/
41/* GCDB Panel Database */
42/*---------------------------------------------------------------------------*/
43#include "include/panel_toshiba_720p_video.h"
44#include "include/panel_nt35590_720p_video.h"
45#include "include/panel_nt35590_720p_cmd.h"
Ray Zhang70abc542013-07-08 15:48:19 +080046#include "include/panel_hx8394a_720p_video.h"
Arpita Banerjeef04ae4b2013-06-14 11:32:20 -070047#include "include/panel_nt35596_1080p_video.h"
Ray Zhang53b0dce2013-07-08 19:35:48 +080048#include "include/panel_nt35521_720p_video.h"
Ray Zhange100ab62013-09-03 19:17:07 +080049#include "include/panel_ssd2080m_720p_video.h"
Aravind Venkateswaranaf241212013-11-04 16:46:46 -080050#include "include/panel_jdi_1080p_video.h"
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +053051#include "include/panel_nt35590_qvga_cmd.h"
Arpita Banerjee841fa062013-05-24 14:59:51 -070052
Pradeep Jilagamfeb15982013-10-29 13:08:51 +053053#define DISPLAY_MAX_PANEL_DETECTION 2
54
Ray Zhanga6df18c2013-12-04 16:21:50 +080055#define SSD2080M_720P_VIDEO_PANEL_ON_DELAY 200
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -080056#define MAX_PANEL_ID_LEN 64
Ray Zhanga6df18c2013-12-04 16:21:50 +080057
Arpita Banerjee841fa062013-05-24 14:59:51 -070058/*---------------------------------------------------------------------------*/
59/* static panel selection variable */
60/*---------------------------------------------------------------------------*/
61enum {
62TOSHIBA_720P_VIDEO_PANEL,
63NT35590_720P_CMD_PANEL,
Arpita Banerjeef04ae4b2013-06-14 11:32:20 -070064NT35590_720P_VIDEO_PANEL,
Ray Zhang70abc542013-07-08 15:48:19 +080065NT35596_1080P_VIDEO_PANEL,
Ray Zhang53b0dce2013-07-08 19:35:48 +080066HX8394A_720P_VIDEO_PANEL,
Ray Zhange100ab62013-09-03 19:17:07 +080067NT35521_720P_VIDEO_PANEL,
Aravind Venkateswaranaf241212013-11-04 16:46:46 -080068SSD2080M_720P_VIDEO_PANEL,
Pradeep Jilagamfeb15982013-10-29 13:08:51 +053069JDI_1080P_VIDEO_PANEL,
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +053070NT35590_QVGA_CMD_PANEL,
Pradeep Jilagamfeb15982013-10-29 13:08:51 +053071UNKNOWN_PANEL
Aravind Venkateswaranaf241212013-11-04 16:46:46 -080072};
73
74enum target_subtype {
75 HW_PLATFORM_SUBTYPE_720P = 0,
76 HW_PLATFORM_SUBTYPE_SKUAA = 1,
77 HW_PLATFORM_SUBTYPE_SKUF = 2,
78 HW_PLATFORM_SUBTYPE_1080P = 2,
79 HW_PLATFORM_SUBTYPE_SKUAB = 3,
Aravind Venkateswaranc26bb602014-01-23 11:43:02 -080080 HW_PLATFORM_SUBTYPE_1080P_EXT_BUCK = 3,
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +053081 HW_PLATFORM_SUBTYPE_QVGA = 4,
Aravind Venkateswaranaf241212013-11-04 16:46:46 -080082 HW_PLATFORM_SUBTYPE_SKUG = 5,
Arpita Banerjee841fa062013-05-24 14:59:51 -070083};
84
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -080085/*
86 * The list of panels that are supported on this target.
87 * Any panel in this list can be selected using fastboot oem command.
88 */
89static struct panel_list supp_panels[] = {
90 {"toshiba_720p_video", TOSHIBA_720P_VIDEO_PANEL},
91 {"nt35590_720p_cmd", NT35590_720P_CMD_PANEL},
92 {"nt35590_720p_video", NT35590_720P_VIDEO_PANEL},
93 {"nt35596_1080p_video", NT35596_1080P_VIDEO_PANEL},
94 {"hx8394a_720p_video", HX8394A_720P_VIDEO_PANEL},
95 {"nt35521_720p_video", NT35521_720P_VIDEO_PANEL},
96 {"ssd2080m_720p_video", SSD2080M_720P_VIDEO_PANEL},
97 {"jdi_1080p_video", JDI_1080P_VIDEO_PANEL},
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +053098 {"nt35590_qvga_cmd", NT35590_QVGA_CMD_PANEL},
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -080099};
100
Arpita Banerjee841fa062013-05-24 14:59:51 -0700101static uint32_t panel_id;
102
103int oem_panel_rotation()
104{
105 int ret = NO_ERROR;
106 switch (panel_id) {
107 case TOSHIBA_720P_VIDEO_PANEL:
108 ret = mipi_dsi_cmds_tx(toshiba_720p_video_rotation,
109 TOSHIBA_720P_VIDEO_ROTATION);
110 break;
111 case NT35590_720P_CMD_PANEL:
112 ret = mipi_dsi_cmds_tx(nt35590_720p_cmd_rotation,
113 NT35590_720P_CMD_ROTATION);
114 break;
115 case NT35590_720P_VIDEO_PANEL:
116 ret = mipi_dsi_cmds_tx(nt35590_720p_video_rotation,
117 NT35590_720P_VIDEO_ROTATION);
118 break;
119 }
120
121 return ret;
122}
123
Arpita Banerjee841fa062013-05-24 14:59:51 -0700124int oem_panel_on()
125{
126 /* OEM can keep there panel spefic on instructions in this
127 function */
Ray Zhanga6df18c2013-12-04 16:21:50 +0800128 if (panel_id == SSD2080M_720P_VIDEO_PANEL) {
129 /* SSD2080M needs extra delay to avoid unexpected artifacts */
130 mdelay(SSD2080M_720P_VIDEO_PANEL_ON_DELAY);
131 }
Arpita Banerjee841fa062013-05-24 14:59:51 -0700132 return NO_ERROR;
133}
134
135int oem_panel_off()
136{
137 /* OEM can keep there panel spefic off instructions in this
138 function */
139 return NO_ERROR;
140}
141
142static void init_panel_data(struct panel_struct *panelstruct,
143 struct msm_panel_info *pinfo,
144 struct mdss_dsi_phy_ctrl *phy_db)
145{
146 switch (panel_id) {
147 case TOSHIBA_720P_VIDEO_PANEL:
148 panelstruct->paneldata = &toshiba_720p_video_panel_data;
149 panelstruct->panelres = &toshiba_720p_video_panel_res;
150 panelstruct->color = &toshiba_720p_video_color;
151 panelstruct->videopanel = &toshiba_720p_video_video_panel;
152 panelstruct->commandpanel = &toshiba_720p_video_command_panel;
153 panelstruct->state = &toshiba_720p_video_state;
154 panelstruct->laneconfig = &toshiba_720p_video_lane_config;
155 panelstruct->paneltiminginfo
156 = &toshiba_720p_video_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700157 panelstruct->panelresetseq
158 = &toshiba_720p_video_panel_reset_seq;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700159 panelstruct->backlightinfo = &toshiba_720p_video_backlight;
160 pinfo->mipi.panel_cmds
161 = toshiba_720p_video_on_command;
162 pinfo->mipi.num_of_panel_cmds
163 = TOSHIBA_720P_VIDEO_ON_COMMAND;
164 memcpy(phy_db->timing,
165 toshiba_720p_video_timings, TIMING_SIZE);
166 break;
167 case NT35590_720P_VIDEO_PANEL:
168 panelstruct->paneldata = &nt35590_720p_video_panel_data;
169 panelstruct->panelres = &nt35590_720p_video_panel_res;
170 panelstruct->color = &nt35590_720p_video_color;
171 panelstruct->videopanel = &nt35590_720p_video_video_panel;
172 panelstruct->commandpanel = &nt35590_720p_video_command_panel;
173 panelstruct->state = &nt35590_720p_video_state;
174 panelstruct->laneconfig = &nt35590_720p_video_lane_config;
175 panelstruct->paneltiminginfo
176 = &nt35590_720p_video_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700177 panelstruct->panelresetseq
178 = &nt35590_720p_video_panel_reset_seq;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700179 panelstruct->backlightinfo = &nt35590_720p_video_backlight;
180 pinfo->mipi.panel_cmds
181 = nt35590_720p_video_on_command;
182 pinfo->mipi.num_of_panel_cmds
183 = NT35590_720P_VIDEO_ON_COMMAND;
184 memcpy(phy_db->timing,
185 nt35590_720p_video_timings, TIMING_SIZE);
186 break;
Ray Zhang53b0dce2013-07-08 19:35:48 +0800187 case NT35521_720P_VIDEO_PANEL:
188 panelstruct->paneldata = &nt35521_720p_video_panel_data;
189 panelstruct->panelres = &nt35521_720p_video_panel_res;
190 panelstruct->color = &nt35521_720p_video_color;
191 panelstruct->videopanel = &nt35521_720p_video_video_panel;
192 panelstruct->commandpanel = &nt35521_720p_video_command_panel;
193 panelstruct->state = &nt35521_720p_video_state;
194 panelstruct->laneconfig = &nt35521_720p_video_lane_config;
195 panelstruct->paneltiminginfo
196 = &nt35521_720p_video_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700197 panelstruct->panelresetseq
198 = &nt35521_720p_video_panel_reset_seq;
Ray Zhang53b0dce2013-07-08 19:35:48 +0800199 panelstruct->backlightinfo = &nt35521_720p_video_backlight;
200 pinfo->mipi.panel_cmds
201 = nt35521_720p_video_on_command;
202 pinfo->mipi.num_of_panel_cmds
203 = NT35521_720P_VIDEO_ON_COMMAND;
204 memcpy(phy_db->timing,
205 nt35521_720p_video_timings, TIMING_SIZE);
206 break;
Ray Zhange100ab62013-09-03 19:17:07 +0800207 case SSD2080M_720P_VIDEO_PANEL:
208 panelstruct->paneldata = &ssd2080m_720p_video_panel_data;
209 panelstruct->panelres = &ssd2080m_720p_video_panel_res;
210 panelstruct->color = &ssd2080m_720p_video_color;
211 panelstruct->videopanel = &ssd2080m_720p_video_video_panel;
212 panelstruct->commandpanel = &ssd2080m_720p_video_command_panel;
213 panelstruct->state = &ssd2080m_720p_video_state;
214 panelstruct->laneconfig = &ssd2080m_720p_video_lane_config;
215 panelstruct->paneltiminginfo
216 = &ssd2080m_720p_video_timing_info;
217 panelstruct->panelresetseq
218 = &ssd2080m_720p_video_panel_reset_seq;
219 panelstruct->backlightinfo = &ssd2080m_720p_video_backlight;
220 pinfo->mipi.panel_cmds
221 = ssd2080m_720p_video_on_command;
222 pinfo->mipi.num_of_panel_cmds
223 = SSD2080M_720P_VIDEO_ON_COMMAND;
224 memcpy(phy_db->timing,
225 ssd2080m_720p_video_timings, TIMING_SIZE);
226 break;
Ray Zhang70abc542013-07-08 15:48:19 +0800227 case HX8394A_720P_VIDEO_PANEL:
228 panelstruct->paneldata = &hx8394a_720p_video_panel_data;
229 panelstruct->panelres = &hx8394a_720p_video_panel_res;
230 panelstruct->color = &hx8394a_720p_video_color;
231 panelstruct->videopanel = &hx8394a_720p_video_video_panel;
232 panelstruct->commandpanel = &hx8394a_720p_video_command_panel;
233 panelstruct->state = &hx8394a_720p_video_state;
234 panelstruct->laneconfig = &hx8394a_720p_video_lane_config;
235 panelstruct->paneltiminginfo
236 = &hx8394a_720p_video_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700237 panelstruct->panelresetseq
238 = &hx8394a_720p_video_panel_reset_seq;
Ray Zhang70abc542013-07-08 15:48:19 +0800239 panelstruct->backlightinfo = &hx8394a_720p_video_backlight;
240 pinfo->mipi.panel_cmds
241 = hx8394a_720p_video_on_command;
242 pinfo->mipi.num_of_panel_cmds
243 = HX8394A_720P_VIDEO_ON_COMMAND;
244 memcpy(phy_db->timing,
245 hx8394a_720p_video_timings, TIMING_SIZE);
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530246 pinfo->mipi.signature = HX8394A_720P_VIDEO_SIGNATURE;
Ray Zhang70abc542013-07-08 15:48:19 +0800247 break;
248
Arpita Banerjee841fa062013-05-24 14:59:51 -0700249 case NT35590_720P_CMD_PANEL:
250 panelstruct->paneldata = &nt35590_720p_cmd_panel_data;
251 panelstruct->panelres = &nt35590_720p_cmd_panel_res;
252 panelstruct->color = &nt35590_720p_cmd_color;
253 panelstruct->videopanel = &nt35590_720p_cmd_video_panel;
254 panelstruct->commandpanel = &nt35590_720p_cmd_command_panel;
255 panelstruct->state = &nt35590_720p_cmd_state;
256 panelstruct->laneconfig = &nt35590_720p_cmd_lane_config;
257 panelstruct->paneltiminginfo = &nt35590_720p_cmd_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700258 panelstruct->panelresetseq
259 = &nt35590_720p_cmd_panel_reset_seq;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700260 panelstruct->backlightinfo = &nt35590_720p_cmd_backlight;
261 pinfo->mipi.panel_cmds
262 = nt35590_720p_cmd_on_command;
263 pinfo->mipi.num_of_panel_cmds
264 = NT35590_720P_CMD_ON_COMMAND;
265 memcpy(phy_db->timing,
266 nt35590_720p_cmd_timings, TIMING_SIZE);
267 break;
Arpita Banerjeef04ae4b2013-06-14 11:32:20 -0700268 case NT35596_1080P_VIDEO_PANEL:
269 panelstruct->paneldata = &nt35596_1080p_video_panel_data;
270 panelstruct->panelres = &nt35596_1080p_video_panel_res;
271 panelstruct->color = &nt35596_1080p_video_color;
272 panelstruct->videopanel = &nt35596_1080p_video_video_panel;
273 panelstruct->commandpanel = &nt35596_1080p_video_command_panel;
274 panelstruct->state = &nt35596_1080p_video_state;
275 panelstruct->laneconfig = &nt35596_1080p_video_lane_config;
276 panelstruct->paneltiminginfo
277 = &nt35596_1080p_video_timing_info;
Casey Piper5197f932013-08-14 17:27:29 -0700278 panelstruct->panelresetseq
279 = &nt35596_1080p_video_panel_reset_seq;
Arpita Banerjeef04ae4b2013-06-14 11:32:20 -0700280 panelstruct->backlightinfo
281 = &nt35596_1080p_video_backlight;
282 pinfo->mipi.panel_cmds
283 = nt35596_1080p_video_on_command;
284 pinfo->mipi.num_of_panel_cmds
285 = NT35596_1080P_VIDEO_ON_COMMAND;
286 memcpy(phy_db->timing,
287 nt35596_1080p_video_timings, TIMING_SIZE);
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530288 pinfo->mipi.signature = NT35596_1080P_VIDEO_SIGNATURE;
Jayant Shekhar24be5e62013-11-18 19:59:50 +0530289 break;
Aravind Venkateswaranaf241212013-11-04 16:46:46 -0800290 case JDI_1080P_VIDEO_PANEL:
291 panelstruct->paneldata = &jdi_1080p_video_panel_data;
292 panelstruct->paneldata->panel_with_enable_gpio = 1;
293 panelstruct->panelres = &jdi_1080p_video_panel_res;
294 panelstruct->color = &jdi_1080p_video_color;
295 panelstruct->videopanel = &jdi_1080p_video_video_panel;
296 panelstruct->commandpanel = &jdi_1080p_video_command_panel;
297 panelstruct->state = &jdi_1080p_video_state;
298 panelstruct->laneconfig = &jdi_1080p_video_lane_config;
299 panelstruct->paneltiminginfo
300 = &jdi_1080p_video_timing_info;
301 panelstruct->panelresetseq
302 = &jdi_1080p_video_panel_reset_seq;
303 panelstruct->backlightinfo = &jdi_1080p_video_backlight;
304 pinfo->mipi.panel_cmds
305 = jdi_1080p_video_on_command;
306 pinfo->mipi.num_of_panel_cmds
307 = JDI_1080P_VIDEO_ON_COMMAND;
308 memcpy(phy_db->timing,
309 jdi_1080p_video_timings, TIMING_SIZE);
Arpita Banerjeef04ae4b2013-06-14 11:32:20 -0700310 break;
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +0530311 case NT35590_QVGA_CMD_PANEL:
312 panelstruct->paneldata = &nt35590_qvga_cmd_panel_data;
313 panelstruct->panelres = &nt35590_qvga_cmd_panel_res;
314 panelstruct->color = &nt35590_qvga_cmd_color;
315 panelstruct->videopanel = &nt35590_qvga_cmd_video_panel;
316 panelstruct->commandpanel = &nt35590_qvga_cmd_command_panel;
317 panelstruct->state = &nt35590_qvga_cmd_state;
318 panelstruct->laneconfig = &nt35590_qvga_cmd_lane_config;
319 panelstruct->paneltiminginfo = &nt35590_qvga_cmd_timing_info;
320 panelstruct->panelresetseq
321 = &nt35590_qvga_cmd_panel_reset_seq;
322 panelstruct->backlightinfo = &nt35590_qvga_cmd_backlight;
323 pinfo->mipi.panel_cmds
324 = nt35590_qvga_cmd_on_command;
325 pinfo->mipi.num_of_panel_cmds
326 = NT35590_QVGA_CMD_ON_COMMAND;
327 memcpy(phy_db->timing,
328 nt35590_qvga_cmd_timings, TIMING_SIZE);
329 break;
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530330 case UNKNOWN_PANEL:
331 memset(panelstruct, 0, sizeof(struct panel_struct));
332 memset(pinfo->mipi.panel_cmds, 0, sizeof(struct mipi_dsi_cmd));
333 pinfo->mipi.num_of_panel_cmds = 0;
334 memset(phy_db->timing, 0, TIMING_SIZE);
335 pinfo->mipi.signature = 0;
336 break;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700337 }
338}
339
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530340uint32_t oem_panel_max_auto_detect_panels()
341{
342 return target_panel_auto_detect_enabled() ?
343 DISPLAY_MAX_PANEL_DETECTION : 0;
344}
345
346static uint32_t auto_pan_loop = 0;
347
Aravind Venkateswarand494f962014-02-25 17:16:49 -0800348bool oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
Arpita Banerjee841fa062013-05-24 14:59:51 -0700349 struct msm_panel_info *pinfo,
350 struct mdss_dsi_phy_ctrl *phy_db)
351{
352 uint32_t hw_id = board_hardware_id();
Ray Zhang70abc542013-07-08 15:48:19 +0800353 uint32_t target_id = board_target_id();
Aravind Venkateswaran9ae369b2013-07-23 22:57:47 -0700354 uint32_t nt35590_panel_id = NT35590_720P_VIDEO_PANEL;
Aravind Venkateswaranaf241212013-11-04 16:46:46 -0800355 uint32_t hw_subtype = board_hardware_subtype();
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530356 bool ret = true;
Dhaval Patelf6dd5772014-02-18 17:10:16 -0800357 int32_t panel_override_id;
Aravind Venkateswaran9ae369b2013-07-23 22:57:47 -0700358
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -0800359 if (panel_name) {
Dhaval Patelf6dd5772014-02-18 17:10:16 -0800360 panel_override_id = panel_name_to_id(supp_panels,
361 ARRAY_SIZE(supp_panels), panel_name);
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -0800362
Dhaval Patelf6dd5772014-02-18 17:10:16 -0800363 if (panel_override_id < 0) {
364 dprintf(CRITICAL, "Not able to search the panel:%s\n",
365 panel_name + strspn(panel_name, " "));
366 } else if (panel_override_id < UNKNOWN_PANEL) {
367 /* panel override using fastboot oem command */
368 panel_id = panel_override_id;
369
370 dprintf(INFO, "OEM panel override:%s\n",
371 panel_name + strspn(panel_name, " "));
372 goto panel_init;
373 }
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -0800374 }
Arpita Banerjee841fa062013-05-24 14:59:51 -0700375
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700376 switch (hw_id) {
377 case HW_PLATFORM_QRD:
Aravind Venkateswaranaf241212013-11-04 16:46:46 -0800378 if (hw_subtype == HW_PLATFORM_SUBTYPE_SKUF) {
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700379 panel_id = NT35521_720P_VIDEO_PANEL;
Aravind Venkateswaranaf241212013-11-04 16:46:46 -0800380 } else if (hw_subtype == HW_PLATFORM_SUBTYPE_SKUG) {
Ray Zhange100ab62013-09-03 19:17:07 +0800381 panel_id = SSD2080M_720P_VIDEO_PANEL;
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700382 } else {
Kun Liang6bff57d2013-09-29 18:27:23 +0800383 if (((target_id >> 16) & 0xFF) == 0x1 || ((target_id >> 16) & 0xFF) == 0x3) //EVT || PVT
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700384 panel_id = nt35590_panel_id;
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530385 else if (((target_id >> 16) & 0xFF) == 0x2) { //DVT
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700386 panel_id = HX8394A_720P_VIDEO_PANEL;
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530387 switch (auto_pan_loop) {
388 case 0:
389 panel_id = HX8394A_720P_VIDEO_PANEL;
390 break;
391 case 1:
392 panel_id = NT35596_1080P_VIDEO_PANEL;
393 break;
394 default:
395 panel_id = UNKNOWN_PANEL;
396 ret = false;
397 dprintf(CRITICAL, "Unknown panel\n");
398 return ret;
399 }
400 auto_pan_loop++;
401 }
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700402 else {
403 dprintf(CRITICAL, "Not supported device, target_id=%x\n"
404 , target_id);
405 return false;
406 }
Arpita Banerjee841fa062013-05-24 14:59:51 -0700407 }
408 break;
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700409 case HW_PLATFORM_MTP:
410 case HW_PLATFORM_SURF:
Aravind Venkateswaranc26bb602014-01-23 11:43:02 -0800411 if ((hw_subtype == HW_PLATFORM_SUBTYPE_1080P) ||
412 (hw_subtype == HW_PLATFORM_SUBTYPE_1080P_EXT_BUCK))
Aravind Venkateswaranaf241212013-11-04 16:46:46 -0800413 panel_id = JDI_1080P_VIDEO_PANEL;
Shivaraj Shetty11b10eb2014-03-20 16:50:22 +0530414 else if (hw_subtype == HW_PLATFORM_SUBTYPE_QVGA)
415 panel_id = NT35590_QVGA_CMD_PANEL;
Aravind Venkateswaranc26bb602014-01-23 11:43:02 -0800416 else
Jayant Shekhareb6e0872013-12-23 22:39:35 +0530417 panel_id = nt35590_panel_id;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700418 break;
Dhaval Patele4ef9442013-07-16 12:35:56 -0700419 default:
Dhaval Patelfa5d5872013-08-08 10:52:16 -0700420 dprintf(CRITICAL, "Display not enabled for %d HW type\n"
421 , hw_id);
Dhaval Patele4ef9442013-07-16 12:35:56 -0700422 return false;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700423 }
424
Aravind Venkateswaran6bfb29e2014-02-12 12:31:44 -0800425panel_init:
Arpita Banerjee841fa062013-05-24 14:59:51 -0700426 init_panel_data(panelstruct, pinfo, phy_db);
427
Pradeep Jilagamfeb15982013-10-29 13:08:51 +0530428 return ret;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700429}