dev: gcdb: Support post power API to handle LP11 panel config
Certain panels need DSI clock and data lanes in (Low Power)
LP11 state before enabling the hardware reset line. Some
panels also require master delay to reach mipi master and
slave in functional state. Such panels' configuration
is handled through post power API.
Change-Id: Ibb499c8a435e77cf87c176464f6866a814942ff0
diff --git a/dev/gcdb/display/gcdb_display.c b/dev/gcdb/display/gcdb_display.c
index be895bb..3e2ee17 100755
--- a/dev/gcdb/display/gcdb_display.c
+++ b/dev/gcdb/display/gcdb_display.c
@@ -105,28 +105,30 @@
if (enable) {
ret = target_ldo_ctrl(enable);
if (ret) {
- dprintf(CRITICAL, "LDO control enable failed \n");
+ dprintf(CRITICAL, "LDO control enable failed\n");
return ret;
}
/* Panel Reset */
- ret = mdss_dsi_panel_reset(enable);
- if (ret) {
- dprintf(CRITICAL, "panel reset failed \n");
- return ret;
+ if (!panelstruct.paneldata->panel_lp11_init) {
+ ret = mdss_dsi_panel_reset(enable);
+ if (ret) {
+ dprintf(CRITICAL, "panel reset failed\n");
+ return ret;
+ }
}
dprintf(SPEW, "Panel power on done\n");
} else {
/* Disable panel and ldo */
ret = mdss_dsi_panel_reset(enable);
if (ret) {
- dprintf(CRITICAL, "panel reset disable failed \n");
+ dprintf(CRITICAL, "panel reset disable failed\n");
return ret;
}
ret = target_ldo_ctrl(enable);
if (ret) {
- dprintf(CRITICAL, "ldo control disable failed \n");
+ dprintf(CRITICAL, "ldo control disable failed\n");
return ret;
}
dprintf(SPEW, "Panel power off done\n");
@@ -135,6 +137,29 @@
return ret;
}
+static int mdss_dsi_panel_post_power(uint8_t enable)
+{
+ int ret = NO_ERROR;
+
+ if (enable) {
+ /* Panel Reset */
+ if (panelstruct.paneldata->panel_lp11_init) {
+ ret = mdss_dsi_panel_reset(enable);
+ if (ret) {
+ dprintf(CRITICAL, "panel reset failed\n");
+ return ret;
+ }
+ }
+
+ if(panelstruct.paneldata->panel_init_delay)
+ udelay(panelstruct.paneldata->panel_init_delay);
+
+ dprintf(SPEW, "Panel post power on done\n");
+ }
+
+ return ret;
+}
+
static int mdss_dsi_bl_enable(uint8_t enable)
{
int ret = NO_ERROR;
@@ -222,6 +247,7 @@
panel.pll_clk_func = mdss_dsi_panel_clock;
panel.power_func = mdss_dsi_panel_power;
+ panel.post_power_func = mdss_dsi_panel_post_power;
panel.bl_func = mdss_dsi_bl_enable;
panel.fb.base = base;
panel.fb.width = panel.panel_info.xres;