Skip to contentSkip to conversation

i2c: designware_i2c: Correct the selection of speed mode

PATCH New Simon Glass 2 participants 3 messages Feb 13, 2020 – Feb 18, 2020 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: designware_i2c: Correct the selection of speed mode

Unfortunately a recent change adjusted the order of the checks here such that 400MHz now shows up as fast-plus speed (1Mbps). Fix it.

Fixes d96440d1e3 ("i2c: designware_i2c: Add support for fast-plus speed")

---

 drivers/i2c/designware_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/designware_i2c.c +2 -2
index e1d5aeb19d..0b5e70af59 100644
@@ -212,9 +212,9 @@ static int calc_bus_speed(struct dw_i2c *priv, int speed, ulong bus_clk,
 	if (speed >= I2C_SPEED_HIGH_RATE &&
 	    (!scl_sda_cfg || scl_sda_cfg->has_high_speed))
 		i2c_spd = IC_SPEED_MODE_HIGH;
-	else if (speed >= I2C_SPEED_FAST_RATE)
-		i2c_spd = IC_SPEED_MODE_FAST_PLUS;
 	else if (speed >= I2C_SPEED_FAST_PLUS_RATE)
+		i2c_spd = IC_SPEED_MODE_FAST_PLUS;
+	else if (speed >= I2C_SPEED_FAST_RATE)
 		i2c_spd = IC_SPEED_MODE_FAST;
 	else
 		i2c_spd = IC_SPEED_MODE_STANDARD;
Signature · 1 line
2.25.0.265.gbab2e86ba0-goog
#1 lore raw

PATCH 1/1 i2c: designware_i2c: Correct the selection of speed mode

Hello Simon,

Am 13.02.2020 um 21:24 schrieb Simon Glass:

Quoted 9 lines

Unfortunately a recent change adjusted the order of the checks here such that 400MHz now shows up as fast-plus speed (1Mbps). Fix it.

Fixes d96440d1e3 ("i2c: designware_i2c: Add support for fast-plus speed")

---

  drivers/i2c/designware_i2c.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

I started travis build, and if successful, I send pull request to Tom soon, thanks for detecting this.

bye,
Heiko

Signature · 3 lines
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
#2 lore raw

PATCH 1/1 i2c: designware_i2c: Correct the selection of speed mode

In reply to Simon Glass

Hello Simon,

Am 13.02.2020 um 21:24 schrieb Simon Glass:

Quoted 9 lines

Unfortunately a recent change adjusted the order of the checks here such that 400MHz now shows up as fast-plus speed (1Mbps). Fix it.

Fixes d96440d1e3 ("i2c: designware_i2c: Add support for fast-plus speed")

---

  drivers/i2c/designware_i2c.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-i2c master

Thanks!

bye,
Heiko

Signature · 3 lines
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