]> git.baikalelectronics.ru Git - kernel.git/commitdiff
watchdog: omap_wdt: early_enable module parameter
authorLars Poeschel <poeschel@lemonage.de>
Thu, 25 Jun 2015 10:21:51 +0000 (12:21 +0200)
committerWim Van Sebroeck <wim@iguana.be>
Wed, 1 Jul 2015 14:43:17 +0000 (16:43 +0200)
Add a early_enable module parameter to the omap_wdt that starts the
watchdog on module insertion. The default value is 0 which does not
start the watchdog - which also does not change the behavior if the
parameter is not given.

Signed-off-by: Lars Poeschel <poeschel@lemonage.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Documentation/watchdog/watchdog-parameters.txt
drivers/watchdog/omap_wdt.c

index 74252c431e05cb3d82eaa9e64a387b5dacc2fba4..9f9ec9f76039404a15114c97fe67535fe41fa88c 100644 (file)
@@ -208,6 +208,7 @@ nowayout: Watchdog cannot be stopped once started
 -------------------------------------------------
 omap_wdt:
 timer_margin: initial watchdog timeout (in seconds)
+early_enable: Watchdog is started on module insertion (default=0
 nowayout: Watchdog cannot be stopped once started
        (default=kernel config parameter)
 -------------------------------------------------
index ebea6e66fba97087253c8f18ed6e744a10f9dad8..de911c7e477c2875fe3633bce5a72a6b45fb95c0 100644 (file)
@@ -55,6 +55,11 @@ MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)");
 
 #define to_omap_wdt_dev(_wdog) container_of(_wdog, struct omap_wdt_dev, wdog)
 
+static bool early_enable;
+module_param(early_enable, bool, 0);
+MODULE_PARM_DESC(early_enable,
+       "Watchdog is started on module insertion (default=0)");
+
 struct omap_wdt_dev {
        struct watchdog_device wdog;
        void __iomem    *base;          /* physical */
@@ -279,6 +284,9 @@ static int omap_wdt_probe(struct platform_device *pdev)
 
        pm_runtime_put_sync(wdev->dev);
 
+       if (early_enable)
+               omap_wdt_start(&wdev->wdog);
+
        return 0;
 }