]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
watchdog: sirfsoc: allow setting timeout in devicetree
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Sun, 11 Feb 2018 20:08:43 +0000 (21:08 +0100)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 3 Mar 2018 16:04:13 +0000 (17:04 +0100)
watchdog_init_timeout() will allways pick timeout_param since it
defaults to a valid timeout.

By following best practice described in
Documentation/watchdog/watchdog-kernel-api.txt, it also
let us to set timout-sec property in devicetree.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
drivers/watchdog/sirfsoc_wdt.c

index 9cbc76c89b2b979004f256de706fcd522e5c4774..0dce5e3100b499e550278052a20b7f7d75c2c5ec 100644 (file)
@@ -5,10 +5,14 @@ Required properties:
 - reg: Address range of tick timer/WDT register set
 - interrupts: interrupt number to the cpu
 
+Optional properties:
+- timeout-sec : Contains the watchdog timeout in seconds
+
 Example:
 
 timer@b0020000 {
        compatible = "sirf,prima2-tick";
        reg = <0xb0020000 0x1000>;
        interrupts = <0>;
+       timeout-sec = <30>;
 };
index 4eea351e09b0d205d20e771e2349abc04d6310f8..ac0c9d2c4aee4ff8f14b92fd5b7a8c7e74fc0248 100644 (file)
@@ -29,7 +29,7 @@
 #define SIRFSOC_WDT_MAX_TIMEOUT                (10 * 60)       /* 10 mins */
 #define SIRFSOC_WDT_DEFAULT_TIMEOUT    30              /* 30 secs */
 
-static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT;
+static unsigned int timeout;
 static bool nowayout = WATCHDOG_NOWAYOUT;
 
 module_param(timeout, uint, 0);