Lines Matching full:wdt
54 static void __iomem *wdt_addr(struct qcom_wdt *wdt, enum wdt_reg reg) in wdt_addr() argument
56 return wdt->base + wdt->layout[reg]; in wdt_addr()
76 struct qcom_wdt *wdt = to_qcom_wdt(wdd); in qcom_wdt_start() local
79 writel(0, wdt_addr(wdt, WDT_EN)); in qcom_wdt_start()
80 writel(1, wdt_addr(wdt, WDT_RST)); in qcom_wdt_start()
81 writel(bark * wdt->rate, wdt_addr(wdt, WDT_BARK_TIME)); in qcom_wdt_start()
82 writel(wdd->timeout * wdt->rate, wdt_addr(wdt, WDT_BITE_TIME)); in qcom_wdt_start()
83 writel(QCOM_WDT_ENABLE, wdt_addr(wdt, WDT_EN)); in qcom_wdt_start()
89 struct qcom_wdt *wdt = to_qcom_wdt(wdd); in qcom_wdt_stop() local
91 writel(0, wdt_addr(wdt, WDT_EN)); in qcom_wdt_stop()
97 struct qcom_wdt *wdt = to_qcom_wdt(wdd); in qcom_wdt_ping() local
99 writel(1, wdt_addr(wdt, WDT_RST)); in qcom_wdt_ping()
120 struct qcom_wdt *wdt = to_qcom_wdt(wdd); in qcom_wdt_restart() local
125 * Setup BITE_TIME to be 128ms, and enable WDT. in qcom_wdt_restart()
127 timeout = 128 * wdt->rate / 1000; in qcom_wdt_restart()
129 writel(0, wdt_addr(wdt, WDT_EN)); in qcom_wdt_restart()
130 writel(1, wdt_addr(wdt, WDT_RST)); in qcom_wdt_restart()
131 writel(timeout, wdt_addr(wdt, WDT_BARK_TIME)); in qcom_wdt_restart()
132 writel(timeout, wdt_addr(wdt, WDT_BITE_TIME)); in qcom_wdt_restart()
133 writel(QCOM_WDT_ENABLE, wdt_addr(wdt, WDT_EN)); in qcom_wdt_restart()
189 struct qcom_wdt *wdt; in qcom_wdt_probe() local
199 dev_err(dev, "Unsupported QCOM WDT module\n"); in qcom_wdt_probe()
203 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); in qcom_wdt_probe()
204 if (!wdt) in qcom_wdt_probe()
218 wdt->base = devm_ioremap_resource(dev, res); in qcom_wdt_probe()
219 if (IS_ERR(wdt->base)) in qcom_wdt_probe()
220 return PTR_ERR(wdt->base); in qcom_wdt_probe()
241 * WATCHDOG_CORE assumes units of seconds, if the WDT is clocked such in qcom_wdt_probe()
245 wdt->rate = clk_get_rate(clk); in qcom_wdt_probe()
246 if (wdt->rate == 0 || in qcom_wdt_probe()
247 wdt->rate > 0x10000000U) { in qcom_wdt_probe()
256 "wdt_bark", &wdt->wdd); in qcom_wdt_probe()
260 wdt->wdd.info = &qcom_wdt_pt_info; in qcom_wdt_probe()
261 wdt->wdd.pretimeout = 1; in qcom_wdt_probe()
266 wdt->wdd.info = &qcom_wdt_info; in qcom_wdt_probe()
269 wdt->wdd.ops = &qcom_wdt_ops; in qcom_wdt_probe()
270 wdt->wdd.min_timeout = 1; in qcom_wdt_probe()
271 wdt->wdd.max_timeout = 0x10000000U / wdt->rate; in qcom_wdt_probe()
272 wdt->wdd.parent = dev; in qcom_wdt_probe()
273 wdt->layout = data->offset; in qcom_wdt_probe()
275 if (readl(wdt_addr(wdt, WDT_STS)) & 1) in qcom_wdt_probe()
276 wdt->wdd.bootstatus = WDIOF_CARDRESET; in qcom_wdt_probe()
283 wdt->wdd.timeout = min(wdt->wdd.max_timeout, 30U); in qcom_wdt_probe()
284 watchdog_init_timeout(&wdt->wdd, 0, dev); in qcom_wdt_probe()
286 ret = devm_watchdog_register_device(dev, &wdt->wdd); in qcom_wdt_probe()
290 platform_set_drvdata(pdev, wdt); in qcom_wdt_probe()
296 struct qcom_wdt *wdt = dev_get_drvdata(dev); in qcom_wdt_suspend() local
298 if (watchdog_active(&wdt->wdd)) in qcom_wdt_suspend()
299 qcom_wdt_stop(&wdt->wdd); in qcom_wdt_suspend()
306 struct qcom_wdt *wdt = dev_get_drvdata(dev); in qcom_wdt_resume() local
308 if (watchdog_active(&wdt->wdd)) in qcom_wdt_resume()
309 qcom_wdt_start(&wdt->wdd); in qcom_wdt_resume()
319 { .compatible = "qcom,kpss-wdt", .data = &match_data_kpss },