Skip to content

Commit 10c48e9

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: stm32: Use the right CCxNP bit in stm32_pwm_enable()
The pwm devices for a pwm_chip are numbered starting at 0, the first hw channel however has the number 1. While introducing a parametrised macro to simplify register bit usage and making that offset explicit, one of the usages was converted wrongly. This is fixed here. Fixes: 7cea05a ("pwm-stm32: Make use of parametrised register definitions") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 8400291 commit 10c48e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int stm32_pwm_enable(struct stm32_pwm *priv, unsigned int ch)
412412
/* Enable channel */
413413
mask = TIM_CCER_CCxE(ch + 1);
414414
if (priv->have_complementary_output)
415-
mask |= TIM_CCER_CCxNE(ch);
415+
mask |= TIM_CCER_CCxNE(ch + 1);
416416

417417
regmap_set_bits(priv->regmap, TIM_CCER, mask);
418418

0 commit comments

Comments
 (0)