12
12
#include <linux/platform_device.h>
13
13
14
14
#define UNIPHIER_FI2C_CR 0x00 /* control register */
15
- #define UNIPHIER_FI2C_CR_MST BIT(3) /* master mode */
15
+ #define UNIPHIER_FI2C_CR_MST BIT(3) /* controller mode */
16
16
#define UNIPHIER_FI2C_CR_STA BIT(2) /* start condition */
17
17
#define UNIPHIER_FI2C_CR_STO BIT(1) /* stop condition */
18
18
#define UNIPHIER_FI2C_CR_NACK BIT(0) /* do not return ACK */
19
19
#define UNIPHIER_FI2C_DTTX 0x04 /* TX FIFO */
20
- #define UNIPHIER_FI2C_DTTX_CMD BIT(8) /* send command (slave addr) */
20
+ #define UNIPHIER_FI2C_DTTX_CMD BIT(8) /* send command (target addr) */
21
21
#define UNIPHIER_FI2C_DTTX_RD BIT(0) /* read transaction */
22
22
#define UNIPHIER_FI2C_DTRX 0x04 /* RX FIFO */
23
- #define UNIPHIER_FI2C_SLAD 0x0c /* slave address */
23
+ #define UNIPHIER_FI2C_SLAD 0x0c /* target address */
24
24
#define UNIPHIER_FI2C_CYC 0x10 /* clock cycle control */
25
25
#define UNIPHIER_FI2C_LCTL 0x14 /* clock low period control */
26
26
#define UNIPHIER_FI2C_SSUT 0x18 /* restart/stop setup time control */
@@ -96,7 +96,7 @@ static void uniphier_fi2c_fill_txfifo(struct uniphier_fi2c_priv *priv,
96
96
int fifo_space = UNIPHIER_FI2C_FIFO_SIZE ;
97
97
98
98
/*
99
- * TX-FIFO stores slave address in it for the first access.
99
+ * TX-FIFO stores target address in it for the first access.
100
100
* Decrement the counter.
101
101
*/
102
102
if (first )
@@ -252,7 +252,7 @@ static void uniphier_fi2c_tx_init(struct uniphier_fi2c_priv *priv, u16 addr,
252
252
253
253
/* do not use TX byte counter */
254
254
writel (0 , priv -> membase + UNIPHIER_FI2C_TBC );
255
- /* set slave address */
255
+ /* set target address */
256
256
writel (UNIPHIER_FI2C_DTTX_CMD | addr << 1 ,
257
257
priv -> membase + UNIPHIER_FI2C_DTTX );
258
258
/*
@@ -288,7 +288,7 @@ static void uniphier_fi2c_rx_init(struct uniphier_fi2c_priv *priv, u16 addr)
288
288
289
289
uniphier_fi2c_set_irqs (priv );
290
290
291
- /* set slave address with RD bit */
291
+ /* set target address with RD bit */
292
292
writel (UNIPHIER_FI2C_DTTX_CMD | UNIPHIER_FI2C_DTTX_RD | addr << 1 ,
293
293
priv -> membase + UNIPHIER_FI2C_DTTX );
294
294
}
@@ -310,9 +310,8 @@ static void uniphier_fi2c_recover(struct uniphier_fi2c_priv *priv)
310
310
i2c_recover_bus (& priv -> adap );
311
311
}
312
312
313
- static int uniphier_fi2c_master_xfer_one (struct i2c_adapter * adap ,
314
- struct i2c_msg * msg , bool repeat ,
315
- bool stop )
313
+ static int uniphier_fi2c_xfer_one (struct i2c_adapter * adap , struct i2c_msg * msg ,
314
+ bool repeat , bool stop )
316
315
{
317
316
struct uniphier_fi2c_priv * priv = i2c_get_adapdata (adap );
318
317
bool is_read = msg -> flags & I2C_M_RD ;
@@ -340,7 +339,7 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
340
339
uniphier_fi2c_tx_init (priv , msg -> addr , repeat );
341
340
342
341
/*
343
- * For a repeated START condition, writing a slave address to the FIFO
342
+ * For a repeated START condition, writing a target address to the FIFO
344
343
* kicks the controller. So, the UNIPHIER_FI2C_CR register should be
345
344
* written only for a non-repeated START condition.
346
345
*/
@@ -403,8 +402,7 @@ static int uniphier_fi2c_check_bus_busy(struct i2c_adapter *adap)
403
402
return 0 ;
404
403
}
405
404
406
- static int uniphier_fi2c_master_xfer (struct i2c_adapter * adap ,
407
- struct i2c_msg * msgs , int num )
405
+ static int uniphier_fi2c_xfer (struct i2c_adapter * adap , struct i2c_msg * msgs , int num )
408
406
{
409
407
struct i2c_msg * msg , * emsg = msgs + num ;
410
408
bool repeat = false;
@@ -418,7 +416,7 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
418
416
/* Emit STOP if it is the last message or I2C_M_STOP is set. */
419
417
bool stop = (msg + 1 == emsg ) || (msg -> flags & I2C_M_STOP );
420
418
421
- ret = uniphier_fi2c_master_xfer_one (adap , msg , repeat , stop );
419
+ ret = uniphier_fi2c_xfer_one (adap , msg , repeat , stop );
422
420
if (ret )
423
421
return ret ;
424
422
@@ -434,7 +432,7 @@ static u32 uniphier_fi2c_functionality(struct i2c_adapter *adap)
434
432
}
435
433
436
434
static const struct i2c_algorithm uniphier_fi2c_algo = {
437
- .master_xfer = uniphier_fi2c_master_xfer ,
435
+ .xfer = uniphier_fi2c_xfer ,
438
436
.functionality = uniphier_fi2c_functionality ,
439
437
};
440
438
0 commit comments