disp: msm: dsi: add a new PWM pinctrl configure
The default PWM gpio pin mode was not right for PWM backlight control. If needs to use PWM backlight, must config the gpio pinctrl. Change-Id: I5fd6b947d379b53ef4c358be1b935a2ad4970f99 Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
b41ee8cf11
commit
b54107cfa3
@@ -477,6 +477,14 @@ static int dsi_panel_pinctrl_init(struct dsi_panel *panel)
|
||||
goto error;
|
||||
}
|
||||
|
||||
panel->pinctrl.pwm_pin =
|
||||
pinctrl_lookup_state(panel->pinctrl.pinctrl, "pwm_pin");
|
||||
|
||||
if (IS_ERR_OR_NULL(panel->pinctrl.pwm_pin)) {
|
||||
panel->pinctrl.pwm_pin = NULL;
|
||||
DSI_DEBUG("failed to get pinctrl pwm_pin");
|
||||
}
|
||||
|
||||
error:
|
||||
return rc;
|
||||
}
|
||||
@@ -649,6 +657,14 @@ static int dsi_panel_pwm_register(struct dsi_panel *panel)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (panel->pinctrl.pwm_pin) {
|
||||
rc = pinctrl_select_state(panel->pinctrl.pinctrl,
|
||||
panel->pinctrl.pwm_pin);
|
||||
if (rc)
|
||||
DSI_ERR("[%s] failed to set pwm pinctrl, rc=%d\n",
|
||||
panel->name, rc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user