1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-18 00:11:48 +02:00

dm: i2c: Make API accessible even without CONFIG_DM

Make the driver model I2C API available always, even if driver model
is not enabled. This allows for a 'soft' switch-over, where drivers can
use the new structures in code which is compiled but not yet used. This
makes migration easier in some cases.

Fix up the existing drivers which define their own 'struct i2c_msg'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
Simon Glass
2015-02-05 21:41:33 -07:00
parent ca88b9b939
commit fffff7268b
4 changed files with 17 additions and 20 deletions

View File

@@ -25,14 +25,13 @@
* enough as to be incompatible for compilation purposes.
*/
#ifdef CONFIG_DM_I2C
enum dm_i2c_chip_flags {
DM_I2C_CHIP_10BIT = 1 << 0, /* Use 10-bit addressing */
DM_I2C_CHIP_RD_ADDRESS = 1 << 1, /* Send address for each read byte */
DM_I2C_CHIP_WR_ADDRESS = 1 << 2, /* Send address for each write byte */
};
struct udevice;
/**
* struct dm_i2c_chip - information about an i2c chip
*
@@ -439,8 +438,6 @@ int i2c_get_chip_for_busnum(int busnum, int chip_addr, uint offset_len,
int i2c_chip_ofdata_to_platdata(const void *blob, int node,
struct dm_i2c_chip *chip);
#endif
#ifndef CONFIG_DM_I2C
/*