diff options
author | Marcus Folkesson <marcus.folkesson@gmail.com> | 2018-02-11 15:08:45 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2018-03-03 11:04:14 -0500 |
commit | b82e6953acf46466b97bc592492f206b719f58b5 (patch) | |
tree | 7fb42dcabc1383d695d4771167950888b31ec693 | |
parent | d956aa7875166f1df2256c23a2bba143322f3c8f (diff) |
watchdog: mtk: 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>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 4 | ||||
-rw-r--r-- | drivers/watchdog/mtk_wdt.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt index 5b38a30e608c..859dee167b91 100644 --- a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | |||
@@ -11,9 +11,13 @@ Required properties: | |||
11 | 11 | ||
12 | - reg : Specifies base physical address and size of the registers. | 12 | - reg : Specifies base physical address and size of the registers. |
13 | 13 | ||
14 | Optional properties: | ||
15 | - timeout-sec: contains the watchdog timeout in seconds. | ||
16 | |||
14 | Example: | 17 | Example: |
15 | 18 | ||
16 | wdt: watchdog@10000000 { | 19 | wdt: watchdog@10000000 { |
17 | compatible = "mediatek,mt6589-wdt"; | 20 | compatible = "mediatek,mt6589-wdt"; |
18 | reg = <0x10000000 0x18>; | 21 | reg = <0x10000000 0x18>; |
22 | timeout-sec = <10>; | ||
19 | }; | 23 | }; |
diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index 7ed417a765c7..fcdc10ec28a3 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c | |||
@@ -57,7 +57,7 @@ | |||
57 | #define DRV_VERSION "1.0" | 57 | #define DRV_VERSION "1.0" |
58 | 58 | ||
59 | static bool nowayout = WATCHDOG_NOWAYOUT; | 59 | static bool nowayout = WATCHDOG_NOWAYOUT; |
60 | static unsigned int timeout = WDT_MAX_TIMEOUT; | 60 | static unsigned int timeout; |
61 | 61 | ||
62 | struct mtk_wdt_dev { | 62 | struct mtk_wdt_dev { |
63 | struct watchdog_device wdt_dev; | 63 | struct watchdog_device wdt_dev; |