diff options
author | Ray Jui <ray.jui@broadcom.com> | 2018-05-28 14:01:34 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2018-08-02 09:57:10 -0400 |
commit | b800885888406f33edfec0eb1cb752292f23de83 (patch) | |
tree | 9d7843f1cdfe9c21a238fadc1defc8f81eb10966 | |
parent | 42bf5c4442badc524a92d66b0d881ea82396dfab (diff) |
watchdog: sp805: add 'timeout-sec' DT property support
Add support for optional devicetree property 'timeout-sec'.
'timeout-sec' is used in the driver if specified in devicetree.
Otherwise, fall back to driver default, i.e., 60 seconds
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.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@linux-watchdog.org>
-rw-r--r-- | drivers/watchdog/sp805_wdt.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 9849db0743a7..b240195597c1 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c | |||
@@ -244,7 +244,14 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) | |||
244 | watchdog_set_nowayout(&wdt->wdd, nowayout); | 244 | watchdog_set_nowayout(&wdt->wdd, nowayout); |
245 | watchdog_set_drvdata(&wdt->wdd, wdt); | 245 | watchdog_set_drvdata(&wdt->wdd, wdt); |
246 | watchdog_set_restart_priority(&wdt->wdd, 128); | 246 | watchdog_set_restart_priority(&wdt->wdd, 128); |
247 | wdt_setload(&wdt->wdd, DEFAULT_TIMEOUT); | 247 | |
248 | /* | ||
249 | * If 'timeout-sec' devicetree property is specified, use that. | ||
250 | * Otherwise, use DEFAULT_TIMEOUT | ||
251 | */ | ||
252 | wdt->wdd.timeout = DEFAULT_TIMEOUT; | ||
253 | watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); | ||
254 | wdt_setload(&wdt->wdd, wdt->wdd.timeout); | ||
248 | 255 | ||
249 | ret = watchdog_register_device(&wdt->wdd); | 256 | ret = watchdog_register_device(&wdt->wdd); |
250 | if (ret) { | 257 | if (ret) { |