aboutsummaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2021-03-10 21:02:19 -0500
committerLeo Yu-Chi Liang <ycliang@andestech.com>2021-04-08 15:37:27 +0800
commit4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c (patch)
tree360e9e9a07ecfac53727614ea5bee42ac1dc9b80 /drivers/watchdog
parent7d8394366a3b1a8bcbc4ea3460ff5c0901335731 (diff)
downloadu-boot-4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c.zip
u-boot-4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c.tar.gz
u-boot-4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c.tar.bz2
wdt: dw: Enable the clock before using it
The watchdog won't work if the clock isn't enabled. Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6 Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/designware_wdt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index a65487d..709a67f 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -129,6 +129,10 @@ static int designware_wdt_probe(struct udevice *dev)
if (ret)
return ret;
+ ret = clk_enable(&clk);
+ if (ret)
+ return ret;
+
priv->clk_khz = clk_get_rate(&clk) / 1000;
if (!priv->clk_khz)
return -EINVAL;