diff options
author | T Karthik Reddy <t.karthik.reddy@xilinx.com> | 2021-02-03 03:10:46 -0700 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2021-02-23 14:56:59 +0100 |
commit | 8faa7913a425e9737df8e4183030dd72c1d668b7 (patch) | |
tree | bd23dc1a2b31346c812ac329acf6ad3bb1e7c5e9 /drivers/i2c | |
parent | 60b03f1cc408ffd2360303da4c5d09bec47b8cc2 (diff) | |
download | u-boot-8faa7913a425e9737df8e4183030dd72c1d668b7.zip u-boot-8faa7913a425e9737df8e4183030dd72c1d668b7.tar.gz u-boot-8faa7913a425e9737df8e4183030dd72c1d668b7.tar.bz2 |
i2c: i2c_cdns: Enable i2c clock
Enable i2c controller clock from driver probe function
by calling clk_enable().
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-cdns.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-cdns.c b/drivers/i2c/i2c-cdns.c index db3c04f..a650dd6 100644 --- a/drivers/i2c/i2c-cdns.c +++ b/drivers/i2c/i2c-cdns.c @@ -15,6 +15,7 @@ #include <linux/types.h> #include <linux/io.h> #include <linux/errno.h> +#include <dm/device_compat.h> #include <dm/root.h> #include <i2c.h> #include <fdtdec.h> @@ -481,6 +482,12 @@ static int cdns_i2c_of_to_plat(struct udevice *dev) i2c_bus->input_freq = clk_get_rate(&clk); + ret = clk_enable(&clk); + if (ret) { + dev_err(dev, "failed to enable clock\n"); + return ret; + } + return 0; } |