diff options
author | Tom Rini <trini@konsulko.com> | 2020-01-29 09:34:13 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-01-29 09:34:13 -0500 |
commit | e7ab1cb3f0421ad8e8435a8258790e238c623ea2 (patch) | |
tree | fb2e7cce740a30f137dcdce0d2f4b2512ae58498 /drivers/i2c/i2c-uclass.c | |
parent | 3e12744a90241b08788ab7f20b5437381dbc9f68 (diff) | |
parent | 2034f6c27fc91407fe8bbd36670714b77d9ef1dc (diff) |
Merge tag 'for-v2020.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2c
i2c changes for 2020.04
- updates the Designware I2C driver
- get timings from device tree
- handle units in nanoseconds
- make sure that the requested bus speed is not exceeded
- few smaller clean-ups
- adds enums for i2c speed and update drivers which use them
- global_data: remove unused mxc_i2c specific field
Diffstat (limited to 'drivers/i2c/i2c-uclass.c')
-rw-r--r-- | drivers/i2c/i2c-uclass.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index fe77e646193..2aa3efe8aaa 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -641,7 +641,8 @@ static int i2c_post_probe(struct udevice *dev) #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) struct dm_i2c_bus *i2c = dev_get_uclass_priv(dev); - i2c->speed_hz = dev_read_u32_default(dev, "clock-frequency", 100000); + i2c->speed_hz = dev_read_u32_default(dev, "clock-frequency", + I2C_SPEED_STANDARD_RATE); return dm_i2c_set_bus_speed(dev, i2c->speed_hz); #else @@ -699,11 +700,10 @@ int i2c_uclass_init(struct uclass *class) return -ENOMEM; /* Get the last allocated alias. */ -#if CONFIG_IS_ENABLED(OF_CONTROL) - priv->max_id = dev_read_alias_highest_id("i2c"); -#else - priv->max_id = -1; -#endif + if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) + priv->max_id = dev_read_alias_highest_id("i2c"); + else + priv->max_id = -1; debug("%s: highest alias id is %d\n", __func__, priv->max_id); |