All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/6] pwm: tegra: several improvements
@ 2021-06-17  9:51 Uwe Kleine-König
  2021-06-17  9:51 ` [PATCH v1 1/6] pwm: tegra: Drop an if block with an always false condition Uwe Kleine-König
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2021-06-17  9:51 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones
  Cc: Jonathan Hunter, Philipp Zabel, linux-pwm, linux-tegra, kernel

This series improves the tegra-pwm driver. There are a few problems left though:

 - if the PWM is configured to a 100% duty cycle it writes bit 24 which is
   either bogus or needs a comment.

 - clock handling is broken: If pwm_disable() is called without calling
   pwm_enable() before, this triggers a warning in clk_disable(). This also 
   might trigger a HW fault as the register is accessed without enabling the
   clock first.

 - The calculation of period and duty_cycle is imprecise as it divides by the
   result of a division and it discards relevant bits from pc->clk_rate without
   rounding. (I bet there are more problems, I only checked quickly
   trying to implement .get_state(), but I gave up.)

I didn't address these because I have neither any hardware to test nor
documentation. So this series is only compile tested.

Best regards
Uwe

Uwe Kleine-König (6):
  pwm: tegra: Drop an if block with an always false condition
  pwm: tegra: Don't modify HW state in .remove callback
  pwm: tegra: Don't needlessly enable and disable the clock in .remove()
  pwm: tegra: Assert reset only after the PWM was unregistered
  pwm: tegra: Implement .apply callback
  pwm: tegra: unfold legacy callbacks into tegra_pwm_apply()

 drivers/pwm/pwm-tegra.c | 246 ++++++++++++++++++----------------------
 1 file changed, 112 insertions(+), 134 deletions(-)

-- 
2.30.2


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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17  9:51 [PATCH v1 0/6] pwm: tegra: several improvements Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 1/6] pwm: tegra: Drop an if block with an always false condition Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 2/6] pwm: tegra: Don't modify HW state in .remove callback Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 3/6] pwm: tegra: Don't needlessly enable and disable the clock in .remove() Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 4/6] pwm: tegra: Assert reset only after the PWM was unregistered Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 5/6] pwm: tegra: Implement .apply callback Uwe Kleine-König
2021-06-28 12:29   ` Thierry Reding
2021-06-28 16:46     ` Uwe Kleine-König
2021-07-16  7:30   ` Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 6/6] pwm: tegra: unfold legacy callbacks into tegra_pwm_apply() Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.