Skip to content

Commit 80fb253

Browse files
committed
Merge tag 'pwm/for-6.12-rc7-fixes' of git://git.kernel.org/pub/scm/linux/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
2 parents 84b9749 + 517fb4d commit 80fb253

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,6 +3745,7 @@ F: drivers/spi/spi-axi-spi-engine.c
37453745
AXI PWM GENERATOR
37463746
M: Michael Hennerich <michael.hennerich@analog.com>
37473747
M: Nuno Sá <nuno.sa@analog.com>
3748+
R: Trevor Gamblin <tgamblin@baylibre.com>
37483749
L: linux-pwm@vger.kernel.org
37493750
S: Supported
37503751
W: https://ez.analog.com/linux-software-drivers

drivers/pwm/pwm-imx-tpm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ static int pwm_imx_tpm_round_state(struct pwm_chip *chip,
106106
p->prescale = prescale;
107107

108108
period_count = (clock_unit + ((1 << prescale) >> 1)) >> prescale;
109-
p->mod = period_count;
109+
if (period_count == 0)
110+
return -EINVAL;
111+
p->mod = period_count - 1;
110112

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

0 commit comments

Comments
 (0)