drm/msm/dsi-staging: add default brightness property

Add a new property to specify the default brightness level that would
set for usecases where no explicit brightness level is configured.
Mot-CRs-fixed: (CR)

Change-Id: Iecc6f4e0b5b9fbda5d8bf97efa7d4de4dbbd5570
Signed-off-by: houdz1 <houdz1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1697641
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:
houdz1 2020-04-08 14:19:27 +08:00 • committed by tongkun1
commit f12b293d60
3 changed files with 11 additions and 1 deletions

View file

@ -2806,6 +2806,15 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel)
else
DSI_ERR("bl-dsc-cmd-state command state unrecognized-%s\n",
state);
rc = utils->read_u32(utils->data, "qcom,mdss-dsi-bl-default-level", &val);
if (rc) {
panel->bl_config.brightness_default_level =
panel->bl_config.brightness_max_level;
pr_debug("set default brightness to max level\n");
} else {
panel->bl_config.brightness_default_level = val;
}
panel->bl_config.bl_2bytes_enable = utils->read_bool(utils->data,
"qcom,bklt-dcs-2bytes-enabled");

View file

@ -155,6 +155,7 @@ struct dsi_backlight_config {
u32 bl_min_level;
u32 bl_max_level;
u32 brightness_max_level;
u32 brightness_default_level;
u32 bl_level;
u32 bl_scale;
u32 bl_scale_sv;

View file

@ -212,7 +212,7 @@ static int sde_backlight_setup(struct sde_connector *c_conn,
props.type = BACKLIGHT_RAW;
props.power = FB_BLANK_UNBLANK;
props.max_brightness = bl_config->brightness_max_level;
props.brightness = bl_config->brightness_max_level;
props.brightness = bl_config->brightness_default_level;
snprintf(bl_node_name, BL_NODE_NAME_SIZE, "panel%u-backlight",
display_count);
c_conn->bl_device = backlight_device_register(bl_node_name, dev->dev,