Lines Matching refs:wdt_dev
52 struct watchdog_device wdt_dev; member
61 static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev) in lpc18xx_wdt_feed() argument
63 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_feed()
81 struct watchdog_device *wdt_dev = &lpc18xx_wdt->wdt_dev; in lpc18xx_wdt_timer_feed() local
83 lpc18xx_wdt_feed(wdt_dev); in lpc18xx_wdt_timer_feed()
87 msecs_to_jiffies((wdt_dev->timeout * MSEC_PER_SEC) / 2)); in lpc18xx_wdt_timer_feed()
94 static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev) in lpc18xx_wdt_stop() argument
96 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_stop()
107 val = DIV_ROUND_UP(lpc18xx_wdt->wdt_dev.timeout * lpc18xx_wdt->clk_rate, in __lpc18xx_wdt_set_timeout()
112 static int lpc18xx_wdt_set_timeout(struct watchdog_device *wdt_dev, in lpc18xx_wdt_set_timeout() argument
115 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_set_timeout()
117 lpc18xx_wdt->wdt_dev.timeout = new_timeout; in lpc18xx_wdt_set_timeout()
123 static unsigned int lpc18xx_wdt_get_timeleft(struct watchdog_device *wdt_dev) in lpc18xx_wdt_get_timeleft() argument
125 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_get_timeleft()
132 static int lpc18xx_wdt_start(struct watchdog_device *wdt_dev) in lpc18xx_wdt_start() argument
134 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_start()
150 lpc18xx_wdt_feed(wdt_dev); in lpc18xx_wdt_start()
155 static int lpc18xx_wdt_restart(struct watchdog_device *wdt_dev, in lpc18xx_wdt_restart() argument
158 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); in lpc18xx_wdt_restart()
232 lpc18xx_wdt->wdt_dev.info = &lpc18xx_wdt_info; in lpc18xx_wdt_probe()
233 lpc18xx_wdt->wdt_dev.ops = &lpc18xx_wdt_ops; in lpc18xx_wdt_probe()
235 lpc18xx_wdt->wdt_dev.min_timeout = DIV_ROUND_UP(LPC18XX_WDT_TC_MIN * in lpc18xx_wdt_probe()
238 lpc18xx_wdt->wdt_dev.max_timeout = (LPC18XX_WDT_TC_MAX * in lpc18xx_wdt_probe()
241 lpc18xx_wdt->wdt_dev.timeout = min(lpc18xx_wdt->wdt_dev.max_timeout, in lpc18xx_wdt_probe()
246 lpc18xx_wdt->wdt_dev.parent = dev; in lpc18xx_wdt_probe()
247 watchdog_set_drvdata(&lpc18xx_wdt->wdt_dev, lpc18xx_wdt); in lpc18xx_wdt_probe()
249 watchdog_init_timeout(&lpc18xx_wdt->wdt_dev, heartbeat, dev); in lpc18xx_wdt_probe()
255 watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout); in lpc18xx_wdt_probe()
256 watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128); in lpc18xx_wdt_probe()
260 watchdog_stop_on_reboot(&lpc18xx_wdt->wdt_dev); in lpc18xx_wdt_probe()
261 return devm_watchdog_register_device(dev, &lpc18xx_wdt->wdt_dev); in lpc18xx_wdt_probe()