From: Peng Fan Date: Wed, 24 Jul 2019 08:54:16 +0000 (+0000) Subject: i2c: imx_lpi2c: add ipg clk X-Git-Tag: v2020.01-rc1~23^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d02be21d3004b51c6fc9a54b90d31dcc2dac4a9a;p=oweals%2Fu-boot.git i2c: imx_lpi2c: add ipg clk The controller needs two clk, per clk and ipg clk, so let's add ipg clk. Signed-off-by: Peng Fan --- diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c index 4586d4331f..2de99d019e 100644 --- a/drivers/i2c/imx_lpi2c.c +++ b/drivers/i2c/imx_lpi2c.c @@ -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); diff --git a/include/imx_lpi2c.h b/include/imx_lpi2c.h index 2700e5f876..3ce9edaf10 100644 --- a/include/imx_lpi2c.h +++ b/include/imx_lpi2c.h @@ -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 {