Message ID | 436e1a50e603eefb24c8e7b2bd7f7e4838b90e12.1586414867.git.gurus@codeaurora.org |
---|---|
State | Superseded |
Headers | show |
Series | Convert PWM period and duty cycle to u64 | expand |
On Wed, Apr 08, 2020 at 11:52:37PM -0700, Guru Das Srinagesh wrote: > 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. > > Cc: Maxime Ripard <mripard@kernel.org> > Cc: Chen-Yu Tsai <wens@csie.org> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > > Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org> > --- > drivers/pwm/pwm-sun4i.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c > index 5c677c5..1694e69 100644 > --- a/drivers/pwm/pwm-sun4i.c > +++ b/drivers/pwm/pwm-sun4i.c > @@ -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); > -- Hi Chen-Yu, You had provided your "Acked-by:" [1] for an earlier version of this patch but now that I've revised the patch based on a review comment I received [2], could you please review this patch once again? Thank you. Guru Das. [1] https://www.spinics.net/lists/linux-pwm/msg11755.html [2] https://www.spinics.net/lists/linux-pwm/msg11956.html
On Thu, Apr 9, 2020 at 2:53 PM Guru Das Srinagesh <gurus@codeaurora.org> wrote: > > 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. > > Cc: Maxime Ripard <mripard@kernel.org> > Cc: Chen-Yu Tsai <wens@csie.org> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > > Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org> Acked-by: Chen-Yu Tsai <wens@csie.org>
diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c index 5c677c5..1694e69 100644 --- a/drivers/pwm/pwm-sun4i.c +++ b/drivers/pwm/pwm-sun4i.c @@ -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);
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. Cc: Maxime Ripard <mripard@kernel.org> Cc: Chen-Yu Tsai <wens@csie.org> Cc: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org> --- drivers/pwm/pwm-sun4i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)