Lines Matching full:wdt
59 struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); in bcm7038_wdt_set_timeout_reg() local
62 timeout = wdt->rate * wdog->timeout; in bcm7038_wdt_set_timeout_reg()
64 bcm7038_wdt_write(timeout, wdt->base + WDT_TIMEOUT_REG); in bcm7038_wdt_set_timeout_reg()
69 struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); in bcm7038_wdt_ping() local
71 bcm7038_wdt_write(WDT_START_1, wdt->base + WDT_CMD_REG); in bcm7038_wdt_ping()
72 bcm7038_wdt_write(WDT_START_2, wdt->base + WDT_CMD_REG); in bcm7038_wdt_ping()
87 struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); in bcm7038_wdt_stop() local
89 bcm7038_wdt_write(WDT_STOP_1, wdt->base + WDT_CMD_REG); in bcm7038_wdt_stop()
90 bcm7038_wdt_write(WDT_STOP_2, wdt->base + WDT_CMD_REG); in bcm7038_wdt_stop()
108 struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog); in bcm7038_wdt_get_timeleft() local
111 time_left = bcm7038_wdt_read(wdt->base + WDT_CMD_REG); in bcm7038_wdt_get_timeleft()
113 return time_left / wdt->rate; in bcm7038_wdt_get_timeleft()
134 struct bcm7038_watchdog *wdt; in bcm7038_wdt_probe() local
138 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); in bcm7038_wdt_probe()
139 if (!wdt) in bcm7038_wdt_probe()
142 platform_set_drvdata(pdev, wdt); in bcm7038_wdt_probe()
144 wdt->base = devm_platform_ioremap_resource(pdev, 0); in bcm7038_wdt_probe()
145 if (IS_ERR(wdt->base)) in bcm7038_wdt_probe()
146 return PTR_ERR(wdt->base); in bcm7038_wdt_probe()
151 wdt->clk = devm_clk_get_enabled(dev, clk_name); in bcm7038_wdt_probe()
153 if (!IS_ERR(wdt->clk)) { in bcm7038_wdt_probe()
154 wdt->rate = clk_get_rate(wdt->clk); in bcm7038_wdt_probe()
156 if (!wdt->rate) in bcm7038_wdt_probe()
157 wdt->rate = WDT_DEFAULT_RATE; in bcm7038_wdt_probe()
159 wdt->rate = WDT_DEFAULT_RATE; in bcm7038_wdt_probe()
160 wdt->clk = NULL; in bcm7038_wdt_probe()
163 wdt->wdd.info = &bcm7038_wdt_info; in bcm7038_wdt_probe()
164 wdt->wdd.ops = &bcm7038_wdt_ops; in bcm7038_wdt_probe()
165 wdt->wdd.min_timeout = WDT_MIN_TIMEOUT; in bcm7038_wdt_probe()
166 wdt->wdd.timeout = WDT_DEFAULT_TIMEOUT; in bcm7038_wdt_probe()
167 wdt->wdd.max_timeout = 0xffffffff / wdt->rate; in bcm7038_wdt_probe()
168 wdt->wdd.parent = dev; in bcm7038_wdt_probe()
169 watchdog_set_drvdata(&wdt->wdd, wdt); in bcm7038_wdt_probe()
171 watchdog_stop_on_reboot(&wdt->wdd); in bcm7038_wdt_probe()
172 watchdog_stop_on_unregister(&wdt->wdd); in bcm7038_wdt_probe()
173 err = devm_watchdog_register_device(dev, &wdt->wdd); in bcm7038_wdt_probe()
184 struct bcm7038_watchdog *wdt = dev_get_drvdata(dev); in bcm7038_wdt_suspend() local
186 if (watchdog_active(&wdt->wdd)) in bcm7038_wdt_suspend()
187 return bcm7038_wdt_stop(&wdt->wdd); in bcm7038_wdt_suspend()
194 struct bcm7038_watchdog *wdt = dev_get_drvdata(dev); in bcm7038_wdt_resume() local
196 if (watchdog_active(&wdt->wdd)) in bcm7038_wdt_resume()
197 return bcm7038_wdt_start(&wdt->wdd); in bcm7038_wdt_resume()
206 { .compatible = "brcm,bcm6345-wdt" },
207 { .compatible = "brcm,bcm7038-wdt" },
213 { .name = "bcm63xx-wdt" },
222 .name = "bcm7038-wdt",