disp: msm: dp: disable pluggable eDP display backlight config

Disable pluggable eDP display backlight config.

Change-Id: I7a5cde4531422a1a5db0fd59e351de570d859c4c
Signed-off-by: Boyuan Yan <quic_boyuyan@quicinc.com>
This commit is contained in:
boyuyan 2023-10-10 17:21:01 +08:00
commit bd47e3e63b
5 changed files with 20 additions and 5 deletions

View file

@ -2129,6 +2129,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
dp->dp_display.is_mst_supported = dp->parser->has_mst;
dp->dp_display.dsc_cont_pps = dp->parser->dsc_continuous_pps;
dp->dp_display.no_backlight_support = dp->parser->no_backlight_support;
dp->catalog = dp_catalog_get(dev, dp->parser);
if (IS_ERR(dp->catalog)) {
rc = PTR_ERR(dp->catalog);
@ -2633,7 +2634,7 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel)
goto end;
/*edp backlight enable and edp pwm enable*/
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_PWR, true);
if (rc) {
DP_ERR("Cannot turn edp backlight power on");
@ -2733,7 +2734,7 @@ static int dp_display_post_enable(struct dp_display *dp_display, void *panel)
dp_display_stream_post_enable(dp, dp_panel);
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_EN, true);
if (rc) {
DP_ERR("Cannot turn edp backlight power on");
@ -2803,7 +2804,7 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
goto end;
}
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_EN, false);
if (rc) {
DP_ERR("Cannot turn edp backlight power off");
@ -2886,7 +2887,7 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
goto end;
}
if (dp_display->is_edp) {
if ((dp_display->is_edp) && (!dp_display->no_backlight_support)) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_BACKLIGHT_PWR, false);
if (rc)
DP_ERR("Cannot turn edp backlight power off\n");
@ -3418,6 +3419,9 @@ static int dp_display_set_backlight(struct dp_display *dp_display,
return -EINVAL;
}
if(dp_display->no_backlight_support)
return 0;
dp = container_of(dp_display, struct dp_display_private, dp_display);
dp_panel = panel;

View file

@ -97,6 +97,7 @@ struct dp_display {
u32 max_mixer_count;
u32 max_dsc_count;
bool cont_splash_enabled;
bool no_backlight_support;
int (*enable)(struct dp_display *dp_display, void *panel);
int (*post_enable)(struct dp_display *dp_display, void *panel);

View file

@ -295,6 +295,8 @@ static void dp_parser_bl_config(struct dp_parser *parser)
} else {
parser->pwm_period_usecs = val;
}
parser->no_backlight_support = of_property_read_bool(of_node,
"qcom,no-backlight-support");
}
static int dp_parser_gpio(struct dp_parser *parser)

View file

@ -231,6 +231,7 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
* @has_mst_sideband: MST sideband feature enable status
* @no_aux_switch: presence AUX switch status
* @gpio_aux_switch: presence GPIO AUX switch status
* @no_backlight_support: For some display type that no support backlight
* @dsc_feature_enable: DSC feature enable status
* @fec_feature_enable: FEC feature enable status
* @dsc_continuous_pps: PPS sent every frame by HW
@ -271,6 +272,7 @@ struct dp_parser {
bool gpio_aux_switch;
bool lphw_hpd;
bool panel_notifier_support;
bool no_backlight_support;
u32 bl_min_level;
u32 bl_max_level;
u32 brightness_max_level;

View file

@ -746,7 +746,13 @@ static int dp_power_edp_panel_set_gpio(struct dp_power *dp_power,
return -EINVAL;
if ((pin_state >= DP_GPIO_EDP_MIN) && (pin_state < DP_GPIO_EDP_MAX)) {
gpio_direction_output(config[pin_state].gpio, enable);
if (gpio_is_valid(config[pin_state].gpio)) {
rc = gpio_direction_output(config[pin_state].gpio, enable);
if (rc)
DP_ERR("unable to set gpio rc=%d\n", rc);
} else {
DP_ERR("gpio invalid for %d pin\n", pin_state);
}
} else {
pr_err(" Invalid GPIO call\n");
return -EINVAL;