linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: sun4i: Round delay time up to a nearest jiffy
@ 2021-04-28  0:19 Roman Beranek
  2021-04-28  6:13 ` Uwe Kleine-König
  0 siblings, 1 reply; 10+ messages in thread
From: Roman Beranek @ 2021-04-28  0:19 UTC (permalink / raw)
  To: Thierry Reding, Uwe Kleine-König, Lee Jones, Maxime Ripard,
	Chen-Yu Tsai, Jernej Skrabec
  Cc: linux-pwm, linux-arm-kernel, linux-sunxi, linux-sunxi, Roman Beranek

More often than not, a PWM period may span nowhere near as far
as 1 jiffy, yet it still must be waited upon before the channel
is disabled.

Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
---
 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 ce5c4fc8d..f4b991048 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 +
-		nsecs_to_jiffies(cstate.period + 1000);
+		nsecs_to_jiffies(cstate.period) + 1;
 
 	if (state->polarity != PWM_POLARITY_NORMAL)
 		ctrl &= ~BIT_CH(PWM_ACT_STATE, pwm->hwpwm);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-30 16:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28  0:19 [PATCH] pwm: sun4i: Round delay time up to a nearest jiffy Roman Beranek
2021-04-28  6:13 ` Uwe Kleine-König
2021-04-28 12:14   ` Roman Beránek
2021-04-29 12:04     ` Uwe Kleine-König
2021-04-30  2:19       ` Roman Beránek
2021-04-30  6:41         ` Uwe Kleine-König
2021-04-30  7:17           ` Roman Beranek
2021-04-30  9:51             ` Uwe Kleine-König
2021-04-30 15:10               ` Roman Beranek
2021-04-30 16:18                 ` [linux-sunxi] " dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).