[PATCH 06/64] i2c: au1550: reword according to newest specification

Wolfram Sang posted 64 patches 7 months, 3 weeks ago
[PATCH 06/64] i2c: au1550: reword according to newest specification
Posted by Wolfram Sang 7 months, 3 weeks ago
Match the wording of this driver wrt. the newest I2C v7, SMBus 3.2, I3C
specifications and replace "master/slave" with more appropriate terms.
They are also more specific because we distinguish now between a remote
entity ("client") and a local one ("target").

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-au1550.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
index 8e43f25c117e..77d85feda631 100644
--- a/drivers/i2c/busses/i2c-au1550.c
+++ b/drivers/i2c/busses/i2c-au1550.c
@@ -81,11 +81,11 @@ static int wait_ack(struct i2c_au1550_data *adap)
 	return 0;
 }
 
-static int wait_master_done(struct i2c_au1550_data *adap)
+static int wait_host_done(struct i2c_au1550_data *adap)
 {
 	int i;
 
-	/* Wait for Master Done. */
+	/* Wait for Host Done. */
 	for (i = 0; i < 2 * adap->xfer_timeout; i++) {
 		if ((RD(adap, PSC_SMBEVNT) & PSC_SMBEVNT_MD) != 0)
 			return 0;
@@ -120,12 +120,12 @@ do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd, int q)
 	if (q)
 		addr |= PSC_SMBTXRX_STP;
 
-	/* Put byte into fifo, start up master. */
+	/* Put byte into fifo, start up host controller */
 	WR(adap, PSC_SMBTXRX, addr);
 	WR(adap, PSC_SMBPCR, PSC_SMBPCR_MS);
 	if (wait_ack(adap))
 		return -EIO;
-	return (q) ? wait_master_done(adap) : 0;
+	return (q) ? wait_host_done(adap) : 0;
 }
 
 static int wait_for_rx_byte(struct i2c_au1550_data *adap, unsigned char *out)
@@ -175,7 +175,7 @@ static int i2c_read(struct i2c_au1550_data *adap, unsigned char *buf,
 
 	/* The last byte has to indicate transfer done. */
 	WR(adap, PSC_SMBTXRX, PSC_SMBTXRX_STP);
-	if (wait_master_done(adap))
+	if (wait_host_done(adap))
 		return -EIO;
 
 	buf[i] = (unsigned char)(RD(adap, PSC_SMBTXRX) & 0xff);
@@ -204,7 +204,7 @@ static int i2c_write(struct i2c_au1550_data *adap, unsigned char *buf,
 	data = buf[i];
 	data |= PSC_SMBTXRX_STP;
 	WR(adap, PSC_SMBTXRX, data);
-	if (wait_master_done(adap))
+	if (wait_host_done(adap))
 		return -EIO;
 	return 0;
 }
@@ -246,7 +246,7 @@ static u32 au1550_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm au1550_algo = {
-	.master_xfer	= au1550_xfer,
+	.xfer	= au1550_xfer,
 	.functionality	= au1550_func,
 };
 
-- 
2.43.0
Re: [PATCH 06/64] i2c: au1550: reword according to newest specification
Posted by Andi Shyti 7 months, 3 weeks ago
Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:59PM +0100, Wolfram Sang wrote:
> Match the wording of this driver wrt. the newest I2C v7, SMBus 3.2, I3C
> specifications and replace "master/slave" with more appropriate terms.
> They are also more specific because we distinguish now between a remote
> entity ("client") and a local one ("target").

...

> -static int wait_master_done(struct i2c_au1550_data *adap)
> +static int wait_host_done(struct i2c_au1550_data *adap)
>  {
>  	int i;
>  
> -	/* Wait for Master Done. */
> +	/* Wait for Host Done. */

here, rather than Master/Controller, the change is Master/Host,
which is different from what is stated in the commit log.

...

> @@ -246,7 +246,7 @@ static u32 au1550_func(struct i2c_adapter *adap)
>  }
>  
>  static const struct i2c_algorithm au1550_algo = {
> -	.master_xfer	= au1550_xfer,
> +	.xfer	= au1550_xfer,
>  	.functionality	= au1550_func,

Here there was some alignment which now is gone.

Andi
Re: [PATCH 06/64] i2c: au1550: reword according to newest specification
Posted by Wolfram Sang 7 months, 1 week ago
> > -	/* Wait for Master Done. */
> > +	/* Wait for Host Done. */
> 
> here, rather than Master/Controller, the change is Master/Host,
> which is different from what is stated in the commit log.

Yes, it should be "controller" here. Preempting the following patches
where I used host: I sometimes used it because "host" is shorter than
"controller", so e.g. variable names would not grow too much in size.
I missed that SMBus has a dedicated meaning for "host", clearly
described in chapter 6.1.3 form version 3.0 onwards. So, I should switch
to controller consistently.

I am also working on a small series updating the I2C documentation so
we have a defined terminology. This should also go in before this series
and is hopefully ready tomorrow.