mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
watchdog: core: dt: add support for the timeout-sec dt property
Add support for watchdog drivers to initialize/set the timeout field of the watchdog_device structure. The timeout field is initialised either with the module timeout parameter value (if valid) or with the timeout-sec dt property (if valid). If both are invalid the initial value is unchanged. Signed-off-by: Fabio Porcedda <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
parent
e3e83d0001
commit
3048253ed9
4 changed files with 80 additions and 12 deletions
|
|
@ -1,6 +1,6 @@
|
|||
The Linux WatchDog Timer Driver Core kernel API.
|
||||
===============================================
|
||||
Last reviewed: 22-May-2012
|
||||
Last reviewed: 12-Feb-2013
|
||||
|
||||
Wim Van Sebroeck <[email protected]>
|
||||
|
||||
|
|
@ -212,3 +212,15 @@ driver specific data to and a pointer to the data itself.
|
|||
The watchdog_get_drvdata function allows you to retrieve driver specific data.
|
||||
The argument of this function is the watchdog device where you want to retrieve
|
||||
data from. The function returns the pointer to the driver specific data.
|
||||
|
||||
To initialize the timeout field, the following function can be used:
|
||||
|
||||
extern int watchdog_init_timeout(struct watchdog_device *wdd,
|
||||
unsigned int timeout_parm, struct device *dev);
|
||||
|
||||
The watchdog_init_timeout function allows you to initialize the timeout field
|
||||
using the module timeout parameter or by retrieving the timeout-sec property from
|
||||
the device tree (if the module timeout parameter is invalid). Best practice is
|
||||
to set the default timeout value as timeout value in the watchdog_device and
|
||||
then use this function to set the user "preferred" timeout value.
|
||||
This routine returns zero on success and a negative errno code for failure.
|
||||
|
|
|
|||
Loading…
Reference in a new issue