mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
watchdog: hpwdt: Add support for WDIOC_SETOPTIONS
WDIOC_SETOPTIONS makes it possible to disable and re-enable the watchdog timer while the hpwdt driver is loaded. Signed-off-by: Jean Delvare <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
This commit is contained in:
parent
a47911e99f
commit
46c80b20d0
1 changed files with 15 additions and 1 deletions
|
|
@ -588,7 +588,7 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
|
|||
{
|
||||
void __user *argp = (void __user *)arg;
|
||||
int __user *p = argp;
|
||||
int new_margin;
|
||||
int new_margin, options;
|
||||
int ret = -ENOTTY;
|
||||
|
||||
switch (cmd) {
|
||||
|
|
@ -608,6 +608,20 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
|
|||
ret = 0;
|
||||
break;
|
||||
|
||||
case WDIOC_SETOPTIONS:
|
||||
ret = get_user(options, p);
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
if (options & WDIOS_DISABLECARD)
|
||||
hpwdt_stop();
|
||||
|
||||
if (options & WDIOS_ENABLECARD) {
|
||||
hpwdt_start();
|
||||
hpwdt_ping();
|
||||
}
|
||||
break;
|
||||
|
||||
case WDIOC_SETTIMEOUT:
|
||||
ret = get_user(new_margin, p);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in a new issue