Skip to content

Commit

Permalink
Merge tag 'pwm/for-6.12-rc7-fixes' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/ukleinek/linux

Pull pwm fix from Uwe Kleine-König:
 "Fix period setting in imx-tpm driver and a maintainer update

  Erik Schumacher found and fixed a problem in the calculation of the
  PWM period setting yielding too long periods. Trevor Gamblin - who
  already cared about mainlining the pwm-axi-pwmgen driver - stepped
  forward as an additional reviewer.

  Thanks to Erik and Trevor"

* tag 'pwm/for-6.12-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux:
  MAINTAINERS: add self as reviewer for AXI PWM GENERATOR
  pwm: imx-tpm: Use correct MODULO value for EPWM mode
  • Loading branch information
Linus Torvalds committed Nov 7, 2024
2 parents 84b9749 + 517fb4d commit 80fb253
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3745,6 +3745,7 @@ F: drivers/spi/spi-axi-spi-engine.c
AXI PWM GENERATOR
M: Michael Hennerich <michael.hennerich@analog.com>
M: Nuno Sá <nuno.sa@analog.com>
R: Trevor Gamblin <tgamblin@baylibre.com>
L: linux-pwm@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
Expand Down
4 changes: 3 additions & 1 deletion drivers/pwm/pwm-imx-tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ static int pwm_imx_tpm_round_state(struct pwm_chip *chip,
p->prescale = prescale;

period_count = (clock_unit + ((1 << prescale) >> 1)) >> prescale;
p->mod = period_count;
if (period_count == 0)
return -EINVAL;
p->mod = period_count - 1;

/* calculate real period HW can support */
tmp = (u64)period_count << prescale;
Expand Down

0 comments on commit 80fb253

Please sign in to comment.