Lines Matching refs:mtk_wdt
158 struct mtk_wdt_dev *mtk_wdt = platform_get_drvdata(pdev); in toprgu_register_reset_controller() local
160 spin_lock_init(&mtk_wdt->lock); in toprgu_register_reset_controller()
162 mtk_wdt->rcdev.owner = THIS_MODULE; in toprgu_register_reset_controller()
163 mtk_wdt->rcdev.nr_resets = rst_num; in toprgu_register_reset_controller()
164 mtk_wdt->rcdev.ops = &toprgu_reset_ops; in toprgu_register_reset_controller()
165 mtk_wdt->rcdev.of_node = pdev->dev.of_node; in toprgu_register_reset_controller()
166 ret = devm_reset_controller_register(&pdev->dev, &mtk_wdt->rcdev); in toprgu_register_reset_controller()
176 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_restart() local
179 wdt_base = mtk_wdt->wdt_base; in mtk_wdt_restart()
191 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_ping() local
192 void __iomem *wdt_base = mtk_wdt->wdt_base; in mtk_wdt_ping()
202 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_set_timeout() local
203 void __iomem *wdt_base = mtk_wdt->wdt_base; in mtk_wdt_set_timeout()
229 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_init() local
232 wdt_base = mtk_wdt->wdt_base; in mtk_wdt_init()
242 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_stop() local
243 void __iomem *wdt_base = mtk_wdt->wdt_base; in mtk_wdt_stop()
257 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdt_dev); in mtk_wdt_start() local
258 void __iomem *wdt_base = mtk_wdt->wdt_base; in mtk_wdt_start()
270 if (mtk_wdt->disable_wdt_extrst) in mtk_wdt_start()
281 struct mtk_wdt_dev *mtk_wdt = watchdog_get_drvdata(wdd); in mtk_wdt_set_pretimeout() local
282 void __iomem *wdt_base = mtk_wdt->wdt_base; in mtk_wdt_set_pretimeout()
338 struct mtk_wdt_dev *mtk_wdt; in mtk_wdt_probe() local
342 mtk_wdt = devm_kzalloc(dev, sizeof(*mtk_wdt), GFP_KERNEL); in mtk_wdt_probe()
343 if (!mtk_wdt) in mtk_wdt_probe()
346 platform_set_drvdata(pdev, mtk_wdt); in mtk_wdt_probe()
348 mtk_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0); in mtk_wdt_probe()
349 if (IS_ERR(mtk_wdt->wdt_base)) in mtk_wdt_probe()
350 return PTR_ERR(mtk_wdt->wdt_base); in mtk_wdt_probe()
355 &mtk_wdt->wdt_dev); in mtk_wdt_probe()
359 mtk_wdt->wdt_dev.info = &mtk_wdt_pt_info; in mtk_wdt_probe()
360 mtk_wdt->wdt_dev.pretimeout = WDT_MAX_TIMEOUT / 2; in mtk_wdt_probe()
365 mtk_wdt->wdt_dev.info = &mtk_wdt_info; in mtk_wdt_probe()
368 mtk_wdt->wdt_dev.ops = &mtk_wdt_ops; in mtk_wdt_probe()
369 mtk_wdt->wdt_dev.timeout = WDT_MAX_TIMEOUT; in mtk_wdt_probe()
370 mtk_wdt->wdt_dev.max_hw_heartbeat_ms = WDT_MAX_TIMEOUT * 1000; in mtk_wdt_probe()
371 mtk_wdt->wdt_dev.min_timeout = WDT_MIN_TIMEOUT; in mtk_wdt_probe()
372 mtk_wdt->wdt_dev.parent = dev; in mtk_wdt_probe()
374 watchdog_init_timeout(&mtk_wdt->wdt_dev, timeout, dev); in mtk_wdt_probe()
375 watchdog_set_nowayout(&mtk_wdt->wdt_dev, nowayout); in mtk_wdt_probe()
376 watchdog_set_restart_priority(&mtk_wdt->wdt_dev, 128); in mtk_wdt_probe()
378 watchdog_set_drvdata(&mtk_wdt->wdt_dev, mtk_wdt); in mtk_wdt_probe()
380 mtk_wdt_init(&mtk_wdt->wdt_dev); in mtk_wdt_probe()
382 watchdog_stop_on_reboot(&mtk_wdt->wdt_dev); in mtk_wdt_probe()
383 err = devm_watchdog_register_device(dev, &mtk_wdt->wdt_dev); in mtk_wdt_probe()
388 mtk_wdt->wdt_dev.timeout, nowayout); in mtk_wdt_probe()
398 mtk_wdt->disable_wdt_extrst = in mtk_wdt_probe()
407 struct mtk_wdt_dev *mtk_wdt = dev_get_drvdata(dev); in mtk_wdt_suspend() local
409 if (watchdog_active(&mtk_wdt->wdt_dev)) in mtk_wdt_suspend()
410 mtk_wdt_stop(&mtk_wdt->wdt_dev); in mtk_wdt_suspend()
417 struct mtk_wdt_dev *mtk_wdt = dev_get_drvdata(dev); in mtk_wdt_resume() local
419 if (watchdog_active(&mtk_wdt->wdt_dev)) { in mtk_wdt_resume()
420 mtk_wdt_start(&mtk_wdt->wdt_dev); in mtk_wdt_resume()
421 mtk_wdt_ping(&mtk_wdt->wdt_dev); in mtk_wdt_resume()