Skip to content

Commit e02ec4e

Browse files
Wolfram SangAndi Shyti
authored andcommitted
i2c: uniphier: reword according to newest specification
Change the wording of this driver wrt. the newest I2C v7 and SMBus 3.2 specifications and replace "master/slave" with more appropriate terms. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent f872d28 commit e02ec4e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

drivers/i2c/busses/i2c-uniphier.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#define UNIPHIER_I2C_DTRM_NACK BIT(8) /* do not return ACK */
1818
#define UNIPHIER_I2C_DTRM_RD BIT(0) /* read transaction */
1919
#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 */
2121
#define UNIPHIER_I2C_DREC_TX BIT(13) /* 1 = transmit, 0 = receive */
2222
#define UNIPHIER_I2C_DREC_STS BIT(12) /* stop condition detected */
2323
#define UNIPHIER_I2C_DREC_LRB BIT(11) /* no ACK */
2424
#define UNIPHIER_I2C_DREC_LAB BIT(9) /* arbitration lost */
2525
#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 */
2727
#define UNIPHIER_I2C_CLK 0x0c /* clock frequency control */
2828
#define UNIPHIER_I2C_BRST 0x10 /* bus reset */
2929
#define UNIPHIER_I2C_BRST_FOEN BIT(1) /* normal operation */
@@ -152,8 +152,8 @@ static int uniphier_i2c_stop(struct i2c_adapter *adap)
152152
UNIPHIER_I2C_DTRM_NACK);
153153
}
154154

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)
157157
{
158158
bool is_read = msg->flags & I2C_M_RD;
159159
bool recovery = false;
@@ -211,8 +211,7 @@ static int uniphier_i2c_check_bus_busy(struct i2c_adapter *adap)
211211
return 0;
212212
}
213213

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)
216215
{
217216
struct i2c_msg *msg, *emsg = msgs + num;
218217
int ret;
@@ -225,7 +224,7 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
225224
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
226225
bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
227226

228-
ret = uniphier_i2c_master_xfer_one(adap, msg, stop);
227+
ret = uniphier_i2c_xfer_one(adap, msg, stop);
229228
if (ret)
230229
return ret;
231230
}
@@ -239,7 +238,7 @@ static u32 uniphier_i2c_functionality(struct i2c_adapter *adap)
239238
}
240239

241240
static const struct i2c_algorithm uniphier_i2c_algo = {
242-
.master_xfer = uniphier_i2c_master_xfer,
241+
.xfer = uniphier_i2c_xfer,
243242
.functionality = uniphier_i2c_functionality,
244243
};
245244

0 commit comments

Comments
 (0)