Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9239fb2e authored by Wenjun Zhang's avatar Wenjun Zhang Committed by Gerrit - the friendly Code Review server
Browse files

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.

Change-Id: I2b2d7c62ced83ce4a8062c70febfc87e57725675
Signed-off-by: default avatarWenjun Zhang <wjzhan@codeaurora.org>
parent de93b24f
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2212,6 +2212,16 @@ static int dsi_panel_parse_bl_config(struct dsi_panel *panel)
		panel->bl_config.brightness_max_level = val;
		panel->bl_config.brightness_max_level = val;
	}
	}


	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;
	}

	if (panel->bl_config.type == DSI_BACKLIGHT_PWM) {
	if (panel->bl_config.type == DSI_BACKLIGHT_PWM) {
		rc = dsi_panel_parse_bl_pwm_config(panel);
		rc = dsi_panel_parse_bl_pwm_config(panel);
		if (rc) {
		if (rc) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -105,6 +105,7 @@ struct dsi_backlight_config {
	u32 bl_min_level;
	u32 bl_min_level;
	u32 bl_max_level;
	u32 bl_max_level;
	u32 brightness_max_level;
	u32 brightness_max_level;
	u32 brightness_default_level;
	u32 bl_level;
	u32 bl_level;
	u32 bl_scale;
	u32 bl_scale;
	u32 bl_scale_ad;
	u32 bl_scale_ad;
+1 −1
Original line number Original line Diff line number Diff line
@@ -146,7 +146,7 @@ static int sde_backlight_setup(struct sde_connector *c_conn,
	display = (struct dsi_display *) c_conn->display;
	display = (struct dsi_display *) c_conn->display;
	bl_config = &display->panel->bl_config;
	bl_config = &display->panel->bl_config;
	props.max_brightness = bl_config->brightness_max_level;
	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",
	snprintf(bl_node_name, BL_NODE_NAME_SIZE, "panel%u-backlight",
							display_count);
							display_count);
	c_conn->bl_device = backlight_device_register(bl_node_name, dev->dev,
	c_conn->bl_device = backlight_device_register(bl_node_name, dev->dev,