blob: 1328653c9db35a48ea259263a11c60509e484628 [file] [log] [blame]
Huaibin Yangcbec39b2014-11-07 13:54:38 -08001/* Copyright (c) 2013-2015, 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>
Veera Sundaram Sankaran824e6fa2014-12-09 11:32:58 -080033#include <clock.h>
Arpita Banerjee841fa062013-05-24 14:59:51 -070034#include <msm_panel.h>
Dhaval Patel9f61f132013-07-18 14:45:11 -070035#include <string.h>
36#include <stdlib.h>
Arpita Banerjee841fa062013-05-24 14:59:51 -070037#include <board.h>
38#include <mdp5.h>
Veera Sundaram Sankaran824e6fa2014-12-09 11:32:58 -080039#include <qtimer.h>
Arpita Banerjee841fa062013-05-24 14:59:51 -070040#include <platform/gpio.h>
41#include <mipi_dsi.h>
42
43#include "include/display_resource.h"
44#include "include/panel.h"
45#include "panel_display.h"
46#include "gcdb_display.h"
47#include "target/display.h"
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -070048#include "gcdb_autopll.h"
Arpita Banerjee841fa062013-05-24 14:59:51 -070049
50/*---------------------------------------------------------------------------*/
51/* static */
52/*---------------------------------------------------------------------------*/
53static struct msm_fb_panel_data panel;
54struct panel_struct panelstruct;
55static uint8_t display_enable;
56static struct mdss_dsi_phy_ctrl dsi_video_mode_phy_db;
57
Arpita Banerjee841fa062013-05-24 14:59:51 -070058/*---------------------------------------------------------------------------*/
59/* Extern */
60/*---------------------------------------------------------------------------*/
61extern int msm_display_init(struct msm_fb_panel_data *pdata);
62extern int msm_display_off();
63
64static uint32_t panel_backlight_ctrl(uint8_t enable)
65{
Kuogee Hsieh5accef12013-12-18 14:12:09 -080066 return target_backlight_ctrl(panelstruct.backlightinfo, enable);
Arpita Banerjee841fa062013-05-24 14:59:51 -070067}
68
69static uint32_t mdss_dsi_panel_reset(uint8_t enable)
70{
71 uint32_t ret = NO_ERROR;
72
Dhaval Patel29f24492013-08-08 20:45:42 -070073 ret = target_panel_reset(enable, panelstruct.panelresetseq,
74 &panel.panel_info);
Arpita Banerjee841fa062013-05-24 14:59:51 -070075
76 return ret;
77}
78
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -070079static uint32_t mdss_dsi_panel_clock(uint8_t enable,
80 struct msm_panel_info *pinfo)
Arpita Banerjee841fa062013-05-24 14:59:51 -070081{
82 uint32_t ret = NO_ERROR;
83
Arpita Banerjeeda0c39a2013-05-24 16:12:45 -070084 ret = calculate_clock_config(pinfo);
Huaibin Yangcbec39b2014-11-07 13:54:38 -080085 if (ret)
86 dprintf(CRITICAL, "Clock calculation failed\n");
87 else
88 ret = target_panel_clock(enable, pinfo);
Arpita Banerjee841fa062013-05-24 14:59:51 -070089
90 return ret;
91}
92
Kuogee Hsieh93bcff62014-08-22 14:02:08 -070093static int mdss_dsi_panel_power(uint8_t enable,
94 struct msm_panel_info *pinfo)
Arpita Banerjee841fa062013-05-24 14:59:51 -070095{
96 int ret = NO_ERROR;
97
98 if (enable) {
Kuogee Hsieh93bcff62014-08-22 14:02:08 -070099 ret = target_ldo_ctrl(enable, pinfo);
Arpita Banerjee841fa062013-05-24 14:59:51 -0700100 if (ret) {
Jayant Shekharc9611a92013-11-20 16:59:27 +0530101 dprintf(CRITICAL, "LDO control enable failed\n");
Arpita Banerjee841fa062013-05-24 14:59:51 -0700102 return ret;
103 }
104
105 /* Panel Reset */
Jayant Shekharc9611a92013-11-20 16:59:27 +0530106 if (!panelstruct.paneldata->panel_lp11_init) {
107 ret = mdss_dsi_panel_reset(enable);
108 if (ret) {
109 dprintf(CRITICAL, "panel reset failed\n");
110 return ret;
111 }
Arpita Banerjee841fa062013-05-24 14:59:51 -0700112 }
113 dprintf(SPEW, "Panel power on done\n");
114 } else {
Casey Piper1bbd1572013-09-11 16:23:18 -0700115 /* Disable panel and ldo */
Arpita Banerjee841fa062013-05-24 14:59:51 -0700116 ret = mdss_dsi_panel_reset(enable);
117 if (ret) {
Jayant Shekharc9611a92013-11-20 16:59:27 +0530118 dprintf(CRITICAL, "panel reset disable failed\n");
Arpita Banerjee841fa062013-05-24 14:59:51 -0700119 return ret;
120 }
121
Kuogee Hsieh93bcff62014-08-22 14:02:08 -0700122 ret = target_ldo_ctrl(enable, pinfo);
Arpita Banerjee841fa062013-05-24 14:59:51 -0700123 if (ret) {
Jayant Shekharc9611a92013-11-20 16:59:27 +0530124 dprintf(CRITICAL, "ldo control disable failed\n");
Arpita Banerjee841fa062013-05-24 14:59:51 -0700125 return ret;
126 }
127 dprintf(SPEW, "Panel power off done\n");
128 }
129
130 return ret;
131}
132
Ray Zhangeb462f62013-12-03 17:16:08 +0800133static int mdss_dsi_panel_pre_init(void)
Jayant Shekharc9611a92013-11-20 16:59:27 +0530134{
135 int ret = NO_ERROR;
136
Ray Zhangeb462f62013-12-03 17:16:08 +0800137 if (panelstruct.paneldata->panel_lp11_init) {
138 ret = mdss_dsi_panel_reset(1);
139 if (ret) {
140 dprintf(CRITICAL, "panel reset failed\n");
141 return ret;
Jayant Shekharc9611a92013-11-20 16:59:27 +0530142 }
Jayant Shekharc9611a92013-11-20 16:59:27 +0530143 }
144
Ray Zhangeb462f62013-12-03 17:16:08 +0800145 if(panelstruct.paneldata->panel_init_delay)
146 udelay(panelstruct.paneldata->panel_init_delay);
147
148 dprintf(SPEW, "Panel pre init done\n");
Jayant Shekharc9611a92013-11-20 16:59:27 +0530149 return ret;
150}
151
Huaibin Yangcbec39b2014-11-07 13:54:38 -0800152static int mdss_dsi_dfps_get_pll_codes(struct msm_panel_info *pinfo)
153{
154 int ret = NO_ERROR;
155 uint32_t fps_bak;
156 uint32_t i;
157
158 fps_bak = pinfo->mipi.frame_rate;
159
160 for (i = 0; i < pinfo->dfps.panel_dfps.frame_rate_cnt; i++) {
161 int err;
162 pinfo->mipi.frame_rate = pinfo->dfps.panel_dfps.frame_rate[i];
163
164 err = mdss_dsi_panel_clock(1, pinfo);
165 if (!err) {
166 pinfo->dfps.codes_dfps[i].is_valid = 1;
167 pinfo->dfps.codes_dfps[i].frame_rate =
168 pinfo->mipi.frame_rate;
169 pinfo->dfps.codes_dfps[i].frame_rate =
170 pinfo->mipi.frame_rate;
171 pinfo->dfps.codes_dfps[i].clk_rate =
172 pinfo->mipi.dsi_pll_config->vco_clock;
173 pinfo->dfps.codes_dfps[i].pll_codes =
174 pinfo->mipi.pll_codes;
175
176 mdss_dsi_panel_clock(0, pinfo);
177 } else {
178 ret = err;
179 pinfo->dfps.codes_dfps[i].is_valid = 0;
180 dprintf(CRITICAL, "frame_rate=%d failed!\n",
181 pinfo->mipi.frame_rate);
182 }
183 }
184
185 pinfo->mipi.frame_rate = fps_bak;
186
187 return ret;
188}
189
190static int mdss_dsi_mipi_dfps_config(struct msm_panel_info *pinfo)
191{
192 int ret = NO_ERROR;
193
194 if (!pinfo)
195 return ERROR;
196
197 if (!pinfo->dfps.panel_dfps.enabled)
198 goto dfps_done;
199
200 ret = mdss_dsi_dfps_get_pll_codes(pinfo);
201
202dfps_done:
203 return ret;
204}
205
Casey Piper1bbd1572013-09-11 16:23:18 -0700206static int mdss_dsi_bl_enable(uint8_t enable)
207{
208 int ret = NO_ERROR;
209
210 ret = panel_backlight_ctrl(enable);
211 if (ret)
212 dprintf(CRITICAL, "Backlight %s failed\n", enable ? "enable" :
213 "disable");
214 return ret;
215}
216
Veera Sundaram Sankarand9a868a2014-10-17 12:11:01 -0700217static bool mdss_dsi_set_panel_node(char *panel_name, char **dsi_id,
218 char **panel_node, char **slave_panel_node, int *panel_mode)
219{
220 if (!strcmp(panel_name, SIM_VIDEO_PANEL)) {
221 *dsi_id = SIM_DSI_ID;
222 *panel_node = SIM_VIDEO_PANEL_NODE;
223 *panel_mode = 0;
224 } else if (!strcmp(panel_name, SIM_DUALDSI_VIDEO_PANEL)) {
225 *dsi_id = SIM_DSI_ID;
226 *panel_node = SIM_DUALDSI_VIDEO_PANEL_NODE;
227 *slave_panel_node = SIM_DUALDSI_VIDEO_SLAVE_PANEL_NODE;
228 *panel_mode = 1;
229 } else if (!strcmp(panel_name, SIM_CMD_PANEL)) {
230 *dsi_id = SIM_DSI_ID;
231 *panel_node = SIM_CMD_PANEL_NODE;
232 *panel_mode = 0;
233 } else if (!strcmp(panel_name, SIM_DUALDSI_CMD_PANEL)) {
234 *dsi_id = SIM_DSI_ID;
235 *panel_node = SIM_DUALDSI_CMD_PANEL_NODE;
236 *slave_panel_node = SIM_DUALDSI_CMD_SLAVE_PANEL_NODE;
237 *panel_mode = 1;
238 } else {
239 return false;
240 }
241 return true;
242}
243
Veera Sundaram Sankaranc95d6752014-07-31 11:49:52 -0700244bool gcdb_display_cmdline_arg(char *panel_name, char *pbuf, uint16_t buf_size)
Dhaval Patel9f61f132013-07-18 14:45:11 -0700245{
Channagoud Kadabi4767b472013-09-26 20:45:34 -0700246 char *dsi_id = NULL;
247 char *panel_node = NULL;
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800248 char *slave_panel_node = NULL;
249 uint16_t dsi_id_len = 0, panel_node_len = 0, slave_panel_node_len = 0;
250 uint32_t arg_size = 0;
Dhaval Patel9f61f132013-07-18 14:45:11 -0700251 bool ret = true;
Veera Sundaram Sankarand9a868a2014-10-17 12:11:01 -0700252 bool rc;
Casey Pipera078d492013-11-15 12:26:17 -0800253 char *default_str;
Vineet Bajaj4effb132014-07-24 16:55:41 +0530254 int panel_mode = SPLIT_DISPLAY_FLAG | DUAL_PIPE_FLAG | DST_SPLIT_FLAG;
Dhaval Patel31feb292013-10-10 19:30:04 -0700255 int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
Aravind Venkateswaranf21253e2014-12-08 17:15:57 -0800256 char *sctl_string;
Dhaval Patel9f61f132013-07-18 14:45:11 -0700257
Veera Sundaram Sankarand9a868a2014-10-17 12:11:01 -0700258 panel_name += strspn(panel_name, " ");
Dhaval Patel31feb292013-10-10 19:30:04 -0700259
Veera Sundaram Sankarand9a868a2014-10-17 12:11:01 -0700260 rc = mdss_dsi_set_panel_node(panel_name, &dsi_id, &panel_node,
261 &slave_panel_node, &panel_mode);
262 if (!rc) {
263 if (panelstruct.paneldata && target_cont_splash_screen()) {
264 dsi_id = panelstruct.paneldata->panel_controller;
265 panel_node = panelstruct.paneldata->panel_node_id;
266 panel_mode =
267 panelstruct.paneldata->panel_operating_mode &
268 panel_mode;
269 slave_panel_node =
270 panelstruct.paneldata->slave_panel_node_id;
271 } else {
272 if (target_is_edp())
273 default_str = "0:edp:";
274 else
275 default_str = "0:dsi:0:";
276
277 arg_size = prefix_string_len + strlen(default_str);
278 if (buf_size < arg_size) {
279 dprintf(CRITICAL, "display command line buffer is small\n");
280 return false;
281 }
282
283 strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
284 pbuf += prefix_string_len;
285 buf_size -= prefix_string_len;
286
287 strlcpy(pbuf, default_str, buf_size);
288 return true;
Dhaval Patel31feb292013-10-10 19:30:04 -0700289 }
Casey Pipera078d492013-11-15 12:26:17 -0800290 }
Channagoud Kadabi4767b472013-09-26 20:45:34 -0700291
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800292 if (dsi_id == NULL || panel_node == NULL) {
293 dprintf(CRITICAL, "panel node or dsi ctrl not present\n");
Dhaval Patelbc7fa212013-08-28 10:46:42 -0700294 return false;
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800295 }
296
Ujwal Patel36fab7d2014-11-06 14:11:26 -0800297 if (((panel_mode & SPLIT_DISPLAY_FLAG) ||
298 (panel_mode & DST_SPLIT_FLAG)) && slave_panel_node == NULL) {
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800299 dprintf(CRITICAL, "slave node not present in dual dsi case\n");
300 return false;
301 }
Dhaval Patelbc7fa212013-08-28 10:46:42 -0700302
303 dsi_id_len = strlen(dsi_id);
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800304 panel_node_len = strlen(panel_node);
Veera Sundaram Sankaran58da7cf2014-10-03 18:05:24 -0700305 if (!slave_panel_node)
306 slave_panel_node = NO_PANEL_CONFIG;
307 slave_panel_node_len = strlen(slave_panel_node);
Dhaval Patelbc7fa212013-08-28 10:46:42 -0700308
Dhaval Patel31feb292013-10-10 19:30:04 -0700309 arg_size = prefix_string_len + dsi_id_len + panel_node_len +
310 LK_OVERRIDE_PANEL_LEN + 1;
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800311
Aravind Venkateswaranf21253e2014-12-08 17:15:57 -0800312 if (!strcmp(panelstruct.paneldata->panel_destination, "DISPLAY_2"))
313 sctl_string = DSI_0_STRING;
314 else
315 sctl_string = DSI_1_STRING;
316
317 arg_size += strlen(sctl_string) + slave_panel_node_len;
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800318
Veera Sundaram Sankaranc95d6752014-07-31 11:49:52 -0700319 if (buf_size < arg_size) {
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800320 dprintf(CRITICAL, "display command line buffer is small\n");
Dhaval Patel9f61f132013-07-18 14:45:11 -0700321 ret = false;
Veera Sundaram Sankaranc95d6752014-07-31 11:49:52 -0700322 } else {
Dhaval Patel31feb292013-10-10 19:30:04 -0700323 strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
324 pbuf += prefix_string_len;
325 buf_size -= prefix_string_len;
326
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800327 strlcpy(pbuf, LK_OVERRIDE_PANEL, buf_size);
328 pbuf += LK_OVERRIDE_PANEL_LEN;
329 buf_size -= LK_OVERRIDE_PANEL_LEN;
Dhaval Patel9f61f132013-07-18 14:45:11 -0700330
331 strlcpy(pbuf, dsi_id, buf_size);
Dhaval Patelbc7fa212013-08-28 10:46:42 -0700332 pbuf += dsi_id_len;
333 buf_size -= dsi_id_len;
Dhaval Patel9f61f132013-07-18 14:45:11 -0700334
335 strlcpy(pbuf, panel_node, buf_size);
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800336
Dhaval Patel7b9d6782014-01-03 13:31:09 -0800337 pbuf += panel_node_len;
338 buf_size -= panel_node_len;
339
Aravind Venkateswaranf21253e2014-12-08 17:15:57 -0800340 strlcpy(pbuf, sctl_string, buf_size);
341 pbuf += strlen(sctl_string);
342 buf_size -= strlen(sctl_string);
Veera Sundaram Sankaran58da7cf2014-10-03 18:05:24 -0700343 strlcpy(pbuf, slave_panel_node, buf_size);
Dhaval Patel9f61f132013-07-18 14:45:11 -0700344 }
345 return ret;
346}
347
348
Arpita Banerjee841fa062013-05-24 14:59:51 -0700349static void init_platform_data()
350{
351 memcpy(dsi_video_mode_phy_db.regulator, panel_regulator_settings,
352 REGULATOR_SIZE);
353 memcpy(dsi_video_mode_phy_db.ctrl, panel_physical_ctrl,
354 PHYSICAL_SIZE);
355 memcpy(dsi_video_mode_phy_db.strength, panel_strength_ctrl,
356 STRENGTH_SIZE);
357 memcpy(dsi_video_mode_phy_db.bistCtrl, panel_bist_ctrl, BIST_SIZE);
358 memcpy(dsi_video_mode_phy_db.laneCfg, panel_lane_config, LANE_SIZE);
359}
360
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -0700361static void mdss_edp_panel_init(struct msm_panel_info *pinfo)
362{
363 return target_edp_panel_init(pinfo);
364}
365
366static uint32_t mdss_edp_panel_clock(uint8_t enable,
367 struct msm_panel_info *pinfo)
368{
369 return target_edp_panel_clock(enable, pinfo);
370}
371
372static uint32_t mdss_edp_panel_enable(void)
373{
374 return target_edp_panel_enable();
375}
376
377static uint32_t mdss_edp_panel_disable(void)
378{
379 return target_edp_panel_disable();
380}
381
Kuogee Hsieh93bcff62014-08-22 14:02:08 -0700382static int mdss_edp_panel_power(uint8_t enable,
383 struct msm_panel_info *pinfo)
Arpita Banerjee841fa062013-05-24 14:59:51 -0700384{
Casey Piperc574e082013-09-05 14:54:42 -0700385 int ret = NO_ERROR;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700386
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -0700387 if (enable) {
Kuogee Hsieh93bcff62014-08-22 14:02:08 -0700388 ret = target_ldo_ctrl(enable, pinfo);
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -0700389 if (ret) {
390 dprintf(CRITICAL, "LDO control enable failed\n");
391 return ret;
392 }
393
394 ret = mdss_edp_panel_enable();
395 if (ret) {
396 dprintf(CRITICAL, "%s: panel enable failed\n", __func__);
397 return ret;
398 }
399 dprintf(SPEW, "EDP Panel power on done\n");
400 } else {
401 /* Disable panel and ldo */
402 ret = mdss_edp_panel_disable();
403 if (ret) {
404 dprintf(CRITICAL, "%s: panel disable failed\n", __func__);
405 return ret;
406 }
407
Kuogee Hsieh93bcff62014-08-22 14:02:08 -0700408 ret = target_ldo_ctrl(enable, pinfo);
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -0700409 if (ret) {
410 dprintf(CRITICAL, "%s: ldo control disable failed\n", __func__);
411 return ret;
412 }
413 dprintf(SPEW, "EDP Panel power off done\n");
414 }
415
416 return ret;
417}
418
419static int mdss_edp_bl_enable(uint8_t enable)
420{
421 int ret = NO_ERROR;
422
423 ret = target_edp_bl_ctrl(enable);
424 if (ret)
425 dprintf(CRITICAL, "Backlight %s failed\n", enable ? "enable" :
426 "disable");
427 return ret;
428}
429
430int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
431{
432 int ret = NO_ERROR;
433 int pan_type;
434
435 pan_type = oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),
436 &dsi_video_mode_phy_db);
437
438 if (pan_type == PANEL_TYPE_DSI) {
439 init_platform_data();
440 if (dsi_panel_init(&(panel.panel_info), &panelstruct)) {
441 dprintf(CRITICAL, "DSI panel init failed!\n");
442 ret = ERROR;
443 goto error_gcdb_display_init;
444 }
445
446 panel.panel_info.mipi.mdss_dsi_phy_db = &dsi_video_mode_phy_db;
447 panel.pll_clk_func = mdss_dsi_panel_clock;
Huaibin Yangcbec39b2014-11-07 13:54:38 -0800448 panel.dfps_func = mdss_dsi_mipi_dfps_config;
Kuogee Hsieh80b8a6c2014-06-09 17:25:38 -0700449 panel.power_func = mdss_dsi_panel_power;
450 panel.pre_init_func = mdss_dsi_panel_pre_init;
451 panel.bl_func = mdss_dsi_bl_enable;
452 panel.fb.base = base;
453 panel.fb.width = panel.panel_info.xres;
454 panel.fb.height = panel.panel_info.yres;
455 panel.fb.stride = panel.panel_info.xres;
456 panel.fb.bpp = panel.panel_info.bpp;
457 panel.fb.format = panel.panel_info.mipi.dst_format;
458 } else if (pan_type == PANEL_TYPE_EDP) {
459 mdss_edp_panel_init(&(panel.panel_info));
460 /* prepare func is set up at edp_panel_init */
461 panel.clk_func = mdss_edp_panel_clock;
462 panel.power_func = mdss_edp_panel_power;
463 panel.bl_func = mdss_edp_bl_enable;
464 panel.fb.format = FB_FORMAT_RGB888;
465 } else {
Arpita Banerjee841fa062013-05-24 14:59:51 -0700466 dprintf(CRITICAL, "Target panel init not found!\n");
Casey Piperc574e082013-09-05 14:54:42 -0700467 ret = ERR_NOT_SUPPORTED;
468 goto error_gcdb_display_init;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700469
Arpita Banerjee841fa062013-05-24 14:59:51 -0700470 }
471
Arpita Banerjee841fa062013-05-24 14:59:51 -0700472 panel.fb.base = base;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700473 panel.mdp_rev = rev;
474
Casey Piperc574e082013-09-05 14:54:42 -0700475 ret = msm_display_init(&panel);
Arpita Banerjee841fa062013-05-24 14:59:51 -0700476
Casey Piperc574e082013-09-05 14:54:42 -0700477error_gcdb_display_init:
478 display_enable = ret ? 0 : 1;
479 return ret;
Arpita Banerjee841fa062013-05-24 14:59:51 -0700480}
481
482void gcdb_display_shutdown(void)
483{
484 if (display_enable)
485 msm_display_off();
486}