diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-09-08 03:14:07 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-01-21 08:52:23 -0500 |
commit | 5fe65ce7ccbb47b16e17a88bcdac73cffadb80fa (patch) | |
tree | 3eafc26049c47fd996e00eeea53773ae8a7038d3 /drivers/watchdog/imx2_wdt.c | |
parent | bbd5900935be8755b6344386373174b20cd474a2 (diff) |
watchdog: imx2_wdt: Disable power down counter on boot
Disable power down counter of the watchdog to avoid system resets. The
watchdog power down counter is set automatically by the chip. If it is
not set to 0 in the driver, the system resets.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/imx2_wdt.c')
-rw-r--r-- | drivers/watchdog/imx2_wdt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index c50c7d85689f..5142bbabe027 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -52,6 +52,8 @@ | |||
52 | #define IMX2_WDT_WRSR 0x04 /* Reset Status Register */ | 52 | #define IMX2_WDT_WRSR 0x04 /* Reset Status Register */ |
53 | #define IMX2_WDT_WRSR_TOUT (1 << 1) /* -> Reset due to Timeout */ | 53 | #define IMX2_WDT_WRSR_TOUT (1 << 1) /* -> Reset due to Timeout */ |
54 | 54 | ||
55 | #define IMX2_WDT_WMCR 0x08 /* Misc Register */ | ||
56 | |||
55 | #define IMX2_WDT_MAX_TIME 128 | 57 | #define IMX2_WDT_MAX_TIME 128 |
56 | #define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */ | 58 | #define IMX2_WDT_DEFAULT_TIME 60 /* in seconds */ |
57 | 59 | ||
@@ -274,6 +276,13 @@ static int __init imx2_wdt_probe(struct platform_device *pdev) | |||
274 | 276 | ||
275 | imx2_wdt_ping_if_active(wdog); | 277 | imx2_wdt_ping_if_active(wdog); |
276 | 278 | ||
279 | /* | ||
280 | * Disable the watchdog power down counter at boot. Otherwise the power | ||
281 | * down counter will pull down the #WDOG interrupt line for one clock | ||
282 | * cycle. | ||
283 | */ | ||
284 | regmap_write(wdev->regmap, IMX2_WDT_WMCR, 0); | ||
285 | |||
277 | ret = watchdog_register_device(wdog); | 286 | ret = watchdog_register_device(wdog); |
278 | if (ret) { | 287 | if (ret) { |
279 | dev_err(&pdev->dev, "cannot register watchdog device\n"); | 288 | dev_err(&pdev->dev, "cannot register watchdog device\n"); |