aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/mvtwsi.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-01-23 11:48:22 -0700
committerHeiko Schocher <hs@denx.de>2020-01-27 07:24:02 +0100
commitf3d461521a8ef6540dbcb2314802eae5790a9408 (patch)
treece6d8f74e77beb84779c63718de19065f7d1a25d /drivers/i2c/mvtwsi.c
parentb0a22d0fa9507baa8b3782b392471df94974d831 (diff)
downloadu-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/mvtwsi.c')
-rw-r--r--drivers/i2c/mvtwsi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index 0a2dafc..382cf4b 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -805,8 +805,9 @@ static int mvtwsi_i2c_ofdata_to_platdata(struct udevice *bus)
"cell-index", -1);
dev->slaveadd = fdtdec_get_int(gd->fdt_blob, dev_of_offset(bus),
"u-boot,i2c-slave-addr", 0x0);
- dev->speed = fdtdec_get_int(gd->fdt_blob, dev_of_offset(bus),
- "clock-frequency", 100000);
+ dev->speed = dev_read_u32_default(bus, "clock-frequency",
+ I2C_SPEED_STANDARD_RATE);
+
return 0;
}