Lines Matching full:wdt
56 static void ni903x_start(struct ni903x_wdt *wdt) in ni903x_start() argument
58 u8 control = inb(wdt->io_base + NIWD_CONTROL); in ni903x_start()
60 outb(control | NIWD_CONTROL_RESET, wdt->io_base + NIWD_CONTROL); in ni903x_start()
61 outb(control | NIWD_CONTROL_PET, wdt->io_base + NIWD_CONTROL); in ni903x_start()
67 struct ni903x_wdt *wdt = watchdog_get_drvdata(wdd); in ni903x_wdd_set_timeout() local
70 outb(((0x00FF0000 & counter) >> 16), wdt->io_base + NIWD_SEED2); in ni903x_wdd_set_timeout()
71 outb(((0x0000FF00 & counter) >> 8), wdt->io_base + NIWD_SEED1); in ni903x_wdd_set_timeout()
72 outb((0x000000FF & counter), wdt->io_base + NIWD_SEED0); in ni903x_wdd_set_timeout()
81 struct ni903x_wdt *wdt = watchdog_get_drvdata(wdd); in ni903x_wdd_get_timeleft() local
85 control = inb(wdt->io_base + NIWD_CONTROL); in ni903x_wdd_get_timeleft()
87 outb(control, wdt->io_base + NIWD_CONTROL); in ni903x_wdd_get_timeleft()
89 counter2 = inb(wdt->io_base + NIWD_COUNTER2); in ni903x_wdd_get_timeleft()
90 counter1 = inb(wdt->io_base + NIWD_COUNTER1); in ni903x_wdd_get_timeleft()
91 counter0 = inb(wdt->io_base + NIWD_COUNTER0); in ni903x_wdd_get_timeleft()
100 struct ni903x_wdt *wdt = watchdog_get_drvdata(wdd); in ni903x_wdd_ping() local
103 control = inb(wdt->io_base + NIWD_CONTROL); in ni903x_wdd_ping()
104 outb(control | NIWD_CONTROL_PET, wdt->io_base + NIWD_CONTROL); in ni903x_wdd_ping()
111 struct ni903x_wdt *wdt = watchdog_get_drvdata(wdd); in ni903x_wdd_start() local
114 wdt->io_base + NIWD_CONTROL); in ni903x_wdd_start()
117 ni903x_start(wdt); in ni903x_wdd_start()
124 struct ni903x_wdt *wdt = watchdog_get_drvdata(wdd); in ni903x_wdd_stop() local
126 outb(NIWD_CONTROL_RESET, wdt->io_base + NIWD_CONTROL); in ni903x_wdd_stop()
133 struct ni903x_wdt *wdt = data; in ni903x_resources() local
138 if (wdt->io_base != 0) { in ni903x_resources()
139 dev_err(wdt->dev, "too many IO resources\n"); in ni903x_resources()
143 wdt->io_base = res->data.io.minimum; in ni903x_resources()
147 dev_err(wdt->dev, "memory region too small\n"); in ni903x_resources()
151 if (!devm_request_region(wdt->dev, wdt->io_base, io_size, in ni903x_resources()
153 dev_err(wdt->dev, "failed to get memory region\n"); in ni903x_resources()
184 struct ni903x_wdt *wdt; in ni903x_acpi_add() local
188 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); in ni903x_acpi_add()
189 if (!wdt) in ni903x_acpi_add()
192 device->driver_data = wdt; in ni903x_acpi_add()
193 wdt->dev = dev; in ni903x_acpi_add()
196 ni903x_resources, wdt); in ni903x_acpi_add()
197 if (ACPI_FAILURE(status) || wdt->io_base == 0) { in ni903x_acpi_add()
202 wdd = &wdt->wdd; in ni903x_acpi_add()
209 watchdog_set_drvdata(wdd, wdt); in ni903x_acpi_add()
219 wdt->io_base + NIWD_CONTROL); in ni903x_acpi_add()
222 wdt->io_base, timeout, nowayout); in ni903x_acpi_add()
229 struct ni903x_wdt *wdt = acpi_driver_data(device); in ni903x_acpi_remove() local
231 ni903x_wdd_stop(&wdt->wdd); in ni903x_acpi_remove()
232 watchdog_unregister_device(&wdt->wdd); in ni903x_acpi_remove()