]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: i2c_cdns: Enable i2c clock
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Wed, 3 Feb 2021 10:10:46 +0000 (03:10 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 23 Feb 2021 13:56:59 +0000 (14:56 +0100)
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>
drivers/i2c/i2c-cdns.c

index db3c04fa6e754b4327b81c1856a6dc28ba184d19..a650dd69b89f4ed0f5a7e4e5220015c07338c8bf 100644 (file)
@@ -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;
 }