From 17b4f7ee6d8d22de9c4f9db049e92e2d1b45b89a Mon Sep 17 00:00:00 2001 From: Bang Nguyen Date: Thu, 5 Dec 2019 15:09:26 -0600 Subject: [PATCH] disp: msm: Restore old backlight setting after exitting HBM The backlight and HBM are using the same command 0x51. The backlight ranger will be from 0x000 to 0x640 while HBM on will be at 0xfff and HBM off will be at 0x640. This is why the display driver should restore the last backlight setting after exiting the HBM mode. Change-Id: Icd29cd25e5eb4936369dfefb513e62076f994482 Signed-off-by: Bang Nguyen Reviewed-on: https://gerrit.mot.com/1697623 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index f6045031ee5d..978a747f354f 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -576,11 +576,14 @@ 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) { + if (panel->is_hbm_using_51_cmd) { panel->bl_lvl_during_hbm = bl_lvl; - DSI_DEBUG("HBM is on.. ignore setting backlight. bl_vl=%d\n", + + if (panel->is_hbm_on) { + DSI_DEBUG("HBM is on.. ignore setting backlight. bl_vl=%d\n", panel->bl_lvl_during_hbm); - return 0; + return 0; + } } if (bl->bl_2bytes_enable){