提交 85d57238 编写于 作者: D Dale Farnsworth 提交者: Wim Van Sebroeck

[WATCHDOG] mv64x60_wdt: Add WDIOC_SETOPTIONS ioctl support

Allow the watchdog timer to be enabled or disabled via the
WDIOC_SETOPTIONS ioctl.
Signed-off-by: NDale Farnsworth <dale@farnsworth.org>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 94796f90
...@@ -132,6 +132,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, ...@@ -132,6 +132,7 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int timeout; int timeout;
int options;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
static struct watchdog_info info = { static struct watchdog_info info = {
.options = WDIOF_SETTIMEOUT | .options = WDIOF_SETTIMEOUT |
...@@ -157,7 +158,15 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file, ...@@ -157,7 +158,15 @@ static int mv64x60_wdt_ioctl(struct inode *inode, struct file *file,
return -EOPNOTSUPP; return -EOPNOTSUPP;
case WDIOC_SETOPTIONS: case WDIOC_SETOPTIONS:
return -EOPNOTSUPP; if (get_user(options, (int __user *)argp))
return -EFAULT;
if (options & WDIOS_DISABLECARD)
mv64x60_wdt_handler_disable();
if (options & WDIOS_ENABLECARD)
mv64x60_wdt_handler_enable();
break;
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
mv64x60_wdt_service(); mv64x60_wdt_service();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册