mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
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 <fabrice.gasnier@foss.st.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230413212339.3611722-1-u.kleine-koenig@pengutronix.de/ Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
This commit is contained in:
parent
a4ec431fbf
commit
5272145d5c
@ -342,6 +342,9 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, priv);
|
||||
|
||||
/* Reset input selector to its default input */
|
||||
regmap_write(priv->regmap, TIM_TISEL, 0x0);
|
||||
|
||||
/* Register Counter device */
|
||||
ret = devm_counter_add(dev, counter);
|
||||
if (ret < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user