summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-09-06 11:28:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-09-06 11:28:14 -0700
commit8654fa5ca3514263a079886b57521bcb20ee7cfd (patch)
treefa724a8d7fc04ba32d05b2fcdbe683e4001f55db
parentea462f0fa438381e0d420f94193c075e2a114894 (diff)
parent10c48e9a8fd5e524d37559cf4a06039b4c25db48 (diff)
downloadlwn-8654fa5ca3514263a079886b57521bcb20ee7cfd.tar.gz
lwn-8654fa5ca3514263a079886b57521bcb20ee7cfd.zip
Merge tag 'pwm/for-6.11-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux
Pull pwm fix from Uwe Kleine-König: "Fix an off-by-one in the stm32 driver. Hardware engineers tend to start counting at 1 while the software guys usually start with 0. This isn't so nice because that results in drivers where pwm device #2 needs to use the hardware registers with index 3. This was noticed by Fabrice Gasnier. A small patch fixing that mismatch is the only change included here" * tag 'pwm/for-6.11-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux: pwm: stm32: Use the right CCxNP bit in stm32_pwm_enable()
-rw-r--r--drivers/pwm/pwm-stm32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index fd754a99cf2e..f85eb41cb084 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -412,7 +412,7 @@ static int stm32_pwm_enable(struct stm32_pwm *priv, unsigned int ch)
/* Enable channel */
mask = TIM_CCER_CCxE(ch + 1);
if (priv->have_complementary_output)
- mask |= TIM_CCER_CCxNE(ch);
+ mask |= TIM_CCER_CCxNE(ch + 1);
regmap_set_bits(priv->regmap, TIM_CCER, mask);