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;
|
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:
|
error:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -649,6 +657,14 @@ static int dsi_panel_pwm_register(struct dsi_panel *panel)
|
|||||||
return rc;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,6 +97,7 @@ struct dsi_pinctrl_info {
|
|||||||
struct pinctrl *pinctrl;
|
struct pinctrl *pinctrl;
|
||||||
struct pinctrl_state *active;
|
struct pinctrl_state *active;
|
||||||
struct pinctrl_state *suspend;
|
struct pinctrl_state *suspend;
|
||||||
|
struct pinctrl_state *pwm_pin;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dsi_panel_phy_props {
|
struct dsi_panel_phy_props {
|
||||||
|
Reference in New Issue
Block a user