Searched refs:pdc_wdt (Results 1 - 1 of 1) sorted by relevance

/linux-4.4.14/drivers/watchdog/
H A Dimgpdc_wdt.c188 struct pdc_wdt_dev *pdc_wdt; pdc_wdt_probe() local
190 pdc_wdt = devm_kzalloc(&pdev->dev, sizeof(*pdc_wdt), GFP_KERNEL); pdc_wdt_probe()
191 if (!pdc_wdt) pdc_wdt_probe()
195 pdc_wdt->base = devm_ioremap_resource(&pdev->dev, res); pdc_wdt_probe()
196 if (IS_ERR(pdc_wdt->base)) pdc_wdt_probe()
197 return PTR_ERR(pdc_wdt->base); pdc_wdt_probe()
199 pdc_wdt->sys_clk = devm_clk_get(&pdev->dev, "sys"); pdc_wdt_probe()
200 if (IS_ERR(pdc_wdt->sys_clk)) { pdc_wdt_probe()
202 return PTR_ERR(pdc_wdt->sys_clk); pdc_wdt_probe()
205 pdc_wdt->wdt_clk = devm_clk_get(&pdev->dev, "wdt"); pdc_wdt_probe()
206 if (IS_ERR(pdc_wdt->wdt_clk)) { pdc_wdt_probe()
208 return PTR_ERR(pdc_wdt->wdt_clk); pdc_wdt_probe()
211 ret = clk_prepare_enable(pdc_wdt->sys_clk); pdc_wdt_probe()
217 ret = clk_prepare_enable(pdc_wdt->wdt_clk); pdc_wdt_probe()
224 clk_rate = clk_get_rate(pdc_wdt->wdt_clk); pdc_wdt_probe()
238 pdc_wdt->wdt_dev.min_timeout = PDC_WDT_MIN_TIMEOUT + 1; pdc_wdt_probe()
240 pdc_wdt->wdt_dev.min_timeout = PDC_WDT_MIN_TIMEOUT; pdc_wdt_probe()
242 pdc_wdt->wdt_dev.info = &pdc_wdt_info; pdc_wdt_probe()
243 pdc_wdt->wdt_dev.ops = &pdc_wdt_ops; pdc_wdt_probe()
247 pdc_wdt->wdt_dev.max_timeout = div; pdc_wdt_probe()
248 pdc_wdt->wdt_dev.timeout = PDC_WDT_DEF_TIMEOUT; pdc_wdt_probe()
249 pdc_wdt->wdt_dev.parent = &pdev->dev; pdc_wdt_probe()
250 watchdog_set_drvdata(&pdc_wdt->wdt_dev, pdc_wdt); pdc_wdt_probe()
252 watchdog_init_timeout(&pdc_wdt->wdt_dev, heartbeat, &pdev->dev); pdc_wdt_probe()
254 pdc_wdt_stop(&pdc_wdt->wdt_dev); pdc_wdt_probe()
257 val = readl(pdc_wdt->base + PDC_WDT_TICKLE1); pdc_wdt_probe()
262 pdc_wdt->wdt_dev.bootstatus |= WDIOF_CARDRESET; pdc_wdt_probe()
284 watchdog_set_nowayout(&pdc_wdt->wdt_dev, nowayout); pdc_wdt_probe()
286 platform_set_drvdata(pdev, pdc_wdt); pdc_wdt_probe()
288 ret = watchdog_register_device(&pdc_wdt->wdt_dev); pdc_wdt_probe()
292 pdc_wdt->restart_handler.notifier_call = pdc_wdt_restart; pdc_wdt_probe()
293 pdc_wdt->restart_handler.priority = 128; pdc_wdt_probe()
294 ret = register_restart_handler(&pdc_wdt->restart_handler); pdc_wdt_probe()
302 clk_disable_unprepare(pdc_wdt->wdt_clk); pdc_wdt_probe()
304 clk_disable_unprepare(pdc_wdt->sys_clk); pdc_wdt_probe()
310 struct pdc_wdt_dev *pdc_wdt = platform_get_drvdata(pdev); pdc_wdt_shutdown() local
312 pdc_wdt_stop(&pdc_wdt->wdt_dev); pdc_wdt_shutdown()
317 struct pdc_wdt_dev *pdc_wdt = platform_get_drvdata(pdev); pdc_wdt_remove() local
319 unregister_restart_handler(&pdc_wdt->restart_handler); pdc_wdt_remove()
320 pdc_wdt_stop(&pdc_wdt->wdt_dev); pdc_wdt_remove()
321 watchdog_unregister_device(&pdc_wdt->wdt_dev); pdc_wdt_remove()
322 clk_disable_unprepare(pdc_wdt->wdt_clk); pdc_wdt_remove()
323 clk_disable_unprepare(pdc_wdt->sys_clk); pdc_wdt_remove()

Completed in 50 milliseconds