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

watchdog: meson: 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>
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
4590d62c b82e6953

+5 -1
+4
Documentation/devicetree/bindings/watchdog/meson-wdt.txt
··· 9 9 "amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs 10 10 - reg : Specifies base physical address and size of the registers. 11 11 12 + Optional properties: 13 + - timeout-sec: contains the watchdog timeout in seconds. 14 + 12 15 Example: 13 16 14 17 wdt: watchdog@c1109900 { 15 18 compatible = "amlogic,meson6-wdt"; 16 19 reg = <0xc1109900 0x8>; 20 + timeout-sec = <10>; 17 21 };
+1 -1
drivers/watchdog/meson_wdt.c
··· 36 36 #define MESON_SEC_TO_TC(s, c) ((s) * (c)) 37 37 38 38 static bool nowayout = WATCHDOG_NOWAYOUT; 39 - static unsigned int timeout = MESON_WDT_TIMEOUT; 39 + static unsigned int timeout; 40 40 41 41 struct meson_wdt_data { 42 42 unsigned int enable;