Linux PWM subsystem development
 help / color / mirror / Atom feed
* is pwm_put supposed to stop a PWM?
@ 2018-10-25 19:45 Uwe Kleine-König
  2018-10-29 11:48 ` Thierry Reding
  0 siblings, 1 reply; 17+ messages in thread
From: Uwe Kleine-König @ 2018-10-25 19:45 UTC (permalink / raw)
  To: Thierry Reding, Ariel D'Alessandro; +Cc: linux-pwm, kernel, Boris Brezillon

Hello,

while digging around in the pwm drivers I found
drivers/pwm/pwm-lpc18xx-sct.c which in its .free callback calls
pwm_disable() and pwm_set_duty_cycle(pwm, 0).

I think calling pwm_disable is wrong for two reasons:

 a) pwm_disable is for PWM users, not for drivers
 b) .free isn't supposed to stop the pwm.

Also I'm surprised that .request calls pwm_get_duty_cycle() and writes
the result into hardware. Still more as I think pwm_get_duty_cycle()
always returns 0 in .request.

BTW, this is the only caller of pwm_set_duty_cycle(), so if the driver
is simplified/fixed to not care about the duty cycle in .free and
.request, this function can go away.

What do you think?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

end of thread, other threads:[~2018-11-20 15:42 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-25 19:45 is pwm_put supposed to stop a PWM? Uwe Kleine-König
2018-10-29 11:48 ` Thierry Reding
2018-11-03 14:49   ` Uwe Kleine-König
2018-11-14  9:30     ` Uwe Kleine-König
2018-11-14 11:50       ` Thierry Reding
2018-11-15  8:42         ` Uwe Kleine-König
2018-11-15 15:43           ` Thierry Reding
2018-11-15 20:46             ` Uwe Kleine-König
2018-11-16  6:52         ` [PATCH] pwm: lpc18xx-sct: don't reconfigure PWM in .request and .free Uwe Kleine-König
2018-11-16  7:02           ` Uwe Kleine-König
2018-11-16  9:22           ` Vladimir Zapolskiy
2018-11-16  9:48             ` Uwe Kleine-König
2018-11-16 10:01             ` Thierry Reding
2018-11-16 10:45               ` Uwe Kleine-König
2018-11-16 10:05           ` Thierry Reding
2018-11-19 19:55             ` Uwe Kleine-König
2018-11-20 15:42               ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox