From ec0f64b0b3abe832e851d74b79d906f5e0fceacb Mon Sep 17 00:00:00 2001 From: Grant Grundler Date: Tue, 5 Feb 2013 17:51:04 -0800 Subject: [PATCH] CHROMIUM: watchdog: add WDIOC_GETBOOTSTATUS support to s3c2410_wdt Exynos5 can report the most recent "reset" (or boot) cause. In particular, WDIOC_GETBOOTSTATUS ioctl (to /dev/watchdog) can let users know if the HW watchdog timed out and reset the machine. BUG=chrome-os-partner:9403 TEST=manual Change-Id: Iceb63d8404e25200846f75e6ce44da62749246dd Signed-off-by: Grant Grundler Reviewed-on: https://gerrit.chromium.org/gerrit/42759 Reviewed-by: Doug Anderson --- drivers/watchdog/s3c2410_wdt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 1789d5597a3a..44bf610239fd 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -43,6 +43,12 @@ #include +#ifdef CONFIG_ARCH_EXYNOS +#include /* for exynos_get_bootstatus() */ +#else +#define exynos_get_bootstatus() (0) +#endif + #undef S3C_VA_WATCHDOG #define S3C_VA_WATCHDOG (0) @@ -396,6 +402,8 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) watchdog_set_nowayout(&s3c2410_wdd, nowayout); + s3c2410_wdd.bootstatus = exynos_get_bootstatus(); + ret = watchdog_register_device(&s3c2410_wdd); if (ret) { dev_err(dev, "cannot register watchdog (%d)\n", ret); -- 2.20.1