summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-01-02 15:41:52 +0800
committerHeiko Schocher <hs@denx.de>2018-01-16 06:58:59 +0100
commit0074d4bf2d9f9b32b9939dfba6c84a160d250763 (patch)
treea96d88702ccbe8a90ff20ee4a8f42ee469092f9b
parentfdb6c3232f66bc9c07c30de87928506477ac4e63 (diff)
i2c: lpi2c: do not add 4 for bus seq
The number 4 is dedicated on i.MX7ULP, but lpi2c will be reused on i.MX8, 4 is not valid. The seq number could be configured by alias node. The following patch will use i2c4 as the begin for i.MX7ULP. Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--drivers/i2c/imx_lpi2c.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index e7ec17fe9e1..de74e89efdc 100644
--- a/drivers/i2c/imx_lpi2c.c
+++ b/drivers/i2c/imx_lpi2c.c
@@ -258,7 +258,7 @@ static int bus_i2c_set_bus_speed(struct udevice *bus, int speed)
int i;
regs = (struct imx_lpi2c_reg *)devfdt_get_addr(bus);
- clock_rate = imx_get_i2cclk(bus->seq + 4);
+ clock_rate = imx_get_i2cclk(bus->seq);
if (!clock_rate)
return -EPERM;
@@ -419,14 +419,14 @@ static int imx_lpi2c_probe(struct udevice *bus)
i2c_bus->bus = bus;
/* power up i2c resource */
- ret = init_i2c_power(bus->seq + 4);
+ ret = init_i2c_power(bus->seq);
if (ret) {
debug("init_i2c_power err = %d\n", ret);
return ret;
}
- /* Enable clk, only i2c4-7 can be handled by A7 core */
- ret = enable_i2c_clk(1, bus->seq + 4);
+ /* To i.MX7ULP, only i2c4-7 can be handled by A7 core */
+ ret = enable_i2c_clk(1, bus->seq);
if (ret < 0)
return ret;