diff options
author | Sean Anderson <seanga2@gmail.com> | 2021-03-11 05:02:19 +0300 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2021-04-08 10:37:27 +0300 |
commit | 4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c (patch) | |
tree | 360e9e9a07ecfac53727614ea5bee42ac1dc9b80 /drivers/watchdog/designware_wdt.c | |
parent | 7d8394366a3b1a8bcbc4ea3460ff5c0901335731 (diff) | |
download | u-boot-4cb0ab4ebcffbeee93d9bdb4e8ee831e16bc8d2c.tar.xz |
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/designware_wdt.c')
-rw-r--r-- | drivers/watchdog/designware_wdt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c index a65487d4f3..709a67fbc3 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; |