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 /include | |
parent | 3e12744a90241b08788ab7f20b5437381dbc9f68 (diff) | |
parent | 2034f6c27fc91407fe8bbd36670714b77d9ef1dc (diff) | |
download | u-boot-WIP/29Jan2020.tar.gz |
Merge tag 'for-v2020.04' of https://gitlab.denx.de/u-boot/custodians/u-boot-i2cWIP/29Jan2020
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 'include')
-rw-r--r-- | include/asm-generic/global_data.h | 3 | ||||
-rw-r--r-- | include/i2c.h | 26 |
2 files changed, 26 insertions, 3 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 7587ba2ee5..5d027329fe 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -90,9 +90,6 @@ typedef struct global_data { #if defined(CONFIG_SYS_I2C) int cur_i2c_bus; /* current used i2c bus */ #endif -#ifdef CONFIG_SYS_I2C_MXC - void *srdata[10]; -#endif unsigned int timebase_h; unsigned int timebase_l; #if CONFIG_VAL(SYS_MALLOC_F_LEN) diff --git a/include/i2c.h b/include/i2c.h index 72e2e8e426..0faf8542e2 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -30,6 +30,32 @@ enum dm_i2c_chip_flags { DM_I2C_CHIP_WR_ADDRESS = 1 << 2, /* Send address for each write byte */ }; +/** enum i2c_speed_mode - standard I2C speed modes */ +enum i2c_speed_mode { + IC_SPEED_MODE_STANDARD, + IC_SPEED_MODE_FAST, + IC_SPEED_MODE_FAST_PLUS, + IC_SPEED_MODE_HIGH, + IC_SPEED_MODE_FAST_ULTRA, + + IC_SPEED_MODE_COUNT, +}; + +/** enum i2c_speed_rate - standard I2C speeds in Hz */ +enum i2c_speed_rate { + I2C_SPEED_STANDARD_RATE = 100000, + I2C_SPEED_FAST_RATE = 400000, + I2C_SPEED_FAST_PLUS_RATE = 1000000, + I2C_SPEED_HIGH_RATE = 3400000, + I2C_SPEED_FAST_ULTRA_RATE = 5000000, +}; + +/** enum i2c_address_mode - available address modes */ +enum i2c_address_mode { + I2C_MODE_7_BIT, + I2C_MODE_10_BIT +}; + struct udevice; /** * struct dm_i2c_chip - information about an i2c chip |