2 * Copyright 2017 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
11 #include <dm/device-internal.h>
14 DECLARE_GLOBAL_DATA_PTR
;
16 int wdt_start(struct udevice
*dev
, u64 timeout_ms
, ulong flags
)
18 const struct wdt_ops
*ops
= device_get_ops(dev
);
23 return ops
->start(dev
, timeout_ms
, flags
);
26 int wdt_stop(struct udevice
*dev
)
28 const struct wdt_ops
*ops
= device_get_ops(dev
);
33 return ops
->stop(dev
);
36 int wdt_reset(struct udevice
*dev
)
38 const struct wdt_ops
*ops
= device_get_ops(dev
);
43 return ops
->reset(dev
);
46 int wdt_expire_now(struct udevice
*dev
, ulong flags
)
49 const struct wdt_ops
*ops
;
51 debug("WDT Resetting: %lu\n", flags
);
52 ops
= device_get_ops(dev
);
53 if (ops
->expire_now
) {
54 return ops
->expire_now(dev
, flags
);
59 ret
= ops
->start(dev
, 1, flags
);
69 UCLASS_DRIVER(wdt
) = {