Skip to content

Commit 5272145

Browse files
Uwe Kleine-KönigWilliam Breathitt Gray
authored andcommitted
counter: stm32-timer-cnt: Reset TIM_TISEL to its default value in probe
The driver assumes that the input selection register (TIM_TISEL) is at its reset default value. Usually this is the case, but the bootloader might have modified it. This bases on a similar patch submitted by Olivier Moysan for pwm-stm32. Reviewed-by: Fabrice Gasnier <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: William Breathitt Gray <[email protected]>
1 parent a4ec431 commit 5272145

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/counter/stm32-timer-cnt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
342342

343343
platform_set_drvdata(pdev, priv);
344344

345+
/* Reset input selector to its default input */
346+
regmap_write(priv->regmap, TIM_TISEL, 0x0);
347+
345348
/* Register Counter device */
346349
ret = devm_counter_add(dev, counter);
347350
if (ret < 0)

0 commit comments

Comments
 (0)