diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2017-10-17 17:30:25 +0200 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2017-12-28 20:45:07 +0100 |
commit | f31b2a9bdeaea38957f4675ee0d1b8421595dc67 (patch) | |
tree | 184f6de3cedaf9d238bddf88558cfe364e2e2608 /drivers/watchdog/da9062_wdt.c | |
parent | 540f635192bb222f252724f70b9240d17742f1b1 (diff) |
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: Michael Grzeschik <m.grzeschik@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/da9062_wdt.c')
-rw-r--r-- | drivers/watchdog/da9062_wdt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c index 4349a0221548..dbb970e87d3d 100644 --- a/drivers/watchdog/da9062_wdt.c +++ b/drivers/watchdog/da9062_wdt.c @@ -100,6 +100,13 @@ static int da9062_wdt_update_timeout_register(struct da9062_watchdog *wdt, if (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, DA9062AA_CONTROL_D, DA9062AA_TWDSCALE_MASK, |