i2c: imx_lpi2c: add ipg clk
authorPeng Fan <peng.fan@nxp.com>
Wed, 24 Jul 2019 08:54:16 +0000 (08:54 +0000)
committerStefano Babic <sbabic@denx.de>
Mon, 14 Oct 2019 07:31:41 +0000 (09:31 +0200)
The controller needs two clk, per clk and ipg clk,
so let's add ipg clk.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/i2c/imx_lpi2c.c
include/imx_lpi2c.h

index 4586d4331fad9df171445aaf7248fdd1133d2152..2de99d019e0869e4f7ec1d6d49c460ac40550664 100644 (file)
@@ -471,6 +471,17 @@ static int imx_lpi2c_probe(struct udevice *bus)
                        dev_err(bus, "Failed to enable per clk\n");
                        return ret;
                }
+
+               ret = clk_get_by_name(bus, "ipg", &i2c_bus->ipg_clk);
+               if (ret) {
+                       dev_err(bus, "Failed to get ipg clk\n");
+                       return ret;
+               }
+               ret = clk_enable(&i2c_bus->ipg_clk);
+               if (ret) {
+                       dev_err(bus, "Failed to enable ipg clk\n");
+                       return ret;
+               }
        } else {
                /* To i.MX7ULP, only i2c4-7 can be handled by A7 core */
                ret = enable_i2c_clk(1, bus->seq);
index 2700e5f8763f9cd13597f1055cdc07f43df3a353..3ce9edaf101abd7ee4d57a46c25089df3708a7e8 100644 (file)
@@ -18,6 +18,7 @@ struct imx_lpi2c_bus {
        struct i2c_pads_info *pads_info;
        struct udevice *bus;
        struct clk per_clk;
+       struct clk ipg_clk;
 };
 
 struct imx_lpi2c_reg {