@@ -162,14 +162,16 @@ static int lm3630a_intr_config(struct lm3630a_chip *pchip)
static void lm3630a_pwm_ctrl(struct lm3630a_chip *pchip, int br, int br_max)
{
- unsigned int period = pchip->pdata->pwm_period;
- unsigned int duty = br * period / br_max;
+ struct pwm_state pstate;
- pwm_config(pchip->pwmd, duty, period);
- if (duty)
- pwm_enable(pchip->pwmd);
+ pwm_get_state(pchip->pwmd, &pstate);
+ pstate.period = pchip->pdata->pwm_period;
+ pstate.duty_cycle = br * pstate.period / br_max;
+ if (pstate.duty_cycle)
+ pstate.enabled = true;
else
- pwm_disable(pchip->pwmd);
+ pstate.enabled = false;
+ pwm_apply_state(pchip->pwmd, &pstate);
}
/* update and get brightness */
pwm_config/enable/disable() have been deprecated and should be replaced by pwm_apply_state(). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> --- drivers/video/backlight/lm3630a_bl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)