Lines Matching refs:wdev
31 struct watchdog_device wdev; member
35 static int msc313e_wdt_start(struct watchdog_device *wdev) in msc313e_wdt_start() argument
37 struct msc313e_wdt_priv *priv = watchdog_get_drvdata(wdev); in msc313e_wdt_start()
45 timeout = wdev->timeout * clk_get_rate(priv->clk); in msc313e_wdt_start()
52 static int msc313e_wdt_ping(struct watchdog_device *wdev) in msc313e_wdt_ping() argument
54 struct msc313e_wdt_priv *priv = watchdog_get_drvdata(wdev); in msc313e_wdt_ping()
60 static int msc313e_wdt_stop(struct watchdog_device *wdev) in msc313e_wdt_stop() argument
62 struct msc313e_wdt_priv *priv = watchdog_get_drvdata(wdev); in msc313e_wdt_stop()
71 static int msc313e_wdt_settimeout(struct watchdog_device *wdev, unsigned int new_time) in msc313e_wdt_settimeout() argument
73 wdev->timeout = new_time; in msc313e_wdt_settimeout()
75 return msc313e_wdt_start(wdev); in msc313e_wdt_settimeout()
116 priv->wdev.info = &msc313e_wdt_ident, in msc313e_wdt_probe()
117 priv->wdev.ops = &msc313e_wdt_ops, in msc313e_wdt_probe()
118 priv->wdev.parent = dev; in msc313e_wdt_probe()
119 priv->wdev.min_timeout = MSC313E_WDT_MIN_TIMEOUT; in msc313e_wdt_probe()
120 priv->wdev.max_timeout = U32_MAX / clk_get_rate(priv->clk); in msc313e_wdt_probe()
121 priv->wdev.timeout = MSC313E_WDT_DEFAULT_TIMEOUT; in msc313e_wdt_probe()
125 set_bit(WDOG_HW_RUNNING, &priv->wdev.status); in msc313e_wdt_probe()
127 watchdog_set_drvdata(&priv->wdev, priv); in msc313e_wdt_probe()
129 watchdog_init_timeout(&priv->wdev, timeout, dev); in msc313e_wdt_probe()
130 watchdog_stop_on_reboot(&priv->wdev); in msc313e_wdt_probe()
131 watchdog_stop_on_unregister(&priv->wdev); in msc313e_wdt_probe()
133 return devm_watchdog_register_device(dev, &priv->wdev); in msc313e_wdt_probe()
140 if (watchdog_active(&priv->wdev)) in msc313e_wdt_suspend()
141 msc313e_wdt_stop(&priv->wdev); in msc313e_wdt_suspend()
150 if (watchdog_active(&priv->wdev)) in msc313e_wdt_resume()
151 msc313e_wdt_start(&priv->wdev); in msc313e_wdt_resume()