dm: i2c: Rename driver model I2C functions to permit compatibility
Add a dm_ prefix to driver model I2C functions so that we can keep the old ones around. This is a little unfortunate, but on reflection it is too difficult to change the API. We can undo this rename when most boards and drivers are converted to use driver model for I2C. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -31,7 +31,7 @@ static int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = i2c_read(pmic, reg, value, 1);
|
||||
err = dm_i2c_read(pmic, reg, value, 1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -42,7 +42,7 @@ static int as3722_write(struct udevice *pmic, u8 reg, u8 value)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = i2c_write(pmic, reg, &value, 1);
|
||||
err = dm_i2c_write(pmic, reg, &value, 1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ static int tps6586x_read(int reg)
|
||||
int retval = -1;
|
||||
|
||||
for (i = 0; i < MAX_I2C_RETRY; ++i) {
|
||||
if (!i2c_read(tps6586x_dev, reg, &data, 1)) {
|
||||
if (!dm_i2c_read(tps6586x_dev, reg, &data, 1)) {
|
||||
retval = (int)data;
|
||||
goto exit;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ static int tps6586x_write(int reg, uchar *data, uint len)
|
||||
int retval = -1;
|
||||
|
||||
for (i = 0; i < MAX_I2C_RETRY; ++i) {
|
||||
if (!i2c_write(tps6586x_dev, reg, data, len)) {
|
||||
if (!dm_i2c_write(tps6586x_dev, reg, data, len)) {
|
||||
retval = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user