mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
disp: msm: Correct the panel's LP11_INIT
QCOM has panel's LP11_INIT implementation, but it doesn't meet MOT's panel spec. Here is QCOM's implementaion: - Init the DSI PHY, Turn on panel's POWER, Toggle Reset, and sending MIPI commands Here is MOT's LP11_INIT panel spec: - Init the DSI PHY ( MIPI lines in LP00), Turn on panel POWER, Bring MIPI lines to LP11, Toggle Reset, Sending MIPI commands Port from: f78d13a Change-Id: Ia5f7f5be683615ec1811f550dec1967335c9816d Signed-off-by: Bang Nguyen <bangnguyen@motorola.com> Reviewed-on: https://gerrit.mot.com/1697591 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
ade79873ca
commit
e2e955e81c
3 changed files with 40 additions and 29 deletions
|
|
@ -8330,7 +8330,8 @@ error_ctrl_clk_off:
|
|||
(void)dsi_display_clk_ctrl(display->dsi_clk_handle,
|
||||
DSI_CORE_CLK, DSI_CLK_OFF);
|
||||
error_panel_post_unprep:
|
||||
(void)dsi_panel_post_unprepare(display->panel);
|
||||
if (!display->is_cont_splash_enabled)
|
||||
(void)dsi_panel_post_unprepare(display->panel);
|
||||
error:
|
||||
mutex_unlock(&display->display_lock);
|
||||
SDE_EVT32(SDE_EVTLOG_FUNC_EXIT);
|
||||
|
|
|
|||
|
|
@ -264,12 +264,13 @@ int dsi_panel_trigger_esd_attack(struct dsi_panel *panel, bool trusted_vm_env)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dsi_panel_reset(struct dsi_panel *panel)
|
||||
int dsi_panel_reset(struct dsi_panel *panel)
|
||||
{
|
||||
int rc = 0;
|
||||
struct dsi_panel_reset_config *r_config = &panel->reset_config;
|
||||
int i;
|
||||
|
||||
DSI_DEBUG("++\n");
|
||||
if (gpio_is_valid(panel->reset_config.disp_en_gpio)) {
|
||||
rc = gpio_direction_output(panel->reset_config.disp_en_gpio, 1);
|
||||
if (rc) {
|
||||
|
|
@ -376,23 +377,8 @@ static int dsi_panel_power_on(struct dsi_panel *panel)
|
|||
goto error_disable_vregs;
|
||||
}
|
||||
|
||||
rc = dsi_panel_reset(panel);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] failed to reset panel, rc=%d\n", panel->name, rc);
|
||||
goto error_disable_gpio;
|
||||
}
|
||||
|
||||
goto exit;
|
||||
|
||||
error_disable_gpio:
|
||||
if (gpio_is_valid(panel->reset_config.disp_en_gpio))
|
||||
gpio_set_value(panel->reset_config.disp_en_gpio, 0);
|
||||
|
||||
if (gpio_is_valid(panel->bl_config.en_gpio))
|
||||
gpio_set_value(panel->bl_config.en_gpio, 0);
|
||||
|
||||
(void)dsi_panel_set_pinctrl_state(panel, false);
|
||||
|
||||
error_disable_vregs:
|
||||
(void)dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
|
||||
|
|
@ -4587,14 +4573,17 @@ int dsi_panel_pre_prepare(struct dsi_panel *panel)
|
|||
|
||||
mutex_lock(&panel->panel_lock);
|
||||
|
||||
/* If LP11_INIT is set, panel will be powered up during prepare() */
|
||||
if (panel->lp11_init)
|
||||
goto error;
|
||||
|
||||
rc = dsi_panel_power_on(panel);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] panel power on failed, rc=%d\n", panel->name, rc);
|
||||
goto error;
|
||||
/*
|
||||
* If LP11_INIT is set, panel will be powered up here, not during
|
||||
* prepare(), but panel's reset will be called later, in prepare call.
|
||||
*/
|
||||
if (panel->lp11_init) {
|
||||
rc = dsi_panel_power_on(panel);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] panel power on failed, rc=%d\n",
|
||||
panel->name, rc);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
error:
|
||||
|
|
@ -4749,23 +4738,42 @@ int dsi_panel_prepare(struct dsi_panel *panel)
|
|||
|
||||
mutex_lock(&panel->panel_lock);
|
||||
|
||||
if (panel->lp11_init) {
|
||||
/* If LP11_INIT is not set, then panel will be powered here */
|
||||
if (!panel->lp11_init) {
|
||||
rc = dsi_panel_power_on(panel);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] panel power on failed, rc=%d\n",
|
||||
panel->name, rc);
|
||||
goto error;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
rc = dsi_panel_reset(panel);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] panel reset failed, rc=%d\n", panel->name, rc);
|
||||
goto error_disable_gpio;
|
||||
}
|
||||
|
||||
rc = dsi_panel_tx_cmd_set(panel, DSI_CMD_SET_PRE_ON);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] failed to send DSI_CMD_SET_PRE_ON cmds, rc=%d\n",
|
||||
panel->name, rc);
|
||||
goto error;
|
||||
goto error_disable_gpio;
|
||||
}
|
||||
|
||||
error:
|
||||
goto end;
|
||||
error_disable_gpio:
|
||||
if (gpio_is_valid(panel->reset_config.disp_en_gpio))
|
||||
gpio_set_value(panel->reset_config.disp_en_gpio, 0);
|
||||
|
||||
if (gpio_is_valid(panel->bl_config.en_gpio))
|
||||
gpio_set_value(panel->bl_config.en_gpio, 0);
|
||||
|
||||
if (!panel->lp11_init) {
|
||||
(void)dsi_panel_set_pinctrl_state(panel, false);
|
||||
(void)dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
}
|
||||
end:
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -386,6 +386,8 @@ int dsi_panel_set_nolp(struct dsi_panel *panel);
|
|||
|
||||
int dsi_panel_prepare(struct dsi_panel *panel);
|
||||
|
||||
int dsi_panel_reset(struct dsi_panel *panel);
|
||||
|
||||
int dsi_panel_enable(struct dsi_panel *panel);
|
||||
|
||||
int dsi_panel_post_enable(struct dsi_panel *panel);
|
||||
|
|
|
|||
Loading…
Reference in a new issue