mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge 0074d1108b on remote branch
Change-Id: Ic7b46a1105c5b10666c94ad9c363c340d038ffd8
This commit is contained in:
commit
568f70435b
2 changed files with 40 additions and 0 deletions
|
|
@ -2466,10 +2466,30 @@ static void dp_display_update_dsc_resources(struct dp_display_private *dp,
|
|||
}
|
||||
}
|
||||
|
||||
static int dp_display_set_pinctrl_state(struct dp_pinctrl *pinctrl,
|
||||
struct pinctrl_state *state)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (pinctrl && !IS_ERR_OR_NULL(state)) {
|
||||
rc = pinctrl_select_state(pinctrl->pin, state);
|
||||
if (rc) {
|
||||
DP_ERR("failed to set pin state, rc=%d\n", rc);
|
||||
}
|
||||
} else {
|
||||
rc = -EINVAL;
|
||||
DP_DEBUG("pinctrl state does not exist\n");
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int dp_display_enable(struct dp_display *dp_display, void *panel)
|
||||
{
|
||||
int rc = 0;
|
||||
struct dp_display_private *dp;
|
||||
struct dp_parser *parser;
|
||||
struct dp_pinctrl *pinctrl;
|
||||
|
||||
if (!dp_display || !panel) {
|
||||
DP_ERR("invalid input\n");
|
||||
|
|
@ -2520,6 +2540,24 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel)
|
|||
DP_ERR("Cannot turn edp PWM on ");
|
||||
goto end;
|
||||
}
|
||||
|
||||
parser = dp->parser;
|
||||
if (!parser) {
|
||||
DP_ERR("failed to get parser");
|
||||
} else {
|
||||
pinctrl = &parser->pinctrl;
|
||||
pinctrl->pin = devm_pinctrl_get(&dp->parser->pdev->dev);
|
||||
|
||||
if (!IS_ERR_OR_NULL(pinctrl->pin)) {
|
||||
pinctrl->state_bl_pwm = pinctrl_lookup_state(pinctrl->pin,
|
||||
"mdss_edp_bl_pwm");
|
||||
rc = dp_display_set_pinctrl_state(pinctrl, pinctrl->state_bl_pwm);
|
||||
if (rc)
|
||||
DP_DEBUG("failed to set pinctrl, rc=%d\n", rc);
|
||||
} else {
|
||||
DP_DEBUG("failed to get pinctrl");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dp_display_update_dsc_resources(dp, panel, true);
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ struct dp_io {
|
|||
* @state_active: active state pin control
|
||||
* @state_hpd_active: hpd active state pin control
|
||||
* @state_suspend: suspend state pin control
|
||||
* @state_bl_pwm: backlight pwm pin control
|
||||
*/
|
||||
struct dp_pinctrl {
|
||||
struct pinctrl *pin;
|
||||
|
|
@ -108,6 +109,7 @@ struct dp_pinctrl {
|
|||
struct pinctrl_state *state_hpd_tlmm;
|
||||
struct pinctrl_state *state_hpd_ctrl;
|
||||
struct pinctrl_state *state_suspend;
|
||||
struct pinctrl_state *state_bl_pwm;
|
||||
};
|
||||
|
||||
#define DP_ENUM_STR(x) #x
|
||||
|
|
|
|||
Loading…
Reference in a new issue