From: Uwe Kleine-König Date: Thu, 5 Sep 2024 09:06:24 +0000 (+0200) Subject: pwm: stm32: Use the right CCxNP bit in stm32_pwm_enable() X-Git-Tag: microblaze-v6.13~160^2~18 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=10c48e9a8fd5e524d37559cf4a06039b4c25db48;p=linux-2.6-microblaze.git 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: 7cea05ae1d4e ("pwm-stm32: Make use of parametrised register definitions") Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20240905090627.197536-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König --- 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);