msm: mdss: Remove pwm_disable from backlight pwm driver

The PWM implementation has been reconfigured so that pwm_enable only
needs to be called once for the life of the MDSS driver. The new
implementation allows the driver to call pwm_config in order to change
the backlight without needing to disable and enable. The backlight PWM
driver is disabled when the panel is turned off, and reenabled when the
panel comes up.

Change-Id: Ieba05921b53eb1cf686aaa2751f9cc3650522bb7
Signed-off-by: Benet Clark <benetc@codeaurora.org>
This commit is contained in:
Benet Clark 2014-07-28 12:37:37 -07:00
parent 17a5e3c020
commit b6ca2c2f61

View File

@ -35,6 +35,7 @@ void mdss_dsi_panel_pwm_cfg(struct mdss_dsi_ctrl_pdata *ctrl)
pr_err("%s: Error: lpg_chan=%d pwm request failed",
__func__, ctrl->pwm_lpg_chan);
}
ctrl->pwm_enabled = 0;
}
static void mdss_dsi_panel_bklt_pwm(struct mdss_dsi_ctrl_pdata *ctrl, int level)
@ -65,11 +66,6 @@ static void mdss_dsi_panel_bklt_pwm(struct mdss_dsi_ctrl_pdata *ctrl, int level)
pr_debug("%s: ndx=%d level=%d duty=%d\n", __func__,
ctrl->ndx, level, duty);
if (ctrl->pwm_enabled) {
pwm_disable(ctrl->pwm_bl);
ctrl->pwm_enabled = 0;
}
if (ctrl->pwm_period >= USEC_PER_SEC) {
ret = pwm_config_us(ctrl->pwm_bl, duty, ctrl->pwm_period);
if (ret) {
@ -89,10 +85,13 @@ static void mdss_dsi_panel_bklt_pwm(struct mdss_dsi_ctrl_pdata *ctrl, int level)
}
}
ret = pwm_enable(ctrl->pwm_bl);
if (ret)
pr_err("%s: pwm_enable() failed err=%d\n", __func__, ret);
ctrl->pwm_enabled = 1;
if (!ctrl->pwm_enabled) {
ret = pwm_enable(ctrl->pwm_bl);
if (ret)
pr_err("%s: pwm_enable() failed err=%d\n", __func__,
ret);
ctrl->pwm_enabled = 1;
}
}
static char dcs_cmd[2] = {0x54, 0x00}; /* DTYPE_DCS_READ */