summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-11-08 12:03:32 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-11 09:20:18 +0100
commit0ae3c6ab8eaf2291905541914d972320cfa0910c (patch)
tree704bb1321aacb59108c10e5986bc297e15748948
parentfabd576bd3122004e66ceb53743071b1a96b59da (diff)
downloadbarebox-0ae3c6ab8eaf2291905541914d972320cfa0910c.tar.gz
watchdog: f71808e: support .running device parameter
The American Megatrends BIOS I am using can be configured to start the Fintek watchdog prior to the UEFI payloads. To avoid BIOS updates that reset this functionality going unnoticed, implement support for WDOG_HW_RUNNING. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/watchdog/f71808e_wdt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
index 4f881a1..5307ab0 100644
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -222,7 +222,7 @@ static int f71808e_wdt_init(struct f71808e_wdt *wd, struct device_d *dev)
{
struct watchdog *wdd = &wd->wdd;
const char * const *names = pulse_width_names;
- int wdt_conf;
+ unsigned long wdt_conf;
int ret;
superio_enter(wd->sioaddr);
@@ -262,6 +262,11 @@ static int f71808e_wdt_init(struct f71808e_wdt *wd, struct device_d *dev)
dev_info(dev, "reset reason: %s\n", reset_source_name());
+ if (test_bit(F71808FG_FLAG_WD_EN, &wdt_conf))
+ wdd->running = WDOG_HW_RUNNING;
+ else
+ wdd->running = WDOG_HW_NOT_RUNNING;
+
ret = watchdog_register(wdd);
if (ret)
return ret;