Skip to content

Commit

Permalink
pwm: stm32: Use the right CCxNP bit in stm32_pwm_enable()
Browse files Browse the repository at this point in the history
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 <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20240905090627.197536-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
  • Loading branch information
Uwe Kleine-König authored and Uwe Kleine-König committed Sep 5, 2024
1 parent 8400291 commit 10c48e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 10c48e9

Please sign in to comment.