Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: sirfsoc: allow setting timeout in devicetree

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>

authored by

Marcus Folkesson and committed by
Wim Van Sebroeck
f70b1454 1d1dedc2

+5 -1
+4
Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt
··· 5 5 - reg: Address range of tick timer/WDT register set 6 6 - interrupts: interrupt number to the cpu 7 7 8 + Optional properties: 9 + - timeout-sec : Contains the watchdog timeout in seconds 10 + 8 11 Example: 9 12 10 13 timer@b0020000 { 11 14 compatible = "sirf,prima2-tick"; 12 15 reg = <0xb0020000 0x1000>; 13 16 interrupts = <0>; 17 + timeout-sec = <30>; 14 18 };
+1 -1
drivers/watchdog/sirfsoc_wdt.c
··· 29 29 #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ 30 30 #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ 31 31 32 - static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; 32 + static unsigned int timeout; 33 33 static bool nowayout = WATCHDOG_NOWAYOUT; 34 34 35 35 module_param(timeout, uint, 0);