diff mbox series

[14/64] i2c: cpm: reword according to newest specification

Message ID 20240322132619.6389-15-wsa+renesas@sang-engineering.com
State New
Headers show
Series i2c: reword i2c_algorithm according to newest specification | expand

Commit Message

Wolfram Sang March 22, 2024, 1:25 p.m. UTC
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-cpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andi Shyti March 26, 2024, 7:09 p.m. UTC | #1
Hi Wolfram,

...

> @@ -570,7 +570,7 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
>  	out_8(&cpm->i2c_reg->i2brg, brg);
>  
>  	out_8(&cpm->i2c_reg->i2mod, 0x00);
> -	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Master mode */
> +	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Host mode */

I2COM_MASTER might be coming from the datasheet.

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Wolfram Sang April 8, 2024, 9:04 a.m. UTC | #2
> >  	out_8(&cpm->i2c_reg->i2mod, 0x00);
> > -	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Master mode */
> > +	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Host mode */
> 
> I2COM_MASTER might be coming from the datasheet.

Maybe we can just drop the comment? The value we write is pretty
self-explaining.
Andi Shyti April 10, 2024, 3:25 p.m. UTC | #3
> > >  	out_8(&cpm->i2c_reg->i2mod, 0x00);
> > > -	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Master mode */
> > > +	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Host mode */
> > 
> > I2COM_MASTER might be coming from the datasheet.
> 
> Maybe we can just drop the comment? The value we write is pretty
> self-explaining.

indeed.

Andi
Jochen Friedrich April 12, 2024, 6:32 a.m. UTC | #4
>>>>   	out_8(&cpm->i2c_reg->i2mod, 0x00);
>>>> -	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Master mode */
>>>> +	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Host mode */
>>> I2COM_MASTER might be coming from the datasheet.
>> Maybe we can just drop the comment? The value we write is pretty
>> self-explaining.
> indeed.
>
> Andi

I also agree. You might add my Acked-By: <jochen@scram.de> here. Jochen
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 4404b4aac676..306e397fec0a 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -402,7 +402,7 @@  static u32 cpm_i2c_func(struct i2c_adapter *adap)
 /* -----exported algorithm data: -------------------------------------	*/
 
 static const struct i2c_algorithm cpm_i2c_algo = {
-	.master_xfer = cpm_i2c_xfer,
+	.xfer = cpm_i2c_xfer,
 	.functionality = cpm_i2c_func,
 };
 
@@ -570,7 +570,7 @@  static int cpm_i2c_setup(struct cpm_i2c *cpm)
 	out_8(&cpm->i2c_reg->i2brg, brg);
 
 	out_8(&cpm->i2c_reg->i2mod, 0x00);
-	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Master mode */
+	out_8(&cpm->i2c_reg->i2com, I2COM_MASTER);	/* Host mode */
 
 	/* Disable interrupts. */
 	out_8(&cpm->i2c_reg->i2cmr, 0);