watchdog: da9062: Disable and wait before changing timeout

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/f31b2a9bdeaea38957f4675ee0d1b8421595dc67
Commit:     f31b2a9bdeaea38957f4675ee0d1b8421595dc67
Parent:     540f635192bb222f252724f70b9240d17742f1b1
Refname:    refs/heads/master
Author:     Michael Grzeschik <[email protected]>
AuthorDate: Tue Oct 17 17:30:25 2017 +0200
Committer:  Wim Van Sebroeck <[email protected]>
CommitDate: Thu Dec 28 20:45:07 2017 +0100

    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 <[email protected]>
    Reviewed-by: Guenter Roeck <[email protected]>
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Wim Van Sebroeck <[email protected]>
---
 drivers/watchdog/da9062_wdt.c | 7 +++++++
 1 file changed, 7 insertions(+)

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,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.