Lines Matching +full:wdt +full:- +full:enable +full:- +full:once
1 // SPDX-License-Identifier: GPL-2.0
18 /* WDT timer setting register */
23 /* WDT reset selection register */
29 /* WDT control register */
62 ret = regmap_write_bits(wdev->regmap, WDTCTRL, in uniphier_watchdog_ping()
69 ret = regmap_read_poll_timeout(wdev->regmap, WDTCTRL, val, in uniphier_watchdog_ping()
93 /* Enable and clear watchdog */ in __uniphier_watchdog_start()
129 tmp_timeout = roundup_pow_of_two(w->timeout); in uniphier_watchdog_start()
131 return __uniphier_watchdog_start(wdev->regmap, tmp_timeout); in uniphier_watchdog_start()
138 return __uniphier_watchdog_stop(wdev->regmap); in uniphier_watchdog_stop()
149 if (tmp_timeout == w->timeout) in uniphier_watchdog_set_timeout()
153 ret = __uniphier_watchdog_restart(wdev->regmap, tmp_timeout); in uniphier_watchdog_set_timeout()
158 w->timeout = tmp_timeout; in uniphier_watchdog_set_timeout()
167 .identity = "uniphier-wdt",
184 struct device *dev = &pdev->dev; in uniphier_wdt_probe()
192 return -ENOMEM; in uniphier_wdt_probe()
194 parent = of_get_parent(dev->of_node); /* parent should be syscon node */ in uniphier_wdt_probe()
200 wdev->regmap = regmap; in uniphier_wdt_probe()
201 wdev->wdt_dev.info = &uniphier_wdt_info; in uniphier_wdt_probe()
202 wdev->wdt_dev.ops = &uniphier_wdt_ops; in uniphier_wdt_probe()
203 wdev->wdt_dev.max_timeout = WDT_PERIOD_MAX; in uniphier_wdt_probe()
204 wdev->wdt_dev.min_timeout = WDT_PERIOD_MIN; in uniphier_wdt_probe()
205 wdev->wdt_dev.timeout = WDT_DEFAULT_TIMEOUT; in uniphier_wdt_probe()
206 wdev->wdt_dev.parent = dev; in uniphier_wdt_probe()
208 watchdog_init_timeout(&wdev->wdt_dev, timeout, dev); in uniphier_wdt_probe()
209 watchdog_set_nowayout(&wdev->wdt_dev, nowayout); in uniphier_wdt_probe()
210 watchdog_stop_on_reboot(&wdev->wdt_dev); in uniphier_wdt_probe()
212 watchdog_set_drvdata(&wdev->wdt_dev, wdev); in uniphier_wdt_probe()
214 uniphier_watchdog_stop(&wdev->wdt_dev); in uniphier_wdt_probe()
215 ret = regmap_write(wdev->regmap, WDTRSTSEL, WDTRSTSEL_RSTSEL_BOTH); in uniphier_wdt_probe()
219 ret = devm_watchdog_register_device(dev, &wdev->wdt_dev); in uniphier_wdt_probe()
224 wdev->wdt_dev.timeout, nowayout); in uniphier_wdt_probe()
230 { .compatible = "socionext,uniphier-wdt" },
238 .name = "uniphier-wdt",
252 "Watchdog cannot be stopped once started (default="