wdat               28 drivers/acpi/acpi_watchdog.c static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat)
wdat               33 drivers/acpi/acpi_watchdog.c 	entries = (struct acpi_wdat_entry *)(wdat + 1);
wdat               34 drivers/acpi/acpi_watchdog.c 	for (i = 0; i < wdat->entries; i++) {
wdat               52 drivers/acpi/acpi_watchdog.c static bool acpi_watchdog_uses_rtc(const struct acpi_table_wdat *wdat)
wdat               62 drivers/acpi/acpi_watchdog.c 	const struct acpi_table_wdat *wdat = NULL;
wdat               69 drivers/acpi/acpi_watchdog.c 				(struct acpi_table_header **)&wdat);
wdat               75 drivers/acpi/acpi_watchdog.c 	if (acpi_watchdog_uses_rtc(wdat)) {
wdat               80 drivers/acpi/acpi_watchdog.c 	return wdat;
wdat              104 drivers/acpi/acpi_watchdog.c 	const struct acpi_table_wdat *wdat;
wdat              112 drivers/acpi/acpi_watchdog.c 	wdat = acpi_watchdog_get_wdat();
wdat              113 drivers/acpi/acpi_watchdog.c 	if (!wdat) {
wdat              119 drivers/acpi/acpi_watchdog.c 	if (!(wdat->flags & ACPI_WDAT_ENABLED))
wdat              123 drivers/acpi/acpi_watchdog.c 	if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
wdat              124 drivers/acpi/acpi_watchdog.c 	    wdat->pci_device != 0xff || wdat->pci_function != 0xff)
wdat              129 drivers/acpi/acpi_watchdog.c 	entries = (struct acpi_wdat_entry *)(wdat + 1);
wdat              130 drivers/acpi/acpi_watchdog.c 	for (i = 0; i < wdat->entries; i++) {
wdat               64 drivers/watchdog/wdat_wdt.c static int wdat_wdt_read(struct wdat_wdt *wdat,
wdat               83 drivers/watchdog/wdat_wdt.c 	dev_dbg(&wdat->pdev->dev, "Read %#x from 0x%08llx\n", *value,
wdat               89 drivers/watchdog/wdat_wdt.c static int wdat_wdt_write(struct wdat_wdt *wdat,
wdat              108 drivers/watchdog/wdat_wdt.c 	dev_dbg(&wdat->pdev->dev, "Wrote %#x to 0x%08llx\n", value,
wdat              114 drivers/watchdog/wdat_wdt.c static int wdat_wdt_run_action(struct wdat_wdt *wdat, unsigned int action,
wdat              119 drivers/watchdog/wdat_wdt.c 	if (action >= ARRAY_SIZE(wdat->instructions))
wdat              122 drivers/watchdog/wdat_wdt.c 	if (!wdat->instructions[action])
wdat              125 drivers/watchdog/wdat_wdt.c 	dev_dbg(&wdat->pdev->dev, "Running action %#x\n", action);
wdat              128 drivers/watchdog/wdat_wdt.c 	list_for_each_entry(instr, wdat->instructions[action], node) {
wdat              144 drivers/watchdog/wdat_wdt.c 			ret = wdat_wdt_read(wdat, instr, &x);
wdat              154 drivers/watchdog/wdat_wdt.c 			ret = wdat_wdt_read(wdat, instr, &x);
wdat              167 drivers/watchdog/wdat_wdt.c 				ret = wdat_wdt_read(wdat, instr, &y);
wdat              173 drivers/watchdog/wdat_wdt.c 			ret = wdat_wdt_write(wdat, instr, x);
wdat              183 drivers/watchdog/wdat_wdt.c 				ret = wdat_wdt_read(wdat, instr, &y);
wdat              189 drivers/watchdog/wdat_wdt.c 			ret = wdat_wdt_write(wdat, instr, x);
wdat              195 drivers/watchdog/wdat_wdt.c 			dev_err(&wdat->pdev->dev, "Unknown instruction: %u\n",
wdat              204 drivers/watchdog/wdat_wdt.c static int wdat_wdt_enable_reboot(struct wdat_wdt *wdat)
wdat              214 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_REBOOT, 0, NULL);
wdat              216 drivers/watchdog/wdat_wdt.c 		dev_err(&wdat->pdev->dev,
wdat              224 drivers/watchdog/wdat_wdt.c static void wdat_wdt_boot_status(struct wdat_wdt *wdat)
wdat              229 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_GET_STATUS, 0, &boot_status);
wdat              231 drivers/watchdog/wdat_wdt.c 		dev_err(&wdat->pdev->dev, "Failed to read boot status\n");
wdat              236 drivers/watchdog/wdat_wdt.c 		wdat->wdd.bootstatus = WDIOF_CARDRESET;
wdat              239 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_STATUS, 0, NULL);
wdat              241 drivers/watchdog/wdat_wdt.c 		dev_err(&wdat->pdev->dev, "Failed to clear boot status\n");
wdat              244 drivers/watchdog/wdat_wdt.c static void wdat_wdt_set_running(struct wdat_wdt *wdat)
wdat              249 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_GET_RUNNING_STATE, 0,
wdat              252 drivers/watchdog/wdat_wdt.c 		dev_err(&wdat->pdev->dev, "Failed to read running state\n");
wdat              255 drivers/watchdog/wdat_wdt.c 		set_bit(WDOG_HW_RUNNING, &wdat->wdd.status);
wdat              278 drivers/watchdog/wdat_wdt.c 	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
wdat              282 drivers/watchdog/wdat_wdt.c 	periods = timeout * 1000 / wdat->period;
wdat              283 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_run_action(wdat, ACPI_WDAT_SET_COUNTDOWN, periods, NULL);
wdat              291 drivers/watchdog/wdat_wdt.c 	struct wdat_wdt *wdat = to_wdat_wdt(wdd);
wdat              294 drivers/watchdog/wdat_wdt.c 	wdat_wdt_run_action(wdat, ACPI_WDAT_GET_CURRENT_COUNTDOWN, 0, &periods);
wdat              295 drivers/watchdog/wdat_wdt.c 	return periods * wdat->period / 1000;
wdat              318 drivers/watchdog/wdat_wdt.c 	struct wdat_wdt *wdat;
wdat              329 drivers/watchdog/wdat_wdt.c 	wdat = devm_kzalloc(dev, sizeof(*wdat), GFP_KERNEL);
wdat              330 drivers/watchdog/wdat_wdt.c 	if (!wdat)
wdat              344 drivers/watchdog/wdat_wdt.c 	wdat->period = tbl->timer_period;
wdat              345 drivers/watchdog/wdat_wdt.c 	wdat->wdd.min_hw_heartbeat_ms = wdat->period * tbl->min_count;
wdat              346 drivers/watchdog/wdat_wdt.c 	wdat->wdd.max_hw_heartbeat_ms = wdat->period * tbl->max_count;
wdat              347 drivers/watchdog/wdat_wdt.c 	wdat->stopped_in_sleep = tbl->flags & ACPI_WDAT_STOPPED;
wdat              348 drivers/watchdog/wdat_wdt.c 	wdat->wdd.info = &wdat_wdt_info;
wdat              349 drivers/watchdog/wdat_wdt.c 	wdat->wdd.ops = &wdat_wdt_ops;
wdat              350 drivers/watchdog/wdat_wdt.c 	wdat->pdev = pdev;
wdat              424 drivers/watchdog/wdat_wdt.c 		instructions = wdat->instructions[action];
wdat              433 drivers/watchdog/wdat_wdt.c 			wdat->instructions[action] = instructions;
wdat              439 drivers/watchdog/wdat_wdt.c 	wdat_wdt_boot_status(wdat);
wdat              440 drivers/watchdog/wdat_wdt.c 	wdat_wdt_set_running(wdat);
wdat              442 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_enable_reboot(wdat);
wdat              446 drivers/watchdog/wdat_wdt.c 	platform_set_drvdata(pdev, wdat);
wdat              453 drivers/watchdog/wdat_wdt.c 	if (timeout * 1000 < wdat->wdd.min_hw_heartbeat_ms ||
wdat              454 drivers/watchdog/wdat_wdt.c 	    timeout * 1000 > wdat->wdd.max_hw_heartbeat_ms) {
wdat              460 drivers/watchdog/wdat_wdt.c 	ret = wdat_wdt_set_timeout(&wdat->wdd, timeout);
wdat              464 drivers/watchdog/wdat_wdt.c 	watchdog_set_nowayout(&wdat->wdd, nowayout);
wdat              465 drivers/watchdog/wdat_wdt.c 	return devm_watchdog_register_device(dev, &wdat->wdd);
wdat              471 drivers/watchdog/wdat_wdt.c 	struct wdat_wdt *wdat = dev_get_drvdata(dev);
wdat              474 drivers/watchdog/wdat_wdt.c 	if (!watchdog_active(&wdat->wdd))
wdat              483 drivers/watchdog/wdat_wdt.c 	wdat->stopped = false;
wdat              485 drivers/watchdog/wdat_wdt.c 	    !wdat->stopped_in_sleep) {
wdat              486 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_stop(&wdat->wdd);
wdat              488 drivers/watchdog/wdat_wdt.c 			wdat->stopped = true;
wdat              490 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_ping(&wdat->wdd);
wdat              498 drivers/watchdog/wdat_wdt.c 	struct wdat_wdt *wdat = dev_get_drvdata(dev);
wdat              501 drivers/watchdog/wdat_wdt.c 	if (!watchdog_active(&wdat->wdd))
wdat              504 drivers/watchdog/wdat_wdt.c 	if (!wdat->stopped) {
wdat              510 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_stop(&wdat->wdd);
wdat              514 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_set_timeout(&wdat->wdd, wdat->wdd.timeout);
wdat              518 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_enable_reboot(wdat);
wdat              522 drivers/watchdog/wdat_wdt.c 		ret = wdat_wdt_ping(&wdat->wdd);
wdat              527 drivers/watchdog/wdat_wdt.c 	return wdat_wdt_start(&wdat->wdd);