blob: d990f4584620b945fa0681bca5ec1bbd357527a2 [file] [log] [blame]
Jayant Shekhar9c0533e2016-01-28 11:17:18 +05301/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -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 <string.h>
32#include <err.h>
33#include <smem.h>
34#include <msm_panel.h>
35#include <board.h>
feifanz525046b2015-06-01 20:31:06 +080036#include <qtimer.h>
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -070037#include <mipi_dsi.h>
Sandeep Pandaed082922015-08-03 12:18:25 +053038#include <mdp5.h>
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -070039#include <target/display.h>
40
Ujwal Patel41a665a2015-07-17 13:51:30 -070041#include "gcdb_display.h"
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -070042#include "include/panel.h"
43#include "panel_display.h"
44
45/*---------------------------------------------------------------------------*/
46/* GCDB Panel Database */
47/*---------------------------------------------------------------------------*/
48#include "include/panel_truly_1080p_video.h"
Jayant Shekhar9ea8dcd2015-04-20 15:18:37 +053049#include "include/panel_truly_1080p_cmd.h"
feifanz174c82c2015-04-15 18:57:07 +080050#include "include/panel_otm1906c_1080p_cmd.h"
Vishnuvardhan Prodduturi16eb20f2015-06-05 18:03:54 +053051#include "include/panel_sharp_1080p_cmd.h"
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +053052#include "include/panel_nt35597_wqxga_dualdsi_video.h"
Vishnuvardhan Prodduturic1a46c52015-06-29 16:35:23 +053053#include "include/panel_nt35597_wqxga_dualdsi_cmd.h"
Ray Zhangf95f5b92015-06-25 15:34:29 +080054#include "include/panel_hx8399a_1080p_video.h"
Sandeep Pandaed082922015-08-03 12:18:25 +053055#include "include/panel_nt35597_wqxga_dsc_video.h"
56#include "include/panel_nt35597_wqxga_dsc_cmd.h"
Padmanabhan Komanduru4927c2c2015-08-21 14:55:16 +053057#include "include/panel_hx8394d_720p_video.h"
Sujeev Dias6bc9fa32015-08-03 23:13:44 -070058#include "include/panel_byd_1200p_video.h"
Ray Zhang4bbc7b02015-12-04 16:07:20 +080059#include "include/panel_r69006_1080p_cmd.h"
60#include "include/panel_r69006_1080p_video.h"
61#include "include/panel_hx8394f_720p_video.h"
Padmanabhan Komandurue108ed02015-12-21 12:43:07 +053062#include "include/panel_truly_720p_video.h"
Padmanabhan Komanduru7460e442016-01-21 12:30:34 +053063#include "include/panel_truly_wuxga_video.h"
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -070064
65/*---------------------------------------------------------------------------*/
66/* static panel selection variable */
67/*---------------------------------------------------------------------------*/
68enum {
69 TRULY_1080P_VIDEO_PANEL,
Jayant Shekhar9ea8dcd2015-04-20 15:18:37 +053070 TRULY_1080P_CMD_PANEL,
feifanz174c82c2015-04-15 18:57:07 +080071 OTM1906C_1080P_CMD_PANEL,
Vishnuvardhan Prodduturi16eb20f2015-06-05 18:03:54 +053072 SHARP_1080P_CMD_PANEL,
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +053073 NT35597_WQXGA_DUALDSI_VIDEO_PANEL,
Vishnuvardhan Prodduturic1a46c52015-06-29 16:35:23 +053074 NT35597_WQXGA_DUALDSI_CMD_PANEL,
Ray Zhangf95f5b92015-06-25 15:34:29 +080075 HX8399A_1080P_VIDEO_PANEL,
Sandeep Pandaed082922015-08-03 12:18:25 +053076 NT35597_WQXGA_DSC_VIDEO_PANEL,
77 NT35597_WQXGA_DSC_CMD_PANEL,
Padmanabhan Komanduru4927c2c2015-08-21 14:55:16 +053078 HX8394D_720P_VIDEO_PANEL,
Sujeev Dias6bc9fa32015-08-03 23:13:44 -070079 BYD_1200P_VIDEO_PANEL,
Ray Zhang4bbc7b02015-12-04 16:07:20 +080080 R69006_1080P_CMD_PANEL,
81 R69006_1080P_VIDEO_PANEL,
82 HX8394F_720P_VIDEO_PANEL,
Padmanabhan Komandurue108ed02015-12-21 12:43:07 +053083 TRULY_720P_VIDEO_PANEL,
Padmanabhan Komanduru7460e442016-01-21 12:30:34 +053084 TRULY_WUXGA_VIDEO_PANEL,
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -070085 UNKNOWN_PANEL
86};
87
88uint32_t panel_regulator_settings[] = {
89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
90};
91
92/*
93 * The list of panels that are supported on this target.
94 * Any panel in this list can be selected using fastboot oem command.
95 */
96static struct panel_list supp_panels[] = {
97 {"truly_1080p_video", TRULY_1080P_VIDEO_PANEL},
Jayant Shekhar9ea8dcd2015-04-20 15:18:37 +053098 {"truly_1080p_cmd", TRULY_1080P_CMD_PANEL},
Vishnuvardhan Prodduturi16eb20f2015-06-05 18:03:54 +053099 {"sharp_1080p_cmd", SHARP_1080P_CMD_PANEL},
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530100 {"nt35597_wqxga_dualdsi_video", NT35597_WQXGA_DUALDSI_VIDEO_PANEL},
Vishnuvardhan Prodduturic1a46c52015-06-29 16:35:23 +0530101 {"nt35597_wqxga_dualdsi_cmd", NT35597_WQXGA_DUALDSI_CMD_PANEL},
Ray Zhangf95f5b92015-06-25 15:34:29 +0800102 {"otm1906c_1080p_cmd", OTM1906C_1080P_CMD_PANEL},
103 {"hx8399a_1080p_video", HX8399A_1080P_VIDEO_PANEL},
Sandeep Pandaed082922015-08-03 12:18:25 +0530104 {"nt35597_wqxga_dsc_video", NT35597_WQXGA_DSC_VIDEO_PANEL},
105 {"nt35597_wqxga_dsc_cmd", NT35597_WQXGA_DSC_CMD_PANEL},
Padmanabhan Komanduru4927c2c2015-08-21 14:55:16 +0530106 {"hx8394d_720p_video", HX8394D_720P_VIDEO_PANEL},
Sujeev Dias6bc9fa32015-08-03 23:13:44 -0700107 {"byd_1200p_video", BYD_1200P_VIDEO_PANEL},
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800108 {"r69006_1080p_cmd",R69006_1080P_CMD_PANEL},
109 {"r69006_1080p_video",R69006_1080P_VIDEO_PANEL},
Padmanabhan Komandurue108ed02015-12-21 12:43:07 +0530110 {"hx8394f_720p_video", HX8394F_720P_VIDEO_PANEL},
Padmanabhan Komanduru7460e442016-01-21 12:30:34 +0530111 {"truly_720p_video", TRULY_720P_VIDEO_PANEL},
112 {"truly_wuxga_video", TRULY_WUXGA_VIDEO_PANEL}
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700113};
114
115static uint32_t panel_id;
116
Sandeep Panda75fddaa2015-07-06 11:38:25 +0530117#define TRULY_1080P_PANEL_ON_DELAY 40
Sandeep Pandac797d542015-06-12 14:37:55 +0530118
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700119int oem_panel_rotation()
120{
121 return NO_ERROR;
122}
123
124int oem_panel_on()
125{
126 /*
127 *OEM can keep their panel specific on instructions in this
128 *function
feifanz525046b2015-06-01 20:31:06 +0800129 */
130 if (panel_id == OTM1906C_1080P_CMD_PANEL) {
131 /* needs extra delay to avoid unexpected artifacts */
132 mdelay(OTM1906C_1080P_CMD_PANEL_ON_DELAY);
Sandeep Panda75fddaa2015-07-06 11:38:25 +0530133 } else if (panel_id == TRULY_1080P_CMD_PANEL ||
134 panel_id == TRULY_1080P_VIDEO_PANEL) {
135 mdelay(TRULY_1080P_PANEL_ON_DELAY);
Ray Zhang6ec437c2015-12-04 16:08:08 +0800136 }else if (panel_id == R69006_1080P_CMD_PANEL) {
137 mdelay(R69006_1080P_CMD_PANEL_ON_DELAY);
feifanz525046b2015-06-01 20:31:06 +0800138 }
Sandeep Pandac797d542015-06-12 14:37:55 +0530139
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700140 return NO_ERROR;
141}
142
143int oem_panel_off()
144{
145 /* OEM can keep their panel specific off instructions
146 * in this function
147 */
148 return NO_ERROR;
149}
150
151static int init_panel_data(struct panel_struct *panelstruct,
152 struct msm_panel_info *pinfo,
153 struct mdss_dsi_phy_ctrl *phy_db)
154{
155 int pan_type = PANEL_TYPE_DSI;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700156 struct oem_panel_data *oem_data = mdss_dsi_get_oem_data_ptr();
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700157
158 switch (panel_id) {
159 case TRULY_1080P_VIDEO_PANEL:
160 panelstruct->paneldata = &truly_1080p_video_panel_data;
161 panelstruct->paneldata->panel_with_enable_gpio = 1;
162 panelstruct->panelres = &truly_1080p_video_panel_res;
163 panelstruct->color = &truly_1080p_video_color;
164 panelstruct->videopanel = &truly_1080p_video_video_panel;
165 panelstruct->commandpanel = &truly_1080p_video_command_panel;
166 panelstruct->state = &truly_1080p_video_state;
167 panelstruct->laneconfig = &truly_1080p_video_lane_config;
168 panelstruct->paneltiminginfo
169 = &truly_1080p_video_timing_info;
170 panelstruct->panelresetseq
171 = &truly_1080p_video_panel_reset_seq;
172 panelstruct->backlightinfo = &truly_1080p_video_backlight;
173 pinfo->mipi.panel_on_cmds
174 = truly_1080p_video_on_command;
175 pinfo->mipi.num_of_panel_on_cmds
176 = TRULY_1080P_VIDEO_ON_COMMAND;
177 pinfo->mipi.panel_off_cmds
178 = truly_1080p_video_off_command;
179 pinfo->mipi.num_of_panel_off_cmds
180 = TRULY_1080P_VIDEO_OFF_COMMAND;
181 memcpy(phy_db->timing,
182 truly_1080p_video_timings, TIMING_SIZE);
183 pinfo->mipi.signature = TRULY_1080P_VIDEO_SIGNATURE;
184 break;
Jayant Shekhar9ea8dcd2015-04-20 15:18:37 +0530185 case TRULY_1080P_CMD_PANEL:
186 panelstruct->paneldata = &truly_1080p_cmd_panel_data;
187 panelstruct->paneldata->panel_with_enable_gpio = 1;
188 panelstruct->panelres = &truly_1080p_cmd_panel_res;
189 panelstruct->color = &truly_1080p_cmd_color;
190 panelstruct->videopanel = &truly_1080p_cmd_video_panel;
191 panelstruct->commandpanel = &truly_1080p_cmd_command_panel;
192 panelstruct->state = &truly_1080p_cmd_state;
193 panelstruct->laneconfig = &truly_1080p_cmd_lane_config;
194 panelstruct->paneltiminginfo
195 = &truly_1080p_cmd_timing_info;
196 panelstruct->panelresetseq
197 = &truly_1080p_cmd_panel_reset_seq;
198 panelstruct->backlightinfo = &truly_1080p_cmd_backlight;
199 pinfo->mipi.panel_on_cmds
200 = truly_1080p_cmd_on_command;
201 pinfo->mipi.num_of_panel_on_cmds
202 = TRULY_1080P_CMD_ON_COMMAND;
203 pinfo->mipi.panel_off_cmds
204 = truly_1080p_cmd_off_command;
205 pinfo->mipi.num_of_panel_off_cmds
206 = TRULY_1080P_CMD_OFF_COMMAND;
207 memcpy(phy_db->timing,
208 truly_1080p_cmd_timings, TIMING_SIZE);
209 pinfo->mipi.signature = TRULY_1080P_CMD_SIGNATURE;
210 break;
feifanz174c82c2015-04-15 18:57:07 +0800211 case OTM1906C_1080P_CMD_PANEL:
212 panelstruct->paneldata = &otm1906c_1080p_cmd_panel_data;
213 panelstruct->paneldata->panel_with_enable_gpio = 1;
214 panelstruct->panelres = &otm1906c_1080p_cmd_panel_res;
215 panelstruct->color = &otm1906c_1080p_cmd_color;
216 panelstruct->videopanel = &otm1906c_1080p_cmd_video_panel;
217 panelstruct->commandpanel = &otm1906c_1080p_cmd_command_panel;
218 panelstruct->state = &otm1906c_1080p_cmd_state;
219 panelstruct->laneconfig = &otm1906c_1080p_cmd_lane_config;
220 panelstruct->paneltiminginfo
221 = &otm1906c_1080p_cmd_timing_info;
222 panelstruct->panelresetseq
223 = &otm1906c_1080p_cmd_panel_reset_seq;
224 panelstruct->backlightinfo = &otm1906c_1080p_cmd_backlight;
225 pinfo->mipi.panel_on_cmds
226 = otm1906c_1080p_cmd_on_command;
227 pinfo->mipi.num_of_panel_on_cmds
228 = OTM1906C_1080P_CMD_ON_COMMAND;
229 pinfo->mipi.panel_off_cmds
230 = otm1906c_1080p_cmd_off_command;
231 pinfo->mipi.num_of_panel_off_cmds
232 = OTM1906C_1080P_CMD_OFF_COMMAND;
233 memcpy(phy_db->timing,
234 otm1906c_1080p_cmd_timings, TIMING_SIZE);
235 pinfo->mipi.signature = OTM1906C_1080P_CMD_SIGNATURE;
236 break;
Ray Zhangf95f5b92015-06-25 15:34:29 +0800237 case HX8399A_1080P_VIDEO_PANEL:
238 panelstruct->paneldata = &hx8399a_1080p_video_panel_data;
239 panelstruct->panelres = &hx8399a_1080p_video_panel_res;
240 panelstruct->color = &hx8399a_1080p_video_color;
241 panelstruct->videopanel = &hx8399a_1080p_video_video_panel;
242 panelstruct->commandpanel = &hx8399a_1080p_video_command_panel;
243 panelstruct->state = &hx8399a_1080p_video_state;
244 panelstruct->laneconfig = &hx8399a_1080p_video_lane_config;
245 panelstruct->paneltiminginfo
246 = &hx8399a_1080p_video_timing_info;
247 panelstruct->panelresetseq
248 = &hx8399a_1080p_video_reset_seq;
249 panelstruct->backlightinfo = &hx8399a_1080p_video_backlight;
250 pinfo->mipi.panel_on_cmds
251 = hx8399a_1080p_video_on_command;
252 pinfo->mipi.num_of_panel_on_cmds
253 = HX8399A_1080P_VIDEO_ON_COMMAND;
254 pinfo->mipi.panel_off_cmds
255 = hx8399a_1080p_video_off_command;
256 pinfo->mipi.num_of_panel_off_cmds
257 = HX8399A_1080P_VIDEO_OFF_COMMAND;
258 memcpy(phy_db->timing,
259 hx8399a_1080p_video_timings, TIMING_SIZE);
260 pinfo->mipi.signature = HX8399A_1080P_VIDEO_SIGNATURE;
261 break;
Vishnuvardhan Prodduturi16eb20f2015-06-05 18:03:54 +0530262 case SHARP_1080P_CMD_PANEL:
263 panelstruct->paneldata = &sharp_1080p_cmd_panel_data;
264 panelstruct->panelres = &sharp_1080p_cmd_panel_res;
265 panelstruct->paneldata->panel_with_enable_gpio = 1;
266 panelstruct->color = &sharp_1080p_cmd_color;
267 panelstruct->videopanel = &sharp_1080p_cmd_video_panel;
268 panelstruct->commandpanel = &sharp_1080p_cmd_command_panel;
269 panelstruct->state = &sharp_1080p_cmd_state;
270 panelstruct->laneconfig = &sharp_1080p_cmd_lane_config;
271 panelstruct->paneltiminginfo
272 = &sharp_1080p_cmd_timing_info;
273 panelstruct->panelresetseq
274 = &sharp_1080p_cmd_panel_reset_seq;
275 panelstruct->backlightinfo = &sharp_1080p_cmd_backlight;
276 pinfo->mipi.panel_on_cmds
277 = sharp_1080p_cmd_on_command;
278 pinfo->mipi.num_of_panel_on_cmds
279 = SHARP_1080P_CMD_ON_COMMAND;
280 pinfo->mipi.panel_off_cmds
281 = sharp_1080p_cmd_off_command;
282 pinfo->mipi.num_of_panel_off_cmds
283 = SHARP_1080P_CMD_OFF_COMMAND;
284 memcpy(phy_db->timing,
285 sharp_1080p_cmd_timings, TIMING_SIZE);
286 break;
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530287 case NT35597_WQXGA_DUALDSI_VIDEO_PANEL:
288 panelstruct->paneldata = &nt35597_wqxga_dualdsi_video_panel_data;
289 panelstruct->paneldata->panel_operating_mode = DST_SPLIT_FLAG |
290 SPLIT_DISPLAY_FLAG | DUAL_DSI_FLAG;
291 panelstruct->paneldata->panel_with_enable_gpio = 0;
292
293 panelstruct->panelres = &nt35597_wqxga_dualdsi_video_panel_res;
294 panelstruct->color = &nt35597_wqxga_dualdsi_video_color;
295 panelstruct->videopanel = &nt35597_wqxga_dualdsi_video_video_panel;
296 panelstruct->commandpanel = &nt35597_wqxga_dualdsi_video_command_panel;
297 panelstruct->state = &nt35597_wqxga_dualdsi_video_state;
298 panelstruct->laneconfig = &nt35597_wqxga_dualdsi_video_lane_config;
299 panelstruct->paneltiminginfo
300 = &nt35597_wqxga_dualdsi_video_timing_info;
301 panelstruct->panelresetseq
302 = &nt35597_wqxga_dualdsi_video_reset_seq;
303 panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_video_backlight;
304 pinfo->labibb = &nt35597_wqxga_dualdsi_video_labibb;
305
306 pinfo->mipi.panel_on_cmds
307 = nt35597_wqxga_dualdsi_video_on_command;
308 pinfo->mipi.num_of_panel_on_cmds
309 = NT35597_WQXGA_DUALDSI_VIDEO_ON_COMMAND;
310 pinfo->mipi.panel_off_cmds
311 = nt35597_wqxga_dualdsi_video_off_command;
312 pinfo->mipi.num_of_panel_off_cmds
313 = NT35597_WQXGA_DUALDSI_VIDEO_OFF_COMMAND;
314 memcpy(phy_db->timing, nt35597_wqxga_dualdsi_video_timings,
315 TIMING_SIZE);
316 pinfo->mipi.tx_eot_append = true;
317 break;
Vishnuvardhan Prodduturic1a46c52015-06-29 16:35:23 +0530318 case NT35597_WQXGA_DUALDSI_CMD_PANEL:
319 panelstruct->paneldata = &nt35597_wqxga_dualdsi_cmd_panel_data;
320 panelstruct->paneldata->panel_operating_mode = DST_SPLIT_FLAG |
321 SPLIT_DISPLAY_FLAG | DUAL_DSI_FLAG;
322 panelstruct->paneldata->panel_with_enable_gpio = 0;
323
324 panelstruct->panelres = &nt35597_wqxga_dualdsi_cmd_panel_res;
325 panelstruct->color = &nt35597_wqxga_dualdsi_cmd_color;
326 panelstruct->videopanel = &nt35597_wqxga_dualdsi_cmd_video_panel;
327 panelstruct->commandpanel = &nt35597_wqxga_dualdsi_cmd_command_panel;
328 panelstruct->state = &nt35597_wqxga_dualdsi_cmd_state;
329 panelstruct->laneconfig = &nt35597_wqxga_dualdsi_cmd_lane_config;
330 panelstruct->paneltiminginfo
331 = &nt35597_wqxga_dualdsi_cmd_timing_info;
Padmanabhan Komanduru58fc57e2015-07-07 21:36:14 +0530332 /* Clkout timings are different for this panel on 8956 */
333 panelstruct->paneltiminginfo->tclk_post = 0x2b;
334 panelstruct->paneltiminginfo->tclk_pre = 0x28;
Vishnuvardhan Prodduturic1a46c52015-06-29 16:35:23 +0530335 panelstruct->panelresetseq
336 = &nt35597_wqxga_dualdsi_cmd_reset_seq;
337 panelstruct->backlightinfo = &nt35597_wqxga_dualdsi_cmd_backlight;
338
339 pinfo->labibb = &nt35597_wqxga_dualdsi_cmd_labibb;
340
341 pinfo->mipi.panel_on_cmds
342 = nt35597_wqxga_dualdsi_cmd_on_command;
343 pinfo->mipi.num_of_panel_on_cmds
344 = NT35597_WQXGA_DUALDSI_CMD_ON_COMMAND;
345 pinfo->mipi.panel_off_cmds
346 = nt35597_wqxga_dualdsi_cmd_off_command;
347 pinfo->mipi.num_of_panel_off_cmds
348 = NT35597_WQXGA_DUALDSI_CMD_OFF_COMMAND;
349 memcpy(phy_db->timing, nt35597_wqxga_dualdsi_cmd_timings,
350 TIMING_SIZE);
351 pinfo->mipi.tx_eot_append = true;
352 break;
Sandeep Pandaed082922015-08-03 12:18:25 +0530353 case NT35597_WQXGA_DSC_VIDEO_PANEL:
354 panelstruct->paneldata = &nt35597_wqxga_dsc_video_panel_data;
355 panelstruct->paneldata->panel_with_enable_gpio = 0;
356 panelstruct->paneldata->panel_operating_mode = USE_DSI1_PLL_FLAG;
357 panelstruct->panelres = &nt35597_wqxga_dsc_video_panel_res;
358 panelstruct->color = &nt35597_wqxga_dsc_video_color;
359 panelstruct->videopanel = &nt35597_wqxga_dsc_video_video_panel;
360 panelstruct->commandpanel = &nt35597_wqxga_dsc_video_command_panel;
361 panelstruct->state = &nt35597_wqxga_dsc_video_state;
362 panelstruct->laneconfig = &nt35597_wqxga_dsc_video_lane_config;
363 panelstruct->paneltiminginfo
364 = &nt35597_wqxga_dsc_video_timing_info;
365 panelstruct->panelresetseq
366 = &nt35597_wqxga_dsc_video_reset_seq;
367 panelstruct->backlightinfo = &nt35597_wqxga_dsc_video_backlight;
368 pinfo->labibb = &nt35597_wqxga_dsc_video_labibb;
369
370 pinfo->mipi.panel_on_cmds
371 = nt35597_wqxga_dsc_video_on_command;
372 pinfo->mipi.num_of_panel_on_cmds
373 = NT35597_WQXGA_DSC_VIDEO_ON_COMMAND;
374 pinfo->mipi.panel_off_cmds
375 = nt35597_wqxga_dsc_video_off_command;
376 pinfo->mipi.num_of_panel_off_cmds
377 = NT35597_WQXGA_DSC_VIDEO_OFF_COMMAND;
378 memcpy(phy_db->timing, nt35597_wqxga_dsc_video_timings,
379 TIMING_SIZE);
380 /* Clkout timings are different for this panel on 8956 */
381 panelstruct->paneltiminginfo->tclk_post = 0x04;
382 panelstruct->paneltiminginfo->tclk_pre = 0x20;
383 pinfo->mipi.tx_eot_append = true;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700384
385 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
386 panelstruct->config = &nt35597_wqxga_dsc_video_config0;
387 if (oem_data) {
388 switch (oem_data->cfg_num[0]) {
389 case -1: /* default */
390 case 0:
391 panelstruct->config =
392 &nt35597_wqxga_dsc_video_config0;
393 break;
394 default:
395 dprintf(CRITICAL, "topology config%d not supported. fallback to default config0\n",
396 oem_data->cfg_num[0]);
397 panelstruct->config = &nt35597_wqxga_dsc_video_config0;
398 }
399 }
400 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
401 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
402 pinfo->num_dsc_enc = panelstruct->config->num_dsc_enc;
Sandeep Pandaed082922015-08-03 12:18:25 +0530403 pinfo->compression_mode = COMPRESSION_DSC;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700404
Sandeep Pandaed082922015-08-03 12:18:25 +0530405 pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc;
406 pinfo->dsc.dsc2buf = mdss_dsc_to_buf;
407 pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config;
408 pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config;
409 break;
410 case NT35597_WQXGA_DSC_CMD_PANEL:
411 panelstruct->paneldata = &nt35597_wqxga_dsc_cmd_panel_data;
412 panelstruct->paneldata->panel_with_enable_gpio = 0;
413 panelstruct->paneldata->panel_operating_mode = USE_DSI1_PLL_FLAG;
414 panelstruct->panelres = &nt35597_wqxga_dsc_cmd_panel_res;
415 panelstruct->color = &nt35597_wqxga_dsc_cmd_color;
416 panelstruct->videopanel = &nt35597_wqxga_dsc_cmd_video_panel;
417 panelstruct->commandpanel = &nt35597_wqxga_dsc_cmd_command_panel;
418 panelstruct->state = &nt35597_wqxga_dsc_cmd_state;
419 panelstruct->laneconfig = &nt35597_wqxga_dsc_cmd_lane_config;
420 panelstruct->paneltiminginfo
421 = &nt35597_wqxga_dsc_cmd_timing_info;
422 panelstruct->panelresetseq
423 = &nt35597_wqxga_dsc_cmd_reset_seq;
424 panelstruct->backlightinfo = &nt35597_wqxga_dsc_cmd_backlight;
425 pinfo->labibb = &nt35597_wqxga_dsc_cmd_labibb;
426
427 pinfo->mipi.panel_on_cmds
428 = nt35597_wqxga_dsc_cmd_on_command;
429 pinfo->mipi.num_of_panel_on_cmds
430 = NT35597_WQXGA_DSC_CMD_ON_COMMAND;
431 pinfo->mipi.panel_off_cmds
432 = nt35597_wqxga_dsc_cmd_off_command;
433 pinfo->mipi.num_of_panel_off_cmds
434 = NT35597_WQXGA_DSC_CMD_OFF_COMMAND;
435 memcpy(phy_db->timing, nt35597_wqxga_dsc_cmd_timings,
436 TIMING_SIZE);
437 /* Clkout timings are different for this panel on 8956 */
438 panelstruct->paneltiminginfo->tclk_post = 0x04;
439 panelstruct->paneltiminginfo->tclk_pre = 0x20;
440 pinfo->mipi.tx_eot_append = true;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700441
442 panelstruct->paneldata->panel_operating_mode &= ~DUAL_PIPE_FLAG;
443 panelstruct->config = &nt35597_wqxga_dsc_cmd_config0;
444 if (oem_data) {
445 switch (oem_data->cfg_num[0]) {
446 case -1: /* default */
447 case 0:
448 panelstruct->config =
449 &nt35597_wqxga_dsc_cmd_config0;
450 break;
451 default:
452 dprintf(CRITICAL, "topology config%d not supported. fallback to default config0\n",
453 oem_data->cfg_num[0]);
454 panelstruct->config = &nt35597_wqxga_dsc_cmd_config0;
455 }
456 }
457 pinfo->lm_split[0] = panelstruct->config->lm_split[0];
458 pinfo->lm_split[1] = panelstruct->config->lm_split[1];
459 pinfo->num_dsc_enc = panelstruct->config->num_dsc_enc;
Sandeep Pandaed082922015-08-03 12:18:25 +0530460 pinfo->compression_mode = COMPRESSION_DSC;
Ujwal Patel41a665a2015-07-17 13:51:30 -0700461
Sandeep Pandaed082922015-08-03 12:18:25 +0530462 pinfo->dsc.parameter_calc = mdss_dsc_parameters_calc;
463 pinfo->dsc.dsc2buf = mdss_dsc_to_buf;
464 pinfo->dsc.dsi_dsc_config = mdss_dsc_dsi_config;
465 pinfo->dsc.mdp_dsc_config = mdss_dsc_mdp_config;
466 break;
Padmanabhan Komanduru4927c2c2015-08-21 14:55:16 +0530467 case HX8394D_720P_VIDEO_PANEL:
468 panelstruct->paneldata = &hx8394d_720p_video_panel_data;
469 panelstruct->panelres = &hx8394d_720p_video_panel_res;
470 panelstruct->color = &hx8394d_720p_video_color;
471 panelstruct->videopanel = &hx8394d_720p_video_video_panel;
472 panelstruct->commandpanel = &hx8394d_720p_video_command_panel;
473 panelstruct->state = &hx8394d_720p_video_state;
474 panelstruct->laneconfig = &hx8394d_720p_video_lane_config;
475 panelstruct->paneltiminginfo
476 = &hx8394d_720p_video_timing_info;
477 panelstruct->panelresetseq
478 = &hx8394d_720p_video_panel_reset_seq;
479 panelstruct->backlightinfo = &hx8394d_720p_video_backlight;
480 pinfo->mipi.panel_on_cmds
481 = hx8394d_720p_video_on_command;
482 pinfo->mipi.num_of_panel_on_cmds
483 = HX8394D_720P_VIDEO_ON_COMMAND;
484 pinfo->mipi.panel_off_cmds
485 = hx8394d_720p_video_off_command;
486 pinfo->mipi.num_of_panel_off_cmds
487 = HX8394D_720P_VIDEO_OFF_COMMAND;
488 memcpy(phy_db->timing,
489 hx8394d_720p_video_timings, TIMING_SIZE);
490 pinfo->mipi.signature = HX8394D_720P_VIDEO_SIGNATURE;
491 break;
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800492 case R69006_1080P_CMD_PANEL:
493 panelstruct->paneldata = &r69006_1080p_cmd_panel_data;
494 panelstruct->panelres = &r69006_1080p_cmd_panel_res;
495 panelstruct->color = &r69006_1080p_cmd_color;
496 panelstruct->videopanel = &r69006_1080p_cmd_video_panel;
497 panelstruct->commandpanel = &r69006_1080p_cmd_command_panel;
498 panelstruct->state = &r69006_1080p_cmd_state;
499 panelstruct->laneconfig = &r69006_1080p_cmd_lane_config;
500 panelstruct->paneltiminginfo
501 = &r69006_1080p_cmd_timing_info;
502 panelstruct->panelresetseq
503 = &r69006_1080p_cmd_reset_seq;
504 panelstruct->backlightinfo = &r69006_1080p_cmd_backlight;
Ray Zhange9e3b692015-12-18 18:03:30 +0800505 pinfo->labibb = &r69006_1080p_cmd_labibb;
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800506 pinfo->mipi.panel_on_cmds
507 = r69006_1080p_cmd_on_command;
508 pinfo->mipi.num_of_panel_on_cmds
509 = R69006_1080P_CMD_ON_COMMAND;
510 pinfo->mipi.panel_off_cmds
511 = r69006_1080p_cmd_off_command;
512 pinfo->mipi.num_of_panel_off_cmds
513 = R69006_1080P_CMD_OFF_COMMAND;
514 memcpy(phy_db->timing,
515 r69006_1080p_cmd_timings, TIMING_SIZE);
516 pinfo->mipi.signature = R69006_1080P_CMD_SIGNATURE;
Ray Zhangc8fd3632015-12-23 14:01:13 +0800517 pinfo->mipi.tx_eot_append = true;
518 pinfo->mipi.rx_eot_ignore = true;
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800519 break;
520 case R69006_1080P_VIDEO_PANEL:
521 panelstruct->paneldata = &r69006_1080p_video_panel_data;
522 panelstruct->panelres = &r69006_1080p_video_panel_res;
523 panelstruct->color = &r69006_1080p_video_color;
524 panelstruct->videopanel = &r69006_1080p_video_video_panel;
525 panelstruct->commandpanel = &r69006_1080p_video_command_panel;
526 panelstruct->state = &r69006_1080p_video_state;
527 panelstruct->laneconfig = &r69006_1080p_video_lane_config;
528 panelstruct->paneltiminginfo
529 = &r69006_1080p_video_timing_info;
530 panelstruct->panelresetseq
531 = &r69006_1080p_video_reset_seq;
532 panelstruct->backlightinfo = &r69006_1080p_video_backlight;
Ray Zhange9e3b692015-12-18 18:03:30 +0800533 pinfo->labibb = &r69006_1080p_video_labibb;
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800534 pinfo->mipi.panel_on_cmds
535 = r69006_1080p_video_on_command;
536 pinfo->mipi.num_of_panel_on_cmds
537 = R69006_1080P_VIDEO_ON_COMMAND;
538 pinfo->mipi.panel_off_cmds
539 = r69006_1080p_video_off_command;
540 pinfo->mipi.num_of_panel_off_cmds
541 = R69006_1080P_VIDEO_OFF_COMMAND;
542 memcpy(phy_db->timing,
543 r69006_1080p_video_timings, TIMING_SIZE);
544 pinfo->mipi.signature = R69006_1080P_VIDEO_SIGNATURE;
545 break;
546 case HX8394F_720P_VIDEO_PANEL:
547 panelstruct->paneldata = &hx8394f_720p_video_panel_data;
548 panelstruct->panelres = &hx8394f_720p_video_panel_res;
549 panelstruct->color = &hx8394f_720p_video_color;
550 panelstruct->videopanel = &hx8394f_720p_video_video_panel;
551 panelstruct->commandpanel = &hx8394f_720p_video_command_panel;
552 panelstruct->state = &hx8394f_720p_video_state;
553 panelstruct->laneconfig = &hx8394f_720p_video_lane_config;
554 panelstruct->paneltiminginfo
555 = &hx8394f_720p_video_timing_info;
556 panelstruct->panelresetseq
557 = &hx8394f_720p_video_reset_seq;
558 panelstruct->backlightinfo = &hx8394f_720p_video_backlight;
559 pinfo->mipi.panel_on_cmds
560 = hx8394f_720p_video_on_command;
561 pinfo->mipi.num_of_panel_on_cmds
562 = HX8394F_720P_VIDEO_ON_COMMAND;
563 pinfo->mipi.panel_off_cmds
564 = hx8394f_720p_video_off_command;
565 pinfo->mipi.num_of_panel_off_cmds
566 = HX8394F_720P_VIDEO_OFF_COMMAND;
567 memcpy(phy_db->timing,
568 hx8394f_720p_video_timings, TIMING_SIZE);
569 pinfo->mipi.signature = HX8394F_720P_VIDEO_SIGNATURE;
570 break;
Sujeev Dias6bc9fa32015-08-03 23:13:44 -0700571 case BYD_1200P_VIDEO_PANEL:
572 panelstruct->paneldata = &byd_1200p_video_panel_data;
573 panelstruct->paneldata->panel_with_enable_gpio = 1;
574 panelstruct->panelres = &byd_1200p_video_panel_res;
575 panelstruct->color = &byd_1200p_video_color;
576 panelstruct->videopanel = &byd_1200p_video_video_panel;
577 panelstruct->commandpanel = &byd_1200p_video_command_panel;
578 panelstruct->state = &byd_1200p_video_state;
579 panelstruct->laneconfig = &byd_1200p_video_lane_config;
580 panelstruct->paneltiminginfo
581 = &byd_1200p_video_timing_info;
582 panelstruct->panelresetseq
583 = &byd_1200p_video_panel_reset_seq;
584 panelstruct->backlightinfo = &byd_1200p_video_backlight;
585 pinfo->mipi.panel_on_cmds
586 = byd_1200p_video_on_command;
587 pinfo->mipi.num_of_panel_on_cmds
588 = BYD_1200P_VIDEO_ON_COMMAND;
589 pinfo->mipi.panel_off_cmds
590 = byd_1200p_video_off_command;
591 pinfo->mipi.num_of_panel_off_cmds
592 = BYD_1200P_VIDEO_OFF_COMMAND;
593 memcpy(phy_db->timing,
594 byd_1200p_video_timings, TIMING_SIZE);
595 pinfo->mipi.signature = BYD_1200P_VIDEO_SIGNATURE;
596 phy_db->regulator_mode = DSI_PHY_REGULATOR_LDO_MODE;
597 break;
Padmanabhan Komandurue108ed02015-12-21 12:43:07 +0530598 case TRULY_720P_VIDEO_PANEL:
599 panelstruct->paneldata = &truly_720p_video_panel_data;
600 panelstruct->paneldata->panel_with_enable_gpio = 1;
601 panelstruct->panelres = &truly_720p_video_panel_res;
602 panelstruct->color = &truly_720p_video_color;
603 panelstruct->videopanel = &truly_720p_video_video_panel;
604 panelstruct->commandpanel = &truly_720p_video_command_panel;
605 panelstruct->state = &truly_720p_video_state;
606 panelstruct->laneconfig = &truly_720p_video_lane_config;
607 panelstruct->paneltiminginfo
608 = &truly_720p_video_timing_info;
609 panelstruct->panelresetseq
610 = &truly_720p_video_panel_reset_seq;
611 panelstruct->backlightinfo = &truly_720p_video_backlight;
612 pinfo->mipi.panel_on_cmds
613 = truly_720p_video_on_command;
614 pinfo->mipi.num_of_panel_on_cmds
615 = TRULY_720P_VIDEO_ON_COMMAND;
616 pinfo->mipi.panel_off_cmds
617 = truly_720p_video_off_command;
618 pinfo->mipi.num_of_panel_off_cmds
619 = TRULY_720P_VIDEO_OFF_COMMAND;
620 memcpy(phy_db->timing,
621 truly_720p_video_timings, TIMING_SIZE);
622 pinfo->mipi.signature = TRULY_720P_VIDEO_SIGNATURE;
623 pinfo->mipi.tx_eot_append = true;
624 break;
Padmanabhan Komanduru7460e442016-01-21 12:30:34 +0530625 case TRULY_WUXGA_VIDEO_PANEL:
626 panelstruct->paneldata = &truly_wuxga_video_panel_data;
627 panelstruct->paneldata->panel_with_enable_gpio = 1;
628 panelstruct->panelres = &truly_wuxga_video_panel_res;
629 panelstruct->color = &truly_wuxga_video_color;
630 panelstruct->videopanel = &truly_wuxga_video_video_panel;
631 panelstruct->commandpanel = &truly_wuxga_video_command_panel;
632 panelstruct->state = &truly_wuxga_video_state;
633 panelstruct->laneconfig = &truly_wuxga_video_lane_config;
634 panelstruct->paneltiminginfo
635 = &truly_wuxga_video_timing_info;
636 panelstruct->panelresetseq
637 = &truly_wuxga_video_panel_reset_seq;
638 panelstruct->backlightinfo = &truly_wuxga_video_backlight;
639 pinfo->mipi.panel_on_cmds
640 = truly_wuxga_video_on_command;
641 pinfo->mipi.num_of_panel_on_cmds
642 = TRULY_WUXGA_VIDEO_ON_COMMAND;
643 pinfo->mipi.panel_off_cmds
644 = truly_wuxga_video_off_command;
645 pinfo->mipi.num_of_panel_off_cmds
646 = TRULY_WUXGA_VIDEO_OFF_COMMAND;
647 memcpy(phy_db->timing,
648 truly_wuxga_video_timings, TIMING_SIZE);
649 pinfo->mipi.signature = TRULY_WUXGA_VIDEO_SIGNATURE;
650 break;
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700651 case UNKNOWN_PANEL:
652 default:
653 memset(panelstruct, 0, sizeof(struct panel_struct));
654 memset(pinfo->mipi.panel_on_cmds, 0,
655 sizeof(struct mipi_dsi_cmd));
656 pinfo->mipi.num_of_panel_on_cmds = 0;
657 memset(pinfo->mipi.panel_off_cmds, 0,
658 sizeof(struct mipi_dsi_cmd));
659 pinfo->mipi.num_of_panel_off_cmds = 0;
660 memset(phy_db->timing, 0, TIMING_SIZE);
661 pan_type = PANEL_TYPE_UNKNOWN;
662 break;
663 }
Ujwal Patel41a665a2015-07-17 13:51:30 -0700664
665 dprintf(SPEW, "lm_split[0]=%d lm_split[1]=%d mode=0x%x\n",
666 pinfo->lm_split[0], pinfo->lm_split[1],
667 panelstruct->paneldata->panel_operating_mode);
668
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700669 return pan_type;
670}
671
Ray Zhangf95f5b92015-06-25 15:34:29 +0800672#define DISPLAY_MAX_PANEL_DETECTION 2
673static uint32_t auto_pan_loop = 0;
674
675uint32_t oem_panel_max_auto_detect_panels()
676{
677 return target_panel_auto_detect_enabled() ?
678 DISPLAY_MAX_PANEL_DETECTION : 0;
679}
680
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700681int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
682 struct msm_panel_info *pinfo,
683 struct mdss_dsi_phy_ctrl *phy_db)
684{
685 uint32_t hw_id = board_hardware_id();
Sujeev Dias6bc9fa32015-08-03 23:13:44 -0700686 uint32_t hw_subtype = board_hardware_subtype();
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700687 int32_t panel_override_id;
feifanz028544e2015-07-28 20:58:57 +0800688 uint32_t target_id, plat_hw_ver_major;
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700689
690 if (panel_name) {
691 panel_override_id = panel_name_to_id(supp_panels,
692 ARRAY_SIZE(supp_panels), panel_name);
693
694 if (panel_override_id < 0) {
695 dprintf(CRITICAL, "Not able to search the panel:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530696 panel_name);
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700697 } else if (panel_override_id < UNKNOWN_PANEL) {
698 /* panel override using fastboot oem command */
699 panel_id = panel_override_id;
700
701 dprintf(INFO, "OEM panel override:%s\n",
Padmanabhan Komandurubccbcdc2015-06-30 16:19:24 +0530702 panel_name);
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700703 goto panel_init;
704 }
705 }
706
707 switch (hw_id) {
708 case HW_PLATFORM_MTP:
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530709 if (platform_is_msm8956())
710 panel_id = NT35597_WQXGA_DUALDSI_VIDEO_PANEL;
Jayant Shekhar9c0533e2016-01-28 11:17:18 +0530711 else if (platform_is_msmgold())
712 panel_id = TRULY_720P_VIDEO_PANEL;
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530713 else
714 panel_id = TRULY_1080P_VIDEO_PANEL;
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700715 break;
716 case HW_PLATFORM_SURF:
Vishnuvardhan Prodduturie116c002015-07-14 17:14:25 +0530717 case HW_PLATFORM_RCM:
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530718 if (platform_is_msm8956())
719 panel_id = NT35597_WQXGA_DUALDSI_VIDEO_PANEL;
Jayant Shekhar9c0533e2016-01-28 11:17:18 +0530720 else if (platform_is_msmgold())
721 panel_id = TRULY_720P_VIDEO_PANEL;
Padmanabhan Komanduru49a86cf2015-06-08 18:24:30 +0530722 else
723 panel_id = TRULY_1080P_VIDEO_PANEL;
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700724 break;
feifanz174c82c2015-04-15 18:57:07 +0800725 case HW_PLATFORM_QRD:
Sujeev Dias6bc9fa32015-08-03 23:13:44 -0700726 if (hw_subtype == HW_PLATFORM_SUBTYPE_POLARIS) {
727 panel_id = BYD_1200P_VIDEO_PANEL;
728 break;
729 }
730
feifanz028544e2015-07-28 20:58:57 +0800731 target_id = board_target_id();
732 plat_hw_ver_major = ((target_id >> 16) & 0xFF);
733
734 /*
735 * 8952 SKUM DVT2 - HX8399A 1080p video panel
736 * 8952 SKUM EVT1/EVT2 - OTM1906C 1080p cmd panel
737 */
738 if (plat_hw_ver_major >= 4)
739 panel_id = HX8399A_1080P_VIDEO_PANEL;
740 else
741 panel_id = OTM1906C_1080P_CMD_PANEL;
Ray Zhangf95f5b92015-06-25 15:34:29 +0800742
Ray Zhang4bbc7b02015-12-04 16:07:20 +0800743 /* QRD 8937 SKU1 uses R69006, and SKU2 uses HX8399A */
744 if (platform_is_msm8937()){
745 if (plat_hw_ver_major > 16)
746 panel_id = HX8394F_720P_VIDEO_PANEL;
747 else
748 panel_id = R69006_1080P_CMD_PANEL;
749 }
750
751 /* QRD EVT1 uses OTM1906C, and EVT2 uses HX8394F */
Ray Zhangf95f5b92015-06-25 15:34:29 +0800752 if (platform_is_msm8956()) {
753 switch (auto_pan_loop) {
754 case 0:
755 panel_id = HX8399A_1080P_VIDEO_PANEL;
756 break;
757 case 1:
758 panel_id = OTM1906C_1080P_CMD_PANEL;
759 break;
760 default:
761 panel_id = UNKNOWN_PANEL;
762 dprintf(CRITICAL, "Unknown panel\n");
763 return PANEL_TYPE_UNKNOWN;
764 }
765 auto_pan_loop++;
766 }
767
feifanz174c82c2015-04-15 18:57:07 +0800768 break;
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700769 default:
770 dprintf(CRITICAL, "Display not enabled for %d HW type\n",
771 hw_id);
772 return PANEL_TYPE_UNKNOWN;
773 }
774
775panel_init:
776 /*
777 * Update all data structures after 'panel_init' label. Only panel
778 * selection is supposed to happen before that.
779 */
Padmanabhan Komanduru0e19a362015-06-08 13:29:32 +0530780 if (platform_is_msm8956())
781 memcpy(panel_regulator_settings,
782 dcdc_regulator_settings_hpm, REGULATOR_SIZE);
783 else
784 memcpy(panel_regulator_settings,
785 dcdc_regulator_settings_lpm, REGULATOR_SIZE);
Padmanabhan Komanduru9d49f892015-04-10 12:58:46 -0700786 pinfo->pipe_type = MDSS_MDP_PIPE_TYPE_RGB;
787 return init_panel_data(panelstruct, pinfo, phy_db);
788}