[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401289196-27567-1-git-send-email-tord.andersson@endian.se>
Date: Wed, 28 May 2014 16:59:56 +0200
From: Tord Andersson <tord.o.andersson@...il.com>
To: Wim Van Sebroeck <wim@...ana.be>, linux-watchdog@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
Tord Andersson <tord.andersson@...ian.se>
Subject: [PATCH 1/1] watchdog: imx2: Added ioctl options to enable/disable watchdog as wanted by systemd.
When the current imx2 watchdog driver is used with the systemd watchdog feature,
we get "Failed to enable hardware watchdog: Inappropriate ioctl for device".
This is caused by missing ioctl setoptions to enable the watchdog.
This patch will add WDIOC_SETOPTIONS for WDIOS_ENABLECARD and WDIOS_DISABLECARD.
Signed-off-by: Tord Andersson <tord.andersson@...ian.se>
---
drivers/watchdog/imx2_wdt.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index dd51d95..180c6a5 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -196,6 +196,17 @@ static long imx2_wdt_ioctl(struct file *file, unsigned int cmd,
new_value = val & IMX2_WDT_WRSR_TOUT ? WDIOF_CARDRESET : 0;
return put_user(new_value, p);
+ case WDIOC_SETOPTIONS:
+ if (get_user(new_value, p))
+ return -EFAULT;
+ if (new_value & WDIOS_ENABLECARD)
+ imx2_wdt_start();
+ else if (new_value & WDIOS_DISABLECARD)
+ imx2_wdt_stop();
+ else
+ return -EINVAL;
+ return 0;
+
case WDIOC_KEEPALIVE:
imx2_wdt_ping();
return 0;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists