diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index b98447056ce3..2b8a53819195 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -543,6 +543,8 @@ static int dsi_panel_update_backlight(struct dsi_panel *panel, int rc = 0; unsigned long mode_flags = 0; struct mipi_dsi_device *dsi = NULL; + struct dsi_backlight_config *bl = &panel->bl_config; + u32 bl_lvl_2bytes; if (!panel || (bl_lvl > 0xffff)) { DSI_ERR("invalid params\n"); @@ -558,7 +560,13 @@ 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)); - rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl); + 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 + rc = mipi_dsi_dcs_set_display_brightness(dsi, bl_lvl); + if (rc < 0) DSI_ERR("failed to update dcs backlight:%d\n", bl_lvl); @@ -2455,6 +2463,11 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel) else DSI_ERR("bl-dsc-cmd-state command state unrecognized-%s\n", state); + panel->bl_config.bl_2bytes_enable = utils->read_bool(utils->data, + "qcom,bklt-dcs-2bytes-enabled"); + + pr_info("[%s] bl_2bytes_enable=%d\n", panel->name, + panel->bl_config.bl_2bytes_enable); if (panel->bl_config.type == DSI_BACKLIGHT_PWM) { rc = dsi_panel_parse_bl_pwm_config(panel); diff --git a/msm/dsi/dsi_panel.h b/msm/dsi/dsi_panel.h index 3fc6baf9fd13..baa82d2f7fbf 100644 --- a/msm/dsi/dsi_panel.h +++ b/msm/dsi/dsi_panel.h @@ -118,6 +118,7 @@ struct dsi_backlight_config { enum dsi_backlight_type type; enum bl_update_flag bl_update; + bool bl_2bytes_enable; u32 bl_min_level; u32 bl_max_level; u32 brightness_max_level;