1 // SPDX-License-Identifier: GPL-2.0+
12 struct wdt_reboot_priv {
16 static int wdt_reboot_request(struct udevice *dev, enum sysreset_t type)
18 struct wdt_reboot_priv *priv = dev_get_priv(dev);
21 ret = wdt_expire_now(priv->wdt, 0);
28 static struct sysreset_ops wdt_reboot_ops = {
29 .request = wdt_reboot_request,
32 int wdt_reboot_probe(struct udevice *dev)
34 struct wdt_reboot_priv *priv = dev_get_priv(dev);
37 err = uclass_get_device_by_phandle(UCLASS_WDT, dev,
40 pr_err("unable to find wdt device\n");
47 static const struct udevice_id wdt_reboot_ids[] = {
48 { .compatible = "wdt-reboot" },
52 U_BOOT_DRIVER(wdt_reboot) = {
54 .id = UCLASS_SYSRESET,
55 .of_match = wdt_reboot_ids,
56 .ops = &wdt_reboot_ops,
57 .priv_auto = sizeof(struct wdt_reboot_priv),
58 .probe = wdt_reboot_probe,