Skip to content

Commit 8946eb1

Browse files
Wolfram SangAndi Shyti
authored andcommitted
i2c: ibm_iic: 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. Remove a useless comment while here. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent d08cac0 commit 8946eb1

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

drivers/i2c/busses/i2c-ibm_iic.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ static void iic_dev_init(struct ibm_iic_private* dev)
136136

137137
DBG("%d: init\n", dev->idx);
138138

139-
/* Clear master address */
139+
/* Clear remote target address */
140140
out_8(&iic->lmadr, 0);
141141
out_8(&iic->hmadr, 0);
142142

143-
/* Clear slave address */
143+
/* Clear local target address */
144144
out_8(&iic->lsadr, 0);
145145
out_8(&iic->hsadr, 0);
146146

@@ -337,7 +337,7 @@ static irqreturn_t iic_handler(int irq, void *dev_id)
337337
}
338338

339339
/*
340-
* Get master transfer result and clear errors if any.
340+
* Get controller transfer result and clear errors if any.
341341
* Returns the number of actually transferred bytes or error (<0)
342342
*/
343343
static int iic_xfer_result(struct ibm_iic_private* dev)
@@ -352,7 +352,7 @@ static int iic_xfer_result(struct ibm_iic_private* dev)
352352
out_8(&iic->extsts, EXTSTS_IRQP | EXTSTS_IRQD |
353353
EXTSTS_LA | EXTSTS_ICT | EXTSTS_XFRA);
354354

355-
/* Flush master data buffer */
355+
/* Flush controller data buffer */
356356
out_8(&iic->mdcntl, in_8(&iic->mdcntl) | MDCNTL_FMDB);
357357

358358
/* Is bus free?
@@ -401,7 +401,7 @@ static void iic_abort_xfer(struct ibm_iic_private* dev)
401401
}
402402

403403
/*
404-
* Wait for master transfer to complete.
404+
* Wait for controller transfer to complete.
405405
* It puts current process to sleep until we get interrupt or timeout expires.
406406
* Returns the number of transferred bytes or error (<0)
407407
*/
@@ -452,9 +452,6 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){
452452
return ret;
453453
}
454454

455-
/*
456-
* Low level master transfer routine
457-
*/
458455
static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm,
459456
int combined_xfer)
460457
{
@@ -511,9 +508,7 @@ static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm,
511508
return ret > 0 ? 0 : ret;
512509
}
513510

514-
/*
515-
* Set target slave address for master transfer
516-
*/
511+
/* Set remote target address for transfer */
517512
static inline void iic_address(struct ibm_iic_private* dev, struct i2c_msg* msg)
518513
{
519514
volatile struct iic_regs __iomem *iic = dev->vaddr;
@@ -546,7 +541,7 @@ static inline int iic_address_neq(const struct i2c_msg* p1,
546541
}
547542

548543
/*
549-
* Generic master transfer entrypoint.
544+
* Generic transfer entrypoint.
550545
* Returns the number of processed messages or error (<0)
551546
*/
552547
static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
@@ -604,11 +599,11 @@ static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
604599
}
605600
}
606601
else {
607-
/* Flush master data buffer (just in case) */
602+
/* Flush controller data buffer (just in case) */
608603
out_8(&iic->mdcntl, in_8(&iic->mdcntl) | MDCNTL_FMDB);
609604
}
610605

611-
/* Load slave address */
606+
/* Load target address */
612607
iic_address(dev, &msgs[0]);
613608

614609
/* Do real transfer */
@@ -624,8 +619,8 @@ static u32 iic_func(struct i2c_adapter *adap)
624619
}
625620

626621
static const struct i2c_algorithm iic_algo = {
627-
.master_xfer = iic_xfer,
628-
.functionality = iic_func
622+
.xfer = iic_xfer,
623+
.functionality = iic_func
629624
};
630625

631626
/*

0 commit comments

Comments
 (0)