diff options
author | Simon Glass <sjg@chromium.org> | 2020-01-23 11:48:22 -0700 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2020-01-27 07:24:02 +0100 |
commit | f3d461521a8ef6540dbcb2314802eae5790a9408 (patch) | |
tree | ce6d8f74e77beb84779c63718de19065f7d1a25d /drivers/i2c/mv_i2c.c | |
parent | b0a22d0fa9507baa8b3782b392471df94974d831 (diff) | |
download | u-boot-f3d461521a8ef6540dbcb2314802eae5790a9408.zip u-boot-f3d461521a8ef6540dbcb2314802eae5790a9408.tar.gz u-boot-f3d461521a8ef6540dbcb2314802eae5790a9408.tar.bz2 |
i2c: Update drivers to use enum for speed
Convert the obvious uses of i2c bus speeds to use the enum.
Use livetree access for code changes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/i2c/mv_i2c.c')
-rw-r--r-- | drivers/i2c/mv_i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c index 8a56ef9..63665f0 100644 --- a/drivers/i2c/mv_i2c.c +++ b/drivers/i2c/mv_i2c.c @@ -434,7 +434,7 @@ void i2c_init(int speed, int slaveaddr) base_glob = (struct mv_i2c *)CONFIG_MV_I2C_REG; #endif - if (speed > 100000) + if (speed > I2C_SPEED_STANDARD_RATE) val = ICR_FM; else val = ICR_SM; @@ -565,7 +565,7 @@ static int mv_i2c_set_bus_speed(struct udevice *bus, unsigned int speed) struct mv_i2c_priv *priv = dev_get_priv(bus); u32 val; - if (speed > 100000) + if (speed > I2C_SPEED_STANDARD_RATE) val = ICR_FM; else val = ICR_SM; |