summaryrefslogtreecommitdiff
path: root/drivers/i2c/adi_i2c.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-02-05 21:41:33 -0700
committerSimon Glass <sjg@chromium.org>2015-02-12 10:35:33 -0700
commitfffff7268b6c30dc7058d3615021628d4f60fac5 (patch)
tree5927701b5924f1a49b65f79339eaf02c706b0a3b /drivers/i2c/adi_i2c.c
parentca88b9b93916f66c6737527aa955d2c1b4758080 (diff)
downloadu-boot-imx-fffff7268b6c30dc7058d3615021628d4f60fac5.zip
u-boot-imx-fffff7268b6c30dc7058d3615021628d4f60fac5.tar.gz
u-boot-imx-fffff7268b6c30dc7058d3615021628d4f60fac5.tar.bz2
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>
Diffstat (limited to 'drivers/i2c/adi_i2c.c')
-rw-r--r--drivers/i2c/adi_i2c.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/adi_i2c.c b/drivers/i2c/adi_i2c.c
index 20495b1..c58f14a 100644
--- a/drivers/i2c/adi_i2c.c
+++ b/drivers/i2c/adi_i2c.c
@@ -63,7 +63,7 @@ struct twi_regs {
#endif
/* All transfers are described by this data structure */
-struct i2c_msg {
+struct adi_i2c_msg {
u8 flags;
#define I2C_M_COMBO 0x4
#define I2C_M_STOP 0x2
@@ -81,7 +81,7 @@ struct i2c_msg {
* wait_for_completion - manage the actual i2c transfer
* @msg: the i2c msg
*/
-static int wait_for_completion(struct twi_regs *twi, struct i2c_msg *msg)
+static int wait_for_completion(struct twi_regs *twi, struct adi_i2c_msg *msg)
{
u16 int_stat, ctl;
ulong timebase = get_timer(0);
@@ -151,7 +151,7 @@ static int i2c_transfer(struct i2c_adapter *adap, uint8_t chip, uint addr,
(addr >> 8),
(addr >> 16),
};
- struct i2c_msg msg = {
+ struct adi_i2c_msg msg = {
.flags = flags | (len >= 0xff ? I2C_M_STOP : 0),
.buf = buffer,
.len = len,