diff options
author | Steffen Trumtrar <s.trumtrar@pengutronix.de> | 2021-04-19 14:37:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-03 13:43:11 +0200 |
commit | 87cad179648cecee6d8986527918cc9616a50631 (patch) | |
tree | cdfaa530a860b420d371dad03a8a632e5286f1a7 /drivers | |
parent | d873403324e570a7cee54db3bf233f2437a3a80b (diff) | |
download | barebox-87cad179648cecee6d8986527918cc9616a50631.tar.gz barebox-87cad179648cecee6d8986527918cc9616a50631.tar.xz |
watchdog: imxwd: get and enable clock
This it (at least) necessary for i.MX7s or otherwise barebox will hang
when trying to access the registers of WDOG2/3/4.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Link: https://lore.barebox.org/20210419123747.2373-1-s.trumtrar@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/watchdog/imxwd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/watchdog/imxwd.c b/drivers/watchdog/imxwd.c index b2cfd1cd3a..26c62b7bcb 100644 --- a/drivers/watchdog/imxwd.c +++ b/drivers/watchdog/imxwd.c @@ -21,6 +21,7 @@ #include <restart.h> #include <watchdog.h> #include <reset_source.h> +#include <linux/clk.h> struct imx_wd; @@ -224,6 +225,7 @@ static int imx_wd_probe(struct device_d *dev) { struct resource *iores; struct imx_wd *priv; + struct clk *clk; void *ops; int ret; @@ -237,6 +239,15 @@ static int imx_wd_probe(struct device_d *dev) dev_err(dev, "could not get memory region\n"); return PTR_ERR(iores); } + + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) + return PTR_ERR(clk); + + ret = clk_enable(clk); + if (ret) + return ret; + priv->base = IOMEM(iores->start); priv->ops = ops; priv->wd.set_timeout = imx_watchdog_set_timeout; |