aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2017-10-17 11:30:26 -0400
committerWim Van Sebroeck <wim@iguana.be>2017-12-28 14:45:08 -0500
commitfb484262f9ef0d73e0116b942c114bc48c6c7b3b (patch)
tree55306fe03d26ad6d5f6aef06ef49317b8824f48a
parentf31b2a9bdeaea38957f4675ee0d1b8421595dc67 (diff)
watchdog: da9062: use protection delay mechanism from core
This patch removes the windows protection routine that got now covered by the wdt core. 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>
-rw-r--r--drivers/watchdog/da9062_wdt.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c
index dbb970e87d3d..814dff6045a4 100644
--- a/drivers/watchdog/da9062_wdt.c
+++ b/drivers/watchdog/da9062_wdt.c
@@ -46,22 +46,6 @@ static void da9062_set_window_start(struct da9062_watchdog *wdt)
46 wdt->j_time_stamp = jiffies; 46 wdt->j_time_stamp = jiffies;
47} 47}
48 48
49static void da9062_apply_window_protection(struct da9062_watchdog *wdt)
50{
51 unsigned long delay = msecs_to_jiffies(DA9062_RESET_PROTECTION_MS);
52 unsigned long timeout = wdt->j_time_stamp + delay;
53 unsigned long now = jiffies;
54 unsigned int diff_ms;
55
56 /* if time-limit has not elapsed then wait for remainder */
57 if (time_before(now, timeout)) {
58 diff_ms = jiffies_to_msecs(timeout-now);
59 dev_dbg(wdt->hw->dev,
60 "Kicked too quickly. Delaying %u msecs\n", diff_ms);
61 msleep(diff_ms);
62 }
63}
64
65static unsigned int da9062_wdt_timeout_to_sel(unsigned int secs) 49static unsigned int da9062_wdt_timeout_to_sel(unsigned int secs)
66{ 50{
67 unsigned int i; 51 unsigned int i;
@@ -78,8 +62,6 @@ static int da9062_reset_watchdog_timer(struct da9062_watchdog *wdt)
78{ 62{
79 int ret; 63 int ret;
80 64
81 da9062_apply_window_protection(wdt);
82
83 ret = regmap_update_bits(wdt->hw->regmap, 65 ret = regmap_update_bits(wdt->hw->regmap,
84 DA9062AA_CONTROL_F, 66 DA9062AA_CONTROL_F,
85 DA9062AA_WATCHDOG_MASK, 67 DA9062AA_WATCHDOG_MASK,
@@ -242,6 +224,7 @@ static int da9062_wdt_probe(struct platform_device *pdev)
242 wdt->wdtdev.ops = &da9062_watchdog_ops; 224 wdt->wdtdev.ops = &da9062_watchdog_ops;
243 wdt->wdtdev.min_timeout = DA9062_WDT_MIN_TIMEOUT; 225 wdt->wdtdev.min_timeout = DA9062_WDT_MIN_TIMEOUT;
244 wdt->wdtdev.max_timeout = DA9062_WDT_MAX_TIMEOUT; 226 wdt->wdtdev.max_timeout = DA9062_WDT_MAX_TIMEOUT;
227 wdt->wdtdev.min_hw_heartbeat_ms = DA9062_RESET_PROTECTION_MS;
245 wdt->wdtdev.timeout = DA9062_WDG_DEFAULT_TIMEOUT; 228 wdt->wdtdev.timeout = DA9062_WDG_DEFAULT_TIMEOUT;
246 wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS; 229 wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS;
247 wdt->wdtdev.parent = &pdev->dev; 230 wdt->wdtdev.parent = &pdev->dev;