17
17
#define UNIPHIER_I2C_DTRM_NACK BIT(8) /* do not return ACK */
18
18
#define UNIPHIER_I2C_DTRM_RD BIT(0) /* read transaction */
19
19
#define UNIPHIER_I2C_DREC 0x04 /* RX register */
20
- #define UNIPHIER_I2C_DREC_MST BIT(14) /* 1 = master , 0 = slave */
20
+ #define UNIPHIER_I2C_DREC_MST BIT(14) /* 1 = controller , 0 = target */
21
21
#define UNIPHIER_I2C_DREC_TX BIT(13) /* 1 = transmit, 0 = receive */
22
22
#define UNIPHIER_I2C_DREC_STS BIT(12) /* stop condition detected */
23
23
#define UNIPHIER_I2C_DREC_LRB BIT(11) /* no ACK */
24
24
#define UNIPHIER_I2C_DREC_LAB BIT(9) /* arbitration lost */
25
25
#define UNIPHIER_I2C_DREC_BBN BIT(8) /* bus not busy */
26
- #define UNIPHIER_I2C_MYAD 0x08 /* slave address */
26
+ #define UNIPHIER_I2C_MYAD 0x08 /* local target address */
27
27
#define UNIPHIER_I2C_CLK 0x0c /* clock frequency control */
28
28
#define UNIPHIER_I2C_BRST 0x10 /* bus reset */
29
29
#define UNIPHIER_I2C_BRST_FOEN BIT(1) /* normal operation */
@@ -152,8 +152,8 @@ static int uniphier_i2c_stop(struct i2c_adapter *adap)
152
152
UNIPHIER_I2C_DTRM_NACK );
153
153
}
154
154
155
- static int uniphier_i2c_master_xfer_one (struct i2c_adapter * adap ,
156
- struct i2c_msg * msg , bool stop )
155
+ static int uniphier_i2c_xfer_one (struct i2c_adapter * adap ,
156
+ struct i2c_msg * msg , bool stop )
157
157
{
158
158
bool is_read = msg -> flags & I2C_M_RD ;
159
159
bool recovery = false;
@@ -211,8 +211,7 @@ static int uniphier_i2c_check_bus_busy(struct i2c_adapter *adap)
211
211
return 0 ;
212
212
}
213
213
214
- static int uniphier_i2c_master_xfer (struct i2c_adapter * adap ,
215
- struct i2c_msg * msgs , int num )
214
+ static int uniphier_i2c_xfer (struct i2c_adapter * adap , struct i2c_msg * msgs , int num )
216
215
{
217
216
struct i2c_msg * msg , * emsg = msgs + num ;
218
217
int ret ;
@@ -225,7 +224,7 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
225
224
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
226
225
bool stop = (msg + 1 == emsg ) || (msg -> flags & I2C_M_STOP );
227
226
228
- ret = uniphier_i2c_master_xfer_one (adap , msg , stop );
227
+ ret = uniphier_i2c_xfer_one (adap , msg , stop );
229
228
if (ret )
230
229
return ret ;
231
230
}
@@ -239,7 +238,7 @@ static u32 uniphier_i2c_functionality(struct i2c_adapter *adap)
239
238
}
240
239
241
240
static const struct i2c_algorithm uniphier_i2c_algo = {
242
- .master_xfer = uniphier_i2c_master_xfer ,
241
+ .xfer = uniphier_i2c_xfer ,
243
242
.functionality = uniphier_i2c_functionality ,
244
243
};
245
244
0 commit comments