Lines Matching full:wdt

54 	void (*ping)(struct max63xx_wdt *wdt);
55 void (*set)(struct max63xx_wdt *wdt, u8 set);
120 struct max63xx_wdt *wdt = watchdog_get_drvdata(wdd); in max63xx_wdt_ping() local
122 wdt->ping(wdt); in max63xx_wdt_ping()
128 struct max63xx_wdt *wdt = watchdog_get_drvdata(wdd); in max63xx_wdt_start() local
130 wdt->set(wdt, wdt->timeout->wdset); in max63xx_wdt_start()
133 if (wdt->timeout->tdelay == 0) in max63xx_wdt_start()
134 wdt->ping(wdt); in max63xx_wdt_start()
140 struct max63xx_wdt *wdt = watchdog_get_drvdata(wdd); in max63xx_wdt_stop() local
142 wdt->set(wdt, MAX6369_WDSET_DISABLED); in max63xx_wdt_stop()
158 static void max63xx_mmap_ping(struct max63xx_wdt *wdt) in max63xx_mmap_ping() argument
162 spin_lock(&wdt->lock); in max63xx_mmap_ping()
164 val = __raw_readb(wdt->base); in max63xx_mmap_ping()
166 __raw_writeb(val | MAX6369_WDI, wdt->base); in max63xx_mmap_ping()
167 __raw_writeb(val & ~MAX6369_WDI, wdt->base); in max63xx_mmap_ping()
169 spin_unlock(&wdt->lock); in max63xx_mmap_ping()
172 static void max63xx_mmap_set(struct max63xx_wdt *wdt, u8 set) in max63xx_mmap_set() argument
176 spin_lock(&wdt->lock); in max63xx_mmap_set()
178 val = __raw_readb(wdt->base); in max63xx_mmap_set()
181 __raw_writeb(val, wdt->base); in max63xx_mmap_set()
183 spin_unlock(&wdt->lock); in max63xx_mmap_set()
186 static int max63xx_mmap_init(struct platform_device *p, struct max63xx_wdt *wdt) in max63xx_mmap_init() argument
188 wdt->base = devm_platform_ioremap_resource(p, 0); in max63xx_mmap_init()
189 if (IS_ERR(wdt->base)) in max63xx_mmap_init()
190 return PTR_ERR(wdt->base); in max63xx_mmap_init()
192 spin_lock_init(&wdt->lock); in max63xx_mmap_init()
194 wdt->ping = max63xx_mmap_ping; in max63xx_mmap_init()
195 wdt->set = max63xx_mmap_set; in max63xx_mmap_init()
202 struct max63xx_wdt *wdt; in max63xx_wdt_probe() local
206 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); in max63xx_wdt_probe()
207 if (!wdt) in max63xx_wdt_probe()
218 wdt->timeout = max63xx_select_timeout(table, heartbeat); in max63xx_wdt_probe()
219 if (!wdt->timeout) { in max63xx_wdt_probe()
225 err = max63xx_mmap_init(pdev, wdt); in max63xx_wdt_probe()
229 platform_set_drvdata(pdev, &wdt->wdd); in max63xx_wdt_probe()
230 watchdog_set_drvdata(&wdt->wdd, wdt); in max63xx_wdt_probe()
232 wdt->wdd.parent = dev; in max63xx_wdt_probe()
233 wdt->wdd.timeout = wdt->timeout->twd; in max63xx_wdt_probe()
234 wdt->wdd.info = &max63xx_wdt_info; in max63xx_wdt_probe()
235 wdt->wdd.ops = &max63xx_wdt_ops; in max63xx_wdt_probe()
237 watchdog_set_nowayout(&wdt->wdd, nowayout); in max63xx_wdt_probe()
239 err = devm_watchdog_register_device(dev, &wdt->wdd); in max63xx_wdt_probe()
244 wdt->timeout->twd, wdt->timeout->tdelay); in max63xx_wdt_probe()