
On 10 December 2014 at 08:55, Simon Glass sjg@chromium.org wrote:
The uclass implements the same operations as the current I2C framework but makes some changes to make it fit driver model better:
- Remove the chip address from API calls
- Remove the address length from API calls
- Remove concept of 'current' I2C bus
- Drop all existing init functions
Acked-by: Heiko Schocher hs@denx.de Reviewed-by: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Simon Glass sjg@chromium.org
Changes in v6: None Changes in v5:
- Add a function comment for i2c_probe_chip()
- Add an assert for offset_len in i2c_setup_offset()
- Add more detail to return value comment on get_buf_speed()
- Add more detail to return value comment on xfer() method
- Fix -INVAL typo
- Make i2c_get_bus_speed() independent of i2c_set_bus_speed()
- Split DM_I2C_CHIP_RD_ADDRESS into read and write varaints
- Update comments in struct i2c_msg to allow buf to be NULL
- Use a NULL buffer in i2c_probe_chip()
Changes in v4:
- Add a constant for I2C_MAX_OFFSET_LEN
- Add a probe_chip() method to the uclass
- Add chip flags to i2c_probe()
- Add comment to i2c_setup_offset()
- Add comments to indicate which methods are optional
- Add comments to set_bus_speed() method
- Adjust i2c_bind_driver() to avoid calloc()/free()
- Drop set_offset_len() method
- Fix copying of chip flags to message in i2c_setup_offset()
- Fix endianness of i2c_setup_offset()
- Fix method comment for xfer()
- Invert return value of i2c_setup_offset()
- Probe with a message length of 0
- Rename i2c_generic_drv to i2c_generic_chip_drv
- Rename i2c_read_bytewise() and implement a real one
Changes in v3:
- Add a helper to query chip flags
- Add support for reading a byte at a time with an address for each byte
- Change uclass <=> driver API to use a message list
- Correct bogus address len code (was confused with chip address length)
- Drop extra call to i2c_bind_driver() in i2c_probe()
Changes in v2:
- Add a 'deblock' method to recover an I2C bus stuck in mid-transaction
- Add a helper function to find a chip on a particular bus number
- Add some debugging for generic I2C device binding
- Fix cihp typo
- Implement generic I2C devices to allow 'i2c probe' on unknown devices
- Return the probed device from i2c_probe()
- Set the bus speed after the bus is probed
drivers/i2c/Makefile | 1 + drivers/i2c/i2c-uclass.c | 466 +++++++++++++++++++++++++++++++++++++++++++++ include/config_fallbacks.h | 6 + include/dm/uclass-id.h | 2 + include/i2c.h | 352 ++++++++++++++++++++++++++++++++++ 5 files changed, 827 insertions(+) create mode 100644 drivers/i2c/i2c-uclass.c
Applied to u-boot-dm.