summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-02-18 07:08:05 -0500
committerTom Rini <trini@konsulko.com>2020-02-18 07:08:05 -0500
commit42a2de54d066c256925b85f6885179c9999811e4 (patch)
treeab51d2e21217e4a56847d09e186796815f05a943
parentf2a73d6867ef973fbb8471cc87058205999b5e5c (diff)
parent64d44c4e9f4fe048aca69db7b6a208ab9e55f9b2 (diff)
Merge tag 'bugfixes-for-v2020.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
i2c bugfixes for 2020.04 - i2c: designware_i2c: Correct the selection of speed mode Fixes: d96440d1e3 ("i2c: designware_i2c: Add support for fast-plus speed")
-rw-r--r--drivers/i2c/designware_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c
index e1d5aeb19d..0b5e70af59 100644
--- a/drivers/i2c/designware_i2c.c
+++ b/drivers/i2c/designware_i2c.c
@@ -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;