Lines Matching +full:soft +full:- +full:start
1 // SPDX-License-Identifier: GPL-2.0+
7 * Copyright (C) 2012-2013 Hauke Mehrtens <hauke@hauke-m.de>
52 wdt->timer_set_ms(wdt, wdd->timeout * 1000); in bcm47xx_wdt_hard_keepalive()
66 wdt->timer_set(wdt, 0); in bcm47xx_wdt_hard_stop()
75 u32 max_timer = wdt->max_timer_ms; in bcm47xx_wdt_hard_set_timeout()
80 return -EINVAL; in bcm47xx_wdt_hard_set_timeout()
83 wdd->timeout = new_time; in bcm47xx_wdt_hard_set_timeout()
92 wdt->timer_set(wdt, 1); in bcm47xx_wdt_restart()
99 .start = bcm47xx_wdt_hard_start,
109 u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); in bcm47xx_wdt_soft_timer_tick()
111 if (!atomic_dec_and_test(&wdt->soft_ticks)) { in bcm47xx_wdt_soft_timer_tick()
112 wdt->timer_set_ms(wdt, next_tick); in bcm47xx_wdt_soft_timer_tick()
113 mod_timer(&wdt->soft_timer, jiffies + HZ); in bcm47xx_wdt_soft_timer_tick()
123 atomic_set(&wdt->soft_ticks, wdd->timeout); in bcm47xx_wdt_soft_keepalive()
133 bcm47xx_wdt_soft_timer_tick(&wdt->soft_timer); in bcm47xx_wdt_soft_start()
142 timer_delete_sync(&wdt->soft_timer); in bcm47xx_wdt_soft_stop()
143 wdt->timer_set(wdt, 0); in bcm47xx_wdt_soft_stop()
154 return -EINVAL; in bcm47xx_wdt_soft_set_timeout()
157 wdd->timeout = new_time; in bcm47xx_wdt_soft_set_timeout()
170 .start = bcm47xx_wdt_soft_start,
180 bool soft; in bcm47xx_wdt_probe() local
181 struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev); in bcm47xx_wdt_probe()
184 return -ENXIO; in bcm47xx_wdt_probe()
186 soft = wdt->max_timer_ms < WDT_SOFTTIMER_THRESHOLD * 1000; in bcm47xx_wdt_probe()
188 if (soft) { in bcm47xx_wdt_probe()
189 wdt->wdd.ops = &bcm47xx_wdt_soft_ops; in bcm47xx_wdt_probe()
190 timer_setup(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick, 0); in bcm47xx_wdt_probe()
192 wdt->wdd.ops = &bcm47xx_wdt_hard_ops; in bcm47xx_wdt_probe()
195 wdt->wdd.info = &bcm47xx_wdt_info; in bcm47xx_wdt_probe()
196 wdt->wdd.timeout = WDT_DEFAULT_TIME; in bcm47xx_wdt_probe()
197 wdt->wdd.parent = &pdev->dev; in bcm47xx_wdt_probe()
198 ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout); in bcm47xx_wdt_probe()
201 watchdog_set_nowayout(&wdt->wdd, nowayout); in bcm47xx_wdt_probe()
202 watchdog_set_restart_priority(&wdt->wdd, 64); in bcm47xx_wdt_probe()
203 watchdog_stop_on_reboot(&wdt->wdd); in bcm47xx_wdt_probe()
205 ret = devm_watchdog_register_device(&pdev->dev, &wdt->wdd); in bcm47xx_wdt_probe()
209 dev_info(&pdev->dev, "BCM47xx Watchdog Timer enabled (%d seconds%s%s)\n", in bcm47xx_wdt_probe()
211 soft ? ", Software Timer" : ""); in bcm47xx_wdt_probe()
215 if (soft) in bcm47xx_wdt_probe()
216 timer_delete_sync(&wdt->soft_timer); in bcm47xx_wdt_probe()
223 .name = "bcm47xx-wdt",
231 MODULE_AUTHOR("Hauke Mehrtens <hauke@hauke-m.de>");