1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2019 Broadcom.
4  */
5 
6 #ifndef DRIVERS_WDT_H
7 #define DRIVERS_WDT_H
8 
9 #include <kernel/interrupt.h>
10 #include <tee_api_types.h>
11 
12 struct wdt_chip {
13 	const struct wdt_ops *ops;
14 	struct itr_handler *wdt_itr;
15 };
16 
17 /*
18  * struct wdt_ops - The watchdog device operations
19  *
20  * @start:	The routine for starting the watchdog device.
21  * @stop:	The routine for stopping the watchdog device.
22  * @ping:	The routine that sends a keepalive ping to the watchdog device.
23  * @set_timeout:The routine that finds the load value that will reset system in
24  * required timeout (in seconds).
25  *
26  * The wdt_ops structure contains a list of low-level operations
27  * that control a watchdog device.
28  */
29 struct wdt_ops {
30 	void (*start)(struct wdt_chip *chip);
31 	void (*stop)(struct wdt_chip *chip);
32 	void (*ping)(struct wdt_chip *chip);
33 	TEE_Result (*set_timeout)(struct wdt_chip *chip, unsigned long timeout);
34 };
35 
36 #endif /* DRIVERS_WDT_H */
37