Commit f31b2a9b authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Wim Van Sebroeck

watchdog: da9062: Disable and wait before changing timeout

The DA9062 watchdog occasionally enters error condition and resets the
system if the timeout is changed quickly after the timer was enabled.

The method of disabling and waiting for > 150 µs before setting the
new timeout is taken from the DA9052 driver.
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 540f6351
...@@ -100,6 +100,13 @@ static int da9062_wdt_update_timeout_register(struct da9062_watchdog *wdt, ...@@ -100,6 +100,13 @@ static int da9062_wdt_update_timeout_register(struct da9062_watchdog *wdt,
if (ret) if (ret)
return ret; return ret;
regmap_update_bits(chip->regmap,
DA9062AA_CONTROL_D,
DA9062AA_TWDSCALE_MASK,
DA9062_TWDSCALE_DISABLE);
usleep_range(150, 300);
return regmap_update_bits(chip->regmap, return regmap_update_bits(chip->regmap,
DA9062AA_CONTROL_D, DA9062AA_CONTROL_D,
DA9062AA_TWDSCALE_MASK, DA9062AA_TWDSCALE_MASK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment