mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
disp: msm: implement xxx-hbm-is-51cmd dts entry
Add qcom,mdss-dsi-panel-hbm-is-51cmd to panel's dts to indicate that the HBM command is using the same backlight command 0x51 command. Therefore when the HBM is on, then the backlight level will be saved and backlight command will be ignored. When the HBM is off then stored backlight level will be set Port from 9bafa67 Change-Id: I58082c5555a4afbebebd2c1d9e8568c787143d2d Signed-off-by: Bang Nguyen <bangnguyen@motorola.com> Signed-off-by: daiss1 <daiss1@lenovo.com> Reviewed-on: https://gerrit.mot.com/1697612 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
bbf4ba0698
commit
6ff2674c42
2 changed files with 42 additions and 3 deletions
|
|
@ -573,11 +573,17 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel,
|
|||
if (panel->bl_config.bl_inverted_dbv)
|
||||
bl_lvl = (((bl_lvl & 0xff) << 8) | (bl_lvl >> 8));
|
||||
|
||||
if (panel->is_hbm_using_51_cmd && panel->is_hbm_on) {
|
||||
panel->bl_lvl_during_hbm = bl_lvl;
|
||||
DSI_DEBUG("HBM is on.. ignore setting backlight. bl_vl=%d\n",
|
||||
panel->bl_lvl_during_hbm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bl->bl_2bytes_enable){
|
||||
bl_lvl_2bytes = ((bl_lvl & 0xff00) >> 8) | ((bl_lvl & 0xff) << 8);
|
||||
rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl_2bytes);
|
||||
}
|
||||
else
|
||||
}else
|
||||
rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl);
|
||||
|
||||
if (rc < 0)
|
||||
|
|
@ -804,11 +810,36 @@ static int dsi_panel_set_hbm(struct dsi_panel *panel,
|
|||
struct msm_param_info *param_info)
|
||||
{
|
||||
int rc = 0;
|
||||
u32 tmp_bklt_lvl = 0;
|
||||
bool old_hbm_on;
|
||||
|
||||
pr_info("Set HBM to (%d)\n", param_info->value);
|
||||
rc = dsi_panel_send_param_cmd(panel, param_info);
|
||||
if (rc < 0)
|
||||
DSI_ERR("%s: failed to send param cmds. ret=%d\n", __func__, rc);
|
||||
else {
|
||||
mutex_lock(&panel->panel_lock);
|
||||
if (!panel->is_hbm_using_51_cmd) {
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
old_hbm_on = panel->is_hbm_on ;
|
||||
panel->is_hbm_on = param_info->value;
|
||||
if (!panel->is_hbm_on) {
|
||||
tmp_bklt_lvl= panel->bl_lvl_during_hbm;
|
||||
panel->bl_lvl_during_hbm = 0;
|
||||
}
|
||||
mutex_unlock(&panel->panel_lock);
|
||||
|
||||
if (param_info->value == 0 && old_hbm_on && tmp_bklt_lvl) {
|
||||
rc = dsi_panel_set_backlight(panel, tmp_bklt_lvl);
|
||||
if (rc)
|
||||
DSI_ERR("unable to set backlight\n");
|
||||
else
|
||||
tmp_bklt_lvl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
};
|
||||
|
|
@ -3762,6 +3793,11 @@ static int dsi_panel_parse_param_prop(struct dsi_panel *panel,
|
|||
panel->panel_hbm_fod = of_property_read_bool(of_node,
|
||||
"qcom,mdss-dsi-hbm-fod");
|
||||
|
||||
panel->is_hbm_using_51_cmd = of_property_read_bool(of_node,
|
||||
"qcom,mdss-dsi-panel-hbm-is-51cmd");
|
||||
if (panel->is_hbm_using_51_cmd)
|
||||
DSI_INFO("HBM command is using 0x51 command\n");
|
||||
|
||||
return rc;
|
||||
|
||||
parse_err:
|
||||
|
|
|
|||
|
|
@ -314,9 +314,12 @@ struct dsi_panel {
|
|||
bool no_panel_on_read_support;
|
||||
|
||||
bool panel_hbm_fod;
|
||||
|
||||
bool panel_hbm_dim_off;
|
||||
|
||||
bool is_hbm_using_51_cmd;
|
||||
bool is_hbm_on;
|
||||
u32 bl_lvl_during_hbm;
|
||||
|
||||
struct panel_param *param_cmds;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue