1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2017 Google, Inc
10 #include <dm/device-internal.h>
13 int wdt_start(struct udevice
*dev
, u64 timeout_ms
, ulong flags
)
15 const struct wdt_ops
*ops
= device_get_ops(dev
);
20 return ops
->start(dev
, timeout_ms
, flags
);
23 int wdt_stop(struct udevice
*dev
)
25 const struct wdt_ops
*ops
= device_get_ops(dev
);
30 return ops
->stop(dev
);
33 int wdt_reset(struct udevice
*dev
)
35 const struct wdt_ops
*ops
= device_get_ops(dev
);
40 return ops
->reset(dev
);
43 int wdt_expire_now(struct udevice
*dev
, ulong flags
)
46 const struct wdt_ops
*ops
;
48 debug("WDT Resetting: %lu\n", flags
);
49 ops
= device_get_ops(dev
);
50 if (ops
->expire_now
) {
51 return ops
->expire_now(dev
, flags
);
56 ret
= ops
->start(dev
, 1, flags
);
66 UCLASS_DRIVER(wdt
) = {