mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
drm/dsi: add keeep panel regulators always on function
drm/dsi: Add keep panel regulators always on function when screen on/off. Change-Id: I88e045237a149b9c4b2f908b334aa52b0c75f3be Signed-off-by: wangyq13 <wangyq13@lenovo.com> Reviewed-on: https://gerrit.mot.com/2049656 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan <tanhua1@motorola.com> Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
4222fb1b3d
commit
3df6946637
2 changed files with 23 additions and 10 deletions
|
|
@ -488,11 +488,13 @@ static int dsi_panel_power_on(struct dsi_panel *panel)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
rc = dsi_pwr_enable_regulator(&panel->power_info, true);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] failed to enable vregs, rc=%d\n",
|
||||
panel->name, rc);
|
||||
goto exit;
|
||||
if (!panel->keep_regulators_on) {
|
||||
rc = dsi_pwr_enable_regulator(&panel->power_info, true);
|
||||
if (rc) {
|
||||
DSI_ERR("[%s] failed to enable vregs, rc=%d\n",
|
||||
panel->name, rc);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
rc = dsi_panel_set_pinctrl_state(panel, true);
|
||||
|
|
@ -504,7 +506,8 @@ static int dsi_panel_power_on(struct dsi_panel *panel)
|
|||
goto exit;
|
||||
|
||||
error_disable_vregs:
|
||||
(void)dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
if (!panel->keep_regulators_on)
|
||||
(void)dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
|
||||
exit:
|
||||
return rc;
|
||||
|
|
@ -550,10 +553,12 @@ static int dsi_panel_power_off(struct dsi_panel *panel)
|
|||
rc);
|
||||
}
|
||||
|
||||
rc = dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
if (rc)
|
||||
DSI_ERR("[%s] failed to enable vregs, rc=%d\n",
|
||||
panel->name, rc);
|
||||
if (!panel->keep_regulators_on) {
|
||||
rc = dsi_pwr_enable_regulator(&panel->power_info, false);
|
||||
if (rc)
|
||||
DSI_ERR("[%s] failed to enable vregs, rc=%d\n",
|
||||
panel->name, rc);
|
||||
}
|
||||
|
||||
exit:
|
||||
return rc;
|
||||
|
|
@ -2678,6 +2683,7 @@ static int dsi_panel_parse_power_cfg(struct dsi_panel *panel)
|
|||
{
|
||||
int rc = 0;
|
||||
char *supply_name;
|
||||
struct dsi_parser_utils *utils = &panel->utils;
|
||||
|
||||
if (panel->host_config.ext_bridge_mode)
|
||||
return 0;
|
||||
|
|
@ -2694,6 +2700,12 @@ static int dsi_panel_parse_power_cfg(struct dsi_panel *panel)
|
|||
goto error;
|
||||
}
|
||||
|
||||
panel->keep_regulators_on = utils->read_bool(utils->data,
|
||||
"qcom,keep-regulators-on");
|
||||
|
||||
DSI_DEBUG("[%s] keep_regulators_on=%d\n", panel->name,
|
||||
panel->keep_regulators_on);
|
||||
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ struct dsi_panel {
|
|||
|
||||
int panel_test_gpio;
|
||||
int power_mode;
|
||||
bool keep_regulators_on;
|
||||
enum dsi_panel_physical_type panel_type;
|
||||
|
||||
struct dsi_tlmm_gpio *tlmm_gpio;
|
||||
|
|
|
|||
Loading…
Reference in a new issue