All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq
@ 2018-01-02  7:41 Peng Fan
  2018-01-02  7:41 ` [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number Peng Fan
  2018-01-16  9:47 ` [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Heiko Schocher
  0 siblings, 2 replies; 4+ messages in thread
From: Peng Fan @ 2018-01-02  7:41 UTC (permalink / raw)
  To: u-boot

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>
---
 drivers/i2c/imx_lpi2c.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/imx_lpi2c.c b/drivers/i2c/imx_lpi2c.c
index e7ec17f..de74e89 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;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number
  2018-01-02  7:41 [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Peng Fan
@ 2018-01-02  7:41 ` Peng Fan
  2018-01-16  9:48   ` Heiko Schocher
  2018-01-16  9:47 ` [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Heiko Schocher
  1 sibling, 1 reply; 4+ messages in thread
From: Peng Fan @ 2018-01-02  7:41 UTC (permalink / raw)
  To: u-boot

Modify the lpi2c alias seq number to align with device.
Then no need to add 4 to get the device index.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx7ulp.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/dts/imx7ulp.dtsi b/arch/arm/dts/imx7ulp.dtsi
index 5497734..a8458f8 100644
--- a/arch/arm/dts/imx7ulp.dtsi
+++ b/arch/arm/dts/imx7ulp.dtsi
@@ -27,10 +27,10 @@
 		serial2 = &lpuart6;
 		serial3 = &lpuart7;
 		usbphy0 = &usbphy1;
-		i2c0 = &lpi2c4;
-		i2c1 = &lpi2c5;
-		i2c2 = &lpi2c6;
-		i2c3 = &lpi2c7;
+		i2c4 = &lpi2c4;
+		i2c5 = &lpi2c5;
+		i2c6 = &lpi2c6;
+		i2c7 = &lpi2c7;
 	};
 
 	cpus {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq
  2018-01-02  7:41 [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Peng Fan
  2018-01-02  7:41 ` [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number Peng Fan
@ 2018-01-16  9:47 ` Heiko Schocher
  1 sibling, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2018-01-16  9:47 UTC (permalink / raw)
  To: u-boot

Hello Peng,

Am 02.01.2018 um 08:41 schrieb Peng Fan:
> 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>
> ---
>   drivers/i2c/imx_lpi2c.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-i2c.git master

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number
  2018-01-02  7:41 ` [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number Peng Fan
@ 2018-01-16  9:48   ` Heiko Schocher
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2018-01-16  9:48 UTC (permalink / raw)
  To: u-boot

Hello Peng,

Am 02.01.2018 um 08:41 schrieb Peng Fan:
> Modify the lpi2c alias seq number to align with device.
> Then no need to add 4 to get the device index.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>   arch/arm/dts/imx7ulp.dtsi | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-i2c.git master

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-16  9:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02  7:41 [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Peng Fan
2018-01-02  7:41 ` [U-Boot] [PATCH 2/2] imx: mx7ulp: modify lpi2c seq number Peng Fan
2018-01-16  9:48   ` Heiko Schocher
2018-01-16  9:47 ` [U-Boot] [PATCH 1/2] i2c: lpi2c: do not add 4 for bus seq Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.