Commit c7dcccae authored by Guru Das Srinagesh's avatar Guru Das Srinagesh Committed by Thierry Reding

pwm: sun4i: Use nsecs_to_jiffies to avoid a division

Since the PWM framework is switching struct pwm_state.period's datatype
to u64, prepare for this transition by using nsecs_to_jiffies() which
does away with the need for a division operation.
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 4cc23430
......@@ -285,7 +285,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
val = (duty & PWM_DTY_MASK) | PWM_PRD(period);
sun4i_pwm_writel(sun4i_pwm, val, PWM_CH_PRD(pwm->hwpwm));
sun4i_pwm->next_period[pwm->hwpwm] = jiffies +
usecs_to_jiffies(cstate.period / 1000 + 1);
nsecs_to_jiffies(cstate.period + 1000);
if (state->polarity != PWM_POLARITY_NORMAL)
ctrl &= ~BIT_CH(PWM_ACT_STATE, pwm->hwpwm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment