diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2011-07-22 14:58:21 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2011-07-28 04:01:11 -0400 |
commit | 014d694e5d59e4219803cd14deaae496d86e4910 (patch) | |
tree | c79d00c812b6f01fc477318cbcc003e2826f9f24 /Documentation/watchdog | |
parent | 234445b4e4542f3e0f216459245ab369a18adcf2 (diff) |
watchdog: WatchDog Timer Driver Core - Add WDIOC_SETTIMEOUT and WDIOC_GETTIMEOUT ioctl
This part add's the WDIOC_SETTIMEOUT and WDIOC_GETTIMEOUT ioctl
functionality to the WatchDog Timer Driver Core framework.
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'Documentation/watchdog')
-rw-r--r-- | Documentation/watchdog/watchdog-kernel-api.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/watchdog/watchdog-kernel-api.txt b/Documentation/watchdog/watchdog-kernel-api.txt index 429f81bf0cf7..acdee39fb08a 100644 --- a/Documentation/watchdog/watchdog-kernel-api.txt +++ b/Documentation/watchdog/watchdog-kernel-api.txt | |||
@@ -42,6 +42,7 @@ struct watchdog_device { | |||
42 | const struct watchdog_info *info; | 42 | const struct watchdog_info *info; |
43 | const struct watchdog_ops *ops; | 43 | const struct watchdog_ops *ops; |
44 | unsigned int bootstatus; | 44 | unsigned int bootstatus; |
45 | unsigned int timeout; | ||
45 | void *driver_data; | 46 | void *driver_data; |
46 | unsigned long status; | 47 | unsigned long status; |
47 | }; | 48 | }; |
@@ -50,6 +51,7 @@ It contains following fields: | |||
50 | * info: a pointer to a watchdog_info structure. This structure gives some | 51 | * info: a pointer to a watchdog_info structure. This structure gives some |
51 | additional information about the watchdog timer itself. (Like it's unique name) | 52 | additional information about the watchdog timer itself. (Like it's unique name) |
52 | * ops: a pointer to the list of watchdog operations that the watchdog supports. | 53 | * ops: a pointer to the list of watchdog operations that the watchdog supports. |
54 | * timeout: the watchdog timer's timeout value (in seconds). | ||
53 | * bootstatus: status of the device after booting (reported with watchdog | 55 | * bootstatus: status of the device after booting (reported with watchdog |
54 | WDIOF_* status bits). | 56 | WDIOF_* status bits). |
55 | * driver_data: a pointer to the drivers private data of a watchdog device. | 57 | * driver_data: a pointer to the drivers private data of a watchdog device. |
@@ -70,6 +72,7 @@ struct watchdog_ops { | |||
70 | /* optional operations */ | 72 | /* optional operations */ |
71 | int (*ping)(struct watchdog_device *); | 73 | int (*ping)(struct watchdog_device *); |
72 | unsigned int (*status)(struct watchdog_device *); | 74 | unsigned int (*status)(struct watchdog_device *); |
75 | int (*set_timeout)(struct watchdog_device *, unsigned int); | ||
73 | }; | 76 | }; |
74 | 77 | ||
75 | It is important that you first define the module owner of the watchdog timer | 78 | It is important that you first define the module owner of the watchdog timer |
@@ -107,6 +110,13 @@ they are supported. These optional routines/operations are: | |||
107 | info structure). | 110 | info structure). |
108 | * status: this routine checks the status of the watchdog timer device. The | 111 | * status: this routine checks the status of the watchdog timer device. The |
109 | status of the device is reported with watchdog WDIOF_* status flags/bits. | 112 | status of the device is reported with watchdog WDIOF_* status flags/bits. |
113 | * set_timeout: this routine checks and changes the timeout of the watchdog | ||
114 | timer device. It returns 0 on success, -EINVAL for "parameter out of range" | ||
115 | and -EIO for "could not write value to the watchdog". On success the timeout | ||
116 | value of the watchdog_device will be changed to the value that was just used | ||
117 | to re-program the watchdog timer device. | ||
118 | (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the | ||
119 | watchdog's info structure). | ||
110 | 120 | ||
111 | The status bits should (preferably) be set with the set_bit and clear_bit alike | 121 | The status bits should (preferably) be set with the set_bit and clear_bit alike |
112 | bit-operations. The status bits that are defined are: | 122 | bit-operations. The status bits that are defined are: |