linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification
@ 2024-03-22 13:24 Wolfram Sang
  2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
                   ` (18 more replies)
  0 siblings, 19 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:24 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, asahi, chrome-platform, imx, linux-actions,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-aspeed,
	linux-kernel, linux-mediatek, linux-mips, linux-omap,
	linuxppc-dev, linux-renesas-soc, linux-riscv, linux-rockchip,
	linux-rpi-kernel, linux-samsung-soc, linux-stm32, linux-sunxi,
	linux-tegra, openbmc, virtualization

Okay, we need to begin somewhere...

Start changing the wording of the I2C main header wrt. the newest I2C
v7, SMBus 3.2, I3C specifications and replace "master/slave" with more
appropriate terms. This first step renames the members of struct
i2c_algorithm. Once all in-tree users are converted, the anonymous union
will go away again. All this work will also pave the way for finally
seperating the monolithic header into more fine-grained headers like
"i2c/clients.h" etc. So, this is not a simple renaming-excercise but
also a chance to update the I2C core to recent Linux standards.

My motivation is to improve the I2C core API, in general. My motivation
is not to clean each and every driver. I think this is impossible
because register names based on official documentation will need to stay
as they are. But the Linux-internal names should be updated IMO.

That being said, I worked on 62 drivers in this series beyond plain
renames inside 'struct i2c_algorithm' because the fruits were so
low-hanging. Before this series, 112 files in the 'busses/' directory
contained 'master' and/or 'slave'. After the series, only 57. Why not?

Next step is updating the drivers outside the 'i2c'-folder regarding
'struct i2c_algorithm' so we can remove the anonymous union ASAP. To be
able to work on this with minimal dependencies, I'd like to apply this
series between -rc1 and -rc2.

I hope this will work for you guys. The changes are really minimal. If
you are not comfortable with changes to your driver or need more time to
review, please NACK the patch and I will drop the patch and/or address
the issues separeately.

@Andi: are you okay with this approach? It means you'd need to merge
-rc2 into your for-next branch. Or rebase if all fails.

Speaking of Andi, thanks a lot to him taking care of the controller
drivers these days. His work really gives me the freedom to work on I2C
core issues again. Also, Renesas deserves a honorable mention here for
increased support of my I2C activities. Thank you!

If you have comments, hints, etc, please let me know.

Happy hacking,

   Wolfram


Wolfram Sang (64):
  i2c: reword i2c_algorithm according to newest specification
  i2c: ali15x3: reword according to newest specification
  i2c: altera: reword according to newest specification
  i2c: amd-mp2-pci: reword according to newest specification
  i2c: aspeed: reword according to newest specification
  i2c: au1550: reword according to newest specification
  i2c: bcm-iproc: reword according to newest specification
  i2c: bcm-kona: reword according to newest specification
  i2c: bcm2835: reword according to newest specification
  i2c: brcmstb: reword according to newest specification
  i2c: cadence: reword according to newest specification
  i2c: cht-wc: reword according to newest specification
  i2c: cp2615: reword according to newest specification
  i2c: cpm: reword according to newest specification
  i2c: davinci: reword according to newest specification
  i2c: digicolor: reword according to newest specification
  i2c: dln2: reword according to newest specification
  i2c: eg20t: reword according to newest specification
  i2c: emev2: reword according to newest specification
  i2c: fsi: reword according to newest specification
  i2c: gpio: reword according to newest specification
  i2c: highlander: reword according to newest specification
  i2c: hix5hd2: reword according to newest specification
  i2c: i801: reword according to newest specification
  i2c: ibm_iic: reword according to newest specification
  i2c: imx-lpi2c: reword according to newest specification
  i2c: iop3xx: reword according to newest specification
  i2c: isch: reword according to newest specification
  i2c: ismt: reword according to newest specification
  i2c: ljca: reword according to newest specification
  i2c: lpc2k: reword according to newest specification
  i2c: ls2x: reword according to newest specification
  i2c: mchp-pci1xxxx: reword according to newest specification
  i2c: microchip-corei2c: reword according to newest specification
  i2c: mlxcpld: reword according to newest specification
  i2c: mpc: reword according to newest specification
  i2c: mt7621: reword according to newest specification
  i2c: mv64xxx: reword according to newest specification
  i2c: octeon-core: reword according to newest specification
  i2c: owl: reword according to newest specification
  i2c: piix4: reword according to newest specification
  i2c: powermac: reword according to newest specification
  i2c: pxa-pci: reword according to newest specification
  i2c: qup: reword according to newest specification
  i2c: rcar: reword according to newest specification
  i2c: riic: reword according to newest specification
  i2c: rk3x: reword according to newest specification
  i2c: sh7760: reword according to newest specification
  i2c: sh_mobile: reword according to newest specification
  i2c: sis5595: reword according to newest specification
  i2c: sis630: reword according to newest specification
  i2c: sprd: reword according to newest specification
  i2c: st: reword according to newest specification
  i2c: stm32f4: reword according to newest specification
  i2c: sun6i-p2wi: reword according to newest specification
  i2c: synquacer: reword according to newest specification
  i2c: taos-evm: reword according to newest specification
  i2c: tiny-usb: reword according to newest specification
  i2c: uniphier-f: reword according to newest specification
  i2c: uniphier: reword according to newest specification
  i2c: viperboard: reword according to newest specification
  i2c: xlp9xx: reword according to newest specification
  i2c: scx200_acb: reword according to newest specification
  i2c: reword i2c_algorithm in drivers according to newest specification

 drivers/i2c/busses/i2c-ali15x3.c           |  2 +-
 drivers/i2c/busses/i2c-altera.c            |  4 +-
 drivers/i2c/busses/i2c-amd-mp2-pci.c       |  8 ++--
 drivers/i2c/busses/i2c-amd-mp2-plat.c      |  2 +-
 drivers/i2c/busses/i2c-aspeed.c            | 26 +++++-----
 drivers/i2c/busses/i2c-at91-master.c       |  2 +-
 drivers/i2c/busses/i2c-at91-slave.c        |  8 ++--
 drivers/i2c/busses/i2c-au1550.c            | 14 +++---
 drivers/i2c/busses/i2c-axxia.c             | 10 ++--
 drivers/i2c/busses/i2c-bcm-iproc.c         | 20 ++++----
 drivers/i2c/busses/i2c-bcm-kona.c          | 14 +++---
 drivers/i2c/busses/i2c-bcm2835.c           |  8 ++--
 drivers/i2c/busses/i2c-brcmstb.c           | 12 ++---
 drivers/i2c/busses/i2c-cadence.c           | 14 +++---
 drivers/i2c/busses/i2c-cht-wc.c            |  8 ++--
 drivers/i2c/busses/i2c-cp2615.c            |  6 +--
 drivers/i2c/busses/i2c-cpm.c               |  4 +-
 drivers/i2c/busses/i2c-cros-ec-tunnel.c    |  2 +-
 drivers/i2c/busses/i2c-davinci.c           | 13 +++--
 drivers/i2c/busses/i2c-designware-master.c |  2 +-
 drivers/i2c/busses/i2c-designware-slave.c  |  8 ++--
 drivers/i2c/busses/i2c-digicolor.c         |  4 +-
 drivers/i2c/busses/i2c-diolan-u2c.c        |  2 +-
 drivers/i2c/busses/i2c-dln2.c              |  4 +-
 drivers/i2c/busses/i2c-eg20t.c             | 10 ++--
 drivers/i2c/busses/i2c-emev2.c             | 10 ++--
 drivers/i2c/busses/i2c-exynos5.c           |  4 +-
 drivers/i2c/busses/i2c-fsi.c               | 56 +++++++++++-----------
 drivers/i2c/busses/i2c-gpio.c              |  8 ++--
 drivers/i2c/busses/i2c-gxp.c               | 12 ++---
 drivers/i2c/busses/i2c-highlander.c        |  2 +-
 drivers/i2c/busses/i2c-hisi.c              |  4 +-
 drivers/i2c/busses/i2c-hix5hd2.c           |  4 +-
 drivers/i2c/busses/i2c-i801.c              | 12 ++---
 drivers/i2c/busses/i2c-ibm_iic.c           | 26 +++++-----
 drivers/i2c/busses/i2c-img-scb.c           |  2 +-
 drivers/i2c/busses/i2c-imx-lpi2c.c         | 10 ++--
 drivers/i2c/busses/i2c-imx.c               | 12 ++---
 drivers/i2c/busses/i2c-iop3xx.c            | 10 ++--
 drivers/i2c/busses/i2c-isch.c              |  2 +-
 drivers/i2c/busses/i2c-ismt.c              |  2 +-
 drivers/i2c/busses/i2c-jz4780.c            |  2 +-
 drivers/i2c/busses/i2c-kempld.c            |  2 +-
 drivers/i2c/busses/i2c-ljca.c              | 20 ++++----
 drivers/i2c/busses/i2c-lpc2k.c             |  8 ++--
 drivers/i2c/busses/i2c-ls2x.c              |  8 ++--
 drivers/i2c/busses/i2c-mchp-pci1xxxx.c     | 40 ++++++++--------
 drivers/i2c/busses/i2c-meson.c             |  4 +-
 drivers/i2c/busses/i2c-microchip-corei2c.c |  4 +-
 drivers/i2c/busses/i2c-mlxbf.c             |  8 ++--
 drivers/i2c/busses/i2c-mlxcpld.c           | 12 ++---
 drivers/i2c/busses/i2c-mpc.c               |  4 +-
 drivers/i2c/busses/i2c-mt65xx.c            |  2 +-
 drivers/i2c/busses/i2c-mt7621.c            | 22 ++++-----
 drivers/i2c/busses/i2c-mv64xxx.c           | 12 ++---
 drivers/i2c/busses/i2c-mxs.c               |  2 +-
 drivers/i2c/busses/i2c-nomadik.c           |  2 +-
 drivers/i2c/busses/i2c-npcm7xx.c           | 12 ++---
 drivers/i2c/busses/i2c-nvidia-gpu.c        |  4 +-
 drivers/i2c/busses/i2c-ocores.c            |  8 ++--
 drivers/i2c/busses/i2c-octeon-core.c       |  6 +--
 drivers/i2c/busses/i2c-octeon-platdrv.c    |  2 +-
 drivers/i2c/busses/i2c-omap.c              |  4 +-
 drivers/i2c/busses/i2c-opal.c              |  4 +-
 drivers/i2c/busses/i2c-owl.c               | 10 ++--
 drivers/i2c/busses/i2c-pasemi-core.c       |  2 +-
 drivers/i2c/busses/i2c-piix4.c             |  2 +-
 drivers/i2c/busses/i2c-pnx.c               |  2 +-
 drivers/i2c/busses/i2c-powermac.c          |  8 ++--
 drivers/i2c/busses/i2c-pxa-pci.c           |  2 +-
 drivers/i2c/busses/i2c-pxa.c               | 12 ++---
 drivers/i2c/busses/i2c-qcom-cci.c          |  2 +-
 drivers/i2c/busses/i2c-qcom-geni.c         |  2 +-
 drivers/i2c/busses/i2c-qup.c               |  6 +--
 drivers/i2c/busses/i2c-rcar.c              | 16 +++----
 drivers/i2c/busses/i2c-riic.c              |  6 +--
 drivers/i2c/busses/i2c-rk3x.c              | 18 +++----
 drivers/i2c/busses/i2c-robotfuzz-osif.c    |  2 +-
 drivers/i2c/busses/i2c-rzv2m.c             |  8 ++--
 drivers/i2c/busses/i2c-s3c2410.c           |  4 +-
 drivers/i2c/busses/i2c-sh7760.c            | 18 +++----
 drivers/i2c/busses/i2c-sh_mobile.c         | 12 ++---
 drivers/i2c/busses/i2c-sis5595.c           |  2 +-
 drivers/i2c/busses/i2c-sis630.c            | 16 +++----
 drivers/i2c/busses/i2c-sprd.c              | 14 +++---
 drivers/i2c/busses/i2c-st.c                | 17 +++----
 drivers/i2c/busses/i2c-stm32f4.c           |  8 ++--
 drivers/i2c/busses/i2c-stm32f7.c           | 14 +++---
 drivers/i2c/busses/i2c-sun6i-p2wi.c        | 20 ++++----
 drivers/i2c/busses/i2c-synquacer.c         | 30 ++++++------
 drivers/i2c/busses/i2c-taos-evm.c          |  2 +-
 drivers/i2c/busses/i2c-tegra-bpmp.c        |  4 +-
 drivers/i2c/busses/i2c-tegra.c             |  4 +-
 drivers/i2c/busses/i2c-thunderx-pcidrv.c   |  2 +-
 drivers/i2c/busses/i2c-tiny-usb.c          |  4 +-
 drivers/i2c/busses/i2c-uniphier-f.c        | 22 ++++-----
 drivers/i2c/busses/i2c-uniphier.c          | 12 ++---
 drivers/i2c/busses/i2c-viperboard.c        |  8 ++--
 drivers/i2c/busses/i2c-virtio.c            |  2 +-
 drivers/i2c/busses/i2c-wmt.c               |  2 +-
 drivers/i2c/busses/i2c-xiic.c              |  2 +-
 drivers/i2c/busses/i2c-xlp9xx.c            |  4 +-
 drivers/i2c/busses/scx200_acb.c            |  4 +-
 include/linux/i2c.h                        | 24 ++++++++--
 104 files changed, 460 insertions(+), 464 deletions(-)

-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [PATCH 05/64] i2c: aspeed: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
@ 2024-03-22 13:24 ` Wolfram Sang
  2024-03-25  2:29   ` Andrew Jeffery
  2024-03-26  0:17   ` Andi Shyti
  2024-03-22 13:25 ` [PATCH 07/64] i2c: bcm-iproc: " Wolfram Sang
                   ` (17 subsequent siblings)
  18 siblings, 2 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:24 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Brendan Higgins, Benjamin Herrenschmidt,
	Joel Stanley, Andi Shyti, Andrew Jeffery, openbmc,
	linux-arm-kernel, linux-aspeed, linux-kernel

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-aspeed.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
index ce8c4846b7fa..4e6ea4a5cab9 100644
--- a/drivers/i2c/busses/i2c-aspeed.c
+++ b/drivers/i2c/busses/i2c-aspeed.c
@@ -159,7 +159,7 @@ struct aspeed_i2c_bus {
 	bool				send_stop;
 	int				cmd_err;
 	/* Protected only by i2c_lock_bus */
-	int				master_xfer_result;
+	int				xfer_result;
 	/* Multi-master */
 	bool				multi_master;
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
@@ -608,9 +608,9 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
 out_complete:
 	bus->msgs = NULL;
 	if (bus->cmd_err)
-		bus->master_xfer_result = bus->cmd_err;
+		bus->xfer_result = bus->cmd_err;
 	else
-		bus->master_xfer_result = bus->msgs_index + 1;
+		bus->xfer_result = bus->msgs_index + 1;
 	complete(&bus->cmd_complete);
 out_no_complete:
 	return irq_handled;
@@ -679,7 +679,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)
 	return irq_remaining ? IRQ_NONE : IRQ_HANDLED;
 }
 
-static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
+static int aspeed_i2c_xfer(struct i2c_adapter *adap,
 				  struct i2c_msg *msgs, int num)
 {
 	struct aspeed_i2c_bus *bus = i2c_get_adapdata(adap);
@@ -738,7 +738,7 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
 		return -ETIMEDOUT;
 	}
 
-	return bus->master_xfer_result;
+	return bus->xfer_result;
 }
 
 static u32 aspeed_i2c_functionality(struct i2c_adapter *adap)
@@ -748,7 +748,7 @@ static u32 aspeed_i2c_functionality(struct i2c_adapter *adap)
 
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
 /* precondition: bus.lock has been acquired. */
-static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
+static void __aspeed_i2c_reg_target(struct aspeed_i2c_bus *bus, u16 slave_addr)
 {
 	u32 addr_reg_val, func_ctrl_reg_val;
 
@@ -770,7 +770,7 @@ static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
 	bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
 }
 
-static int aspeed_i2c_reg_slave(struct i2c_client *client)
+static int aspeed_i2c_reg_target(struct i2c_client *client)
 {
 	struct aspeed_i2c_bus *bus = i2c_get_adapdata(client->adapter);
 	unsigned long flags;
@@ -781,7 +781,7 @@ static int aspeed_i2c_reg_slave(struct i2c_client *client)
 		return -EINVAL;
 	}
 
-	__aspeed_i2c_reg_slave(bus, client->addr);
+	__aspeed_i2c_reg_target(bus, client->addr);
 
 	bus->slave = client;
 	spin_unlock_irqrestore(&bus->lock, flags);
@@ -789,7 +789,7 @@ static int aspeed_i2c_reg_slave(struct i2c_client *client)
 	return 0;
 }
 
-static int aspeed_i2c_unreg_slave(struct i2c_client *client)
+static int aspeed_i2c_unreg_target(struct i2c_client *client)
 {
 	struct aspeed_i2c_bus *bus = i2c_get_adapdata(client->adapter);
 	u32 func_ctrl_reg_val;
@@ -814,11 +814,11 @@ static int aspeed_i2c_unreg_slave(struct i2c_client *client)
 #endif /* CONFIG_I2C_SLAVE */
 
 static const struct i2c_algorithm aspeed_i2c_algo = {
-	.master_xfer	= aspeed_i2c_master_xfer,
+	.xfer	= aspeed_i2c_xfer,
 	.functionality	= aspeed_i2c_functionality,
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
-	.reg_slave	= aspeed_i2c_reg_slave,
-	.unreg_slave	= aspeed_i2c_unreg_slave,
+	.reg_target	= aspeed_i2c_reg_target,
+	.unreg_target	= aspeed_i2c_unreg_target,
 #endif /* CONFIG_I2C_SLAVE */
 };
 
@@ -950,7 +950,7 @@ static int aspeed_i2c_init(struct aspeed_i2c_bus *bus,
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
 	/* If slave has already been registered, re-enable it. */
 	if (bus->slave)
-		__aspeed_i2c_reg_slave(bus, bus->slave->addr);
+		__aspeed_i2c_reg_target(bus, bus->slave->addr);
 #endif /* CONFIG_I2C_SLAVE */
 
 	/* Set interrupt generation of I2C controller */
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 07/64] i2c: bcm-iproc: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
  2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-26  7:29   ` Andi Shyti
  2024-03-22 13:25 ` [PATCH 09/64] i2c: bcm2835: " Wolfram Sang
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-arm-kernel,
	linux-kernel

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-bcm-iproc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index e905734c26a0..3c68d4df029f 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -224,8 +224,8 @@ static void slave_rx_tasklet_fn(unsigned long);
 		| BIT(IS_S_TX_UNDERRUN_SHIFT) | BIT(IS_S_RX_FIFO_FULL_SHIFT)\
 		| BIT(IS_S_RX_THLD_SHIFT))
 
-static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave);
-static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave);
+static int bcm_iproc_i2c_reg_target(struct i2c_client *slave);
+static int bcm_iproc_i2c_unreg_target(struct i2c_client *slave);
 static void bcm_iproc_i2c_enable_disable(struct bcm_iproc_i2c_dev *iproc_i2c,
 					 bool enable);
 
@@ -987,17 +987,17 @@ static uint32_t bcm_iproc_i2c_functionality(struct i2c_adapter *adap)
 
 	val = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
 
-	if (adap->algo->reg_slave)
+	if (adap->algo->reg_target)
 		val |= I2C_FUNC_SLAVE;
 
 	return val;
 }
 
 static struct i2c_algorithm bcm_iproc_algo = {
-	.master_xfer = bcm_iproc_i2c_xfer,
+	.xfer = bcm_iproc_i2c_xfer,
 	.functionality = bcm_iproc_i2c_functionality,
-	.reg_slave = bcm_iproc_i2c_reg_slave,
-	.unreg_slave = bcm_iproc_i2c_unreg_slave,
+	.reg_target = bcm_iproc_i2c_reg_target,
+	.unreg_target = bcm_iproc_i2c_unreg_target,
 };
 
 static const struct i2c_adapter_quirks bcm_iproc_i2c_quirks = {
@@ -1079,8 +1079,8 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
 		spin_lock_init(&iproc_i2c->idm_lock);
 
 		/* no slave support */
-		bcm_iproc_algo.reg_slave = NULL;
-		bcm_iproc_algo.unreg_slave = NULL;
+		bcm_iproc_algo.reg_target = NULL;
+		bcm_iproc_algo.unreg_target = NULL;
 	}
 
 	ret = bcm_iproc_i2c_init(iproc_i2c);
@@ -1191,7 +1191,7 @@ static const struct dev_pm_ops bcm_iproc_i2c_pm_ops = {
 	.resume_early = &bcm_iproc_i2c_resume
 };
 
-static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave)
+static int bcm_iproc_i2c_reg_target(struct i2c_client *slave)
 {
 	struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
 
@@ -1210,7 +1210,7 @@ static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave)
 	return 0;
 }
 
-static int bcm_iproc_i2c_unreg_slave(struct i2c_client *slave)
+static int bcm_iproc_i2c_unreg_target(struct i2c_client *slave)
 {
 	u32 tmp;
 	struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter);
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 09/64] i2c: bcm2835: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
  2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
  2024-03-22 13:25 ` [PATCH 07/64] i2c: bcm-iproc: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-26 12:44   ` Florian Fainelli
  2024-03-26 19:03   ` Andi Shyti
  2024-03-22 13:25 ` [PATCH 10/64] i2c: brcmstb: " Wolfram Sang
                   ` (15 subsequent siblings)
  18 siblings, 2 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel

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-bcm2835.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index b92de1944221..62776e7fc586 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * BCM2835 master mode driver
+ * BCM2835 host controller mode driver
  */
 
 #include <linux/clk.h>
@@ -25,7 +25,7 @@
 #define BCM2835_I2C_DEL		0x18
 /*
  * 16-bit field for the number of SCL cycles to wait after rising SCL
- * before deciding the slave is not responding. 0 disables the
+ * before deciding the client is not responding. 0 disables the
  * timeout detection.
  */
 #define BCM2835_I2C_CLKT	0x1c
@@ -223,7 +223,7 @@ static void bcm2835_drain_rxfifo(struct bcm2835_i2c_dev *i2c_dev)
 /*
  * Repeated Start Condition (Sr)
  * The BCM2835 ARM Peripherals datasheet mentions a way to trigger a Sr when it
- * talks about reading from a slave with 10 bit address. This is achieved by
+ * talks about reading from a client with 10 bit address. This is achieved by
  * issuing a write, poll the I2CS.TA flag and wait for it to be set, and then
  * issue a read.
  * A comment in https://github.com/raspberrypi/linux/issues/254 shows how the
@@ -391,7 +391,7 @@ static u32 bcm2835_i2c_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm bcm2835_i2c_algo = {
-	.master_xfer	= bcm2835_i2c_xfer,
+	.xfer	= bcm2835_i2c_xfer,
 	.functionality	= bcm2835_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 10/64] i2c: brcmstb: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (2 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 09/64] i2c: bcm2835: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-26 12:44   ` Florian Fainelli
  2024-03-26 19:04   ` Andi Shyti
  2024-03-22 13:25 ` [PATCH 11/64] i2c: cadence: " Wolfram Sang
                   ` (14 subsequent siblings)
  18 siblings, 2 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Kamal Dasu, Broadcom internal kernel review list,
	Andi Shyti, Florian Fainelli, linux-arm-kernel, linux-kernel

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-brcmstb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 38f276c99193..dfdf465e6f8c 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -67,7 +67,7 @@
 
 /* BSC block register map structure to cache fields to be written */
 struct bsc_regs {
-	u32	chip_address;           /* slave address */
+	u32	chip_address;           /* client address */
 	u32	data_in[N_DATA_REGS];   /* tx data buffer*/
 	u32	cnt_reg;		/* rx/tx data length */
 	u32	ctl_reg;		/* control register */
@@ -320,7 +320,7 @@ static int brcmstb_send_i2c_cmd(struct brcmstb_i2c_dev *dev,
 	return rc;
 }
 
-/* Actual data transfer through the BSC master */
+/* Actual data transfer through the BSC controller */
 static int brcmstb_i2c_xfer_bsc_data(struct brcmstb_i2c_dev *dev,
 				     u8 *buf, unsigned int len,
 				     struct i2c_msg *pmsg)
@@ -441,7 +441,7 @@ static int brcmstb_i2c_do_addr(struct brcmstb_i2c_dev *dev,
 	return 0;
 }
 
-/* Master transfer function */
+/* Host transfer function */
 static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 			    struct i2c_msg msgs[], int num)
 {
@@ -473,7 +473,7 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter,
 
 		brcmstb_set_i2c_start_stop(dev, cond);
 
-		/* Send slave address */
+		/* Send client address */
 		if (!(pmsg->flags & I2C_M_NOSTART)) {
 			rc = brcmstb_i2c_do_addr(dev, pmsg);
 			if (rc < 0) {
@@ -545,8 +545,8 @@ static u32 brcmstb_i2c_functionality(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm brcmstb_i2c_algo = {
-	.master_xfer = brcmstb_i2c_xfer,
-	.master_xfer_atomic = brcmstb_i2c_xfer_atomic,
+	.xfer = brcmstb_i2c_xfer,
+	.xfer_atomic = brcmstb_i2c_xfer_atomic,
 	.functionality = brcmstb_i2c_functionality,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 11/64] i2c: cadence: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (3 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 10/64] i2c: brcmstb: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-26 19:06   ` Andi Shyti
  2024-03-22 13:25 ` [PATCH 15/64] i2c: davinci: " Wolfram Sang
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Michal Simek, Andi Shyti, linux-arm-kernel,
	linux-kernel

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-cadence.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 4bb7d6756947..91085e719689 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -808,7 +808,7 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
 }
 
 /**
- * cdns_i2c_master_xfer - The main i2c transfer function
+ * cdns_i2c_xfer - The main i2c transfer function
  * @adap:	pointer to the i2c adapter driver instance
  * @msgs:	pointer to the i2c message structure
  * @num:	the number of messages to transfer
@@ -817,7 +817,7 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
  *
  * Return: number of msgs processed on success, negative error otherwise
  */
-static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+static int cdns_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 				int num)
 {
 	int ret, count;
@@ -947,7 +947,7 @@ static u32 cdns_i2c_func(struct i2c_adapter *adap)
 }
 
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
-static int cdns_reg_slave(struct i2c_client *slave)
+static int cdns_reg_target(struct i2c_client *slave)
 {
 	int ret;
 	struct cdns_i2c *id = container_of(slave->adapter, struct cdns_i2c,
@@ -972,7 +972,7 @@ static int cdns_reg_slave(struct i2c_client *slave)
 	return 0;
 }
 
-static int cdns_unreg_slave(struct i2c_client *slave)
+static int cdns_unreg_target(struct i2c_client *slave)
 {
 	struct cdns_i2c *id = container_of(slave->adapter, struct cdns_i2c,
 									adap);
@@ -990,11 +990,11 @@ static int cdns_unreg_slave(struct i2c_client *slave)
 #endif
 
 static const struct i2c_algorithm cdns_i2c_algo = {
-	.master_xfer	= cdns_i2c_master_xfer,
+	.xfer	= cdns_i2c_xfer,
 	.functionality	= cdns_i2c_func,
 #if IS_ENABLED(CONFIG_I2C_SLAVE)
-	.reg_slave	= cdns_reg_slave,
-	.unreg_slave	= cdns_unreg_slave,
+	.reg_target	= cdns_reg_target,
+	.unreg_target	= cdns_unreg_target,
 #endif
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 15/64] i2c: davinci: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (4 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 11/64] i2c: cadence: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-25 15:07   ` Bartosz Golaszewski
  2024-03-22 13:25 ` [PATCH 16/64] i2c: digicolor: " Wolfram Sang
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Bartosz Golaszewski, Andi Shyti, linux-arm-kernel,
	linux-kernel

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-davinci.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 02b3b1160fb0..1884d77934e9 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -263,7 +263,7 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev)
 	/* compute clock dividers */
 	i2c_davinci_calc_clk_dividers(dev);
 
-	/* Respond at reserved "SMBus Host" slave address" (and zero);
+	/* Respond at reserved "SMBus Host" client address" (and zero);
 	 * we seem to have no option to not respond...
 	 */
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, DAVINCI_I2C_OWN_ADDRESS);
@@ -407,7 +407,7 @@ static int i2c_davinci_wait_bus_not_busy(struct davinci_i2c_dev *dev)
 }
 
 /*
- * Low level master read/write transaction. This function is called
+ * Low level host read/write transaction. This function is called
  * from i2c_davinci_xfer.
  */
 static int
@@ -428,7 +428,7 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
 	if (pdata->bus_delay)
 		udelay(pdata->bus_delay);
 
-	/* set the slave address */
+	/* set the client address */
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_SAR_REG, msg->addr);
 
 	dev->buf = msg->buf;
@@ -440,10 +440,9 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop)
 	reinit_completion(&dev->cmd_complete);
 	dev->cmd_err = 0;
 
-	/* Take I2C out of reset and configure it as master */
+	/* Take I2C out of reset and configure it as host */
 	flag = DAVINCI_I2C_MDR_IRS | DAVINCI_I2C_MDR_MST;
 
-	/* if the slave address is ten bit address, enable XA bit */
 	if (msg->flags & I2C_M_TEN)
 		flag |= DAVINCI_I2C_MDR_XA;
 	if (!(msg->flags & I2C_M_RD))
@@ -688,7 +687,7 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
 			break;
 
 		case DAVINCI_I2C_IVR_AAS:
-			dev_dbg(dev->dev, "Address as slave interrupt\n");
+			dev_dbg(dev->dev, "Address as client interrupt\n");
 			break;
 
 		default:
@@ -745,7 +744,7 @@ static inline void i2c_davinci_cpufreq_deregister(struct davinci_i2c_dev *dev)
 #endif
 
 static const struct i2c_algorithm i2c_davinci_algo = {
-	.master_xfer	= i2c_davinci_xfer,
+	.xfer	= i2c_davinci_xfer,
 	.functionality	= i2c_davinci_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 16/64] i2c: digicolor: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (5 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 15/64] i2c: davinci: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 26/64] i2c: imx-lpi2c: " Wolfram Sang
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Baruch Siach, linux-arm-kernel,
	linux-kernel

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-digicolor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-digicolor.c b/drivers/i2c/busses/i2c-digicolor.c
index 3462f2bc0fa8..0d777f5c6b41 100644
--- a/drivers/i2c/busses/i2c-digicolor.c
+++ b/drivers/i2c/busses/i2c-digicolor.c
@@ -281,7 +281,7 @@ static u32 dc_i2c_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm dc_i2c_algorithm = {
-	.master_xfer	= dc_i2c_xfer,
+	.xfer	= dc_i2c_xfer,
 	.functionality	= dc_i2c_func,
 };
 
@@ -372,5 +372,5 @@ static struct platform_driver dc_i2c_driver = {
 module_platform_driver(dc_i2c_driver);
 
 MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
-MODULE_DESCRIPTION("Conexant Digicolor I2C master driver");
+MODULE_DESCRIPTION("Conexant Digicolor I2C controller driver");
 MODULE_LICENSE("GPL v2");
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 26/64] i2c: imx-lpi2c: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (6 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 16/64] i2c: digicolor: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 31/64] i2c: lpc2k: " Wolfram Sang
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Dong Aisheng, Andi Shyti, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, imx, linux-arm-kernel,
	linux-kernel

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-imx-lpi2c.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 6d72e4e126dd..337a55804463 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -262,7 +262,7 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
 	return 0;
 }
 
-static int lpi2c_imx_master_enable(struct lpi2c_imx_struct *lpi2c_imx)
+static int lpi2c_imx_host_enable(struct lpi2c_imx_struct *lpi2c_imx)
 {
 	unsigned int temp;
 	int ret;
@@ -292,7 +292,7 @@ static int lpi2c_imx_master_enable(struct lpi2c_imx_struct *lpi2c_imx)
 	return ret;
 }
 
-static int lpi2c_imx_master_disable(struct lpi2c_imx_struct *lpi2c_imx)
+static int lpi2c_imx_host_disable(struct lpi2c_imx_struct *lpi2c_imx)
 {
 	u32 temp;
 
@@ -459,7 +459,7 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
 	unsigned int temp;
 	int i, result;
 
-	result = lpi2c_imx_master_enable(lpi2c_imx);
+	result = lpi2c_imx_host_enable(lpi2c_imx);
 	if (result)
 		return result;
 
@@ -502,7 +502,7 @@ static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
 		result = -EIO;
 
 disable:
-	lpi2c_imx_master_disable(lpi2c_imx);
+	lpi2c_imx_host_disable(lpi2c_imx);
 
 	dev_dbg(&lpi2c_imx->adapter.dev, "<%s> exit with: %s: %d\n", __func__,
 		(result < 0) ? "error" : "success msg",
@@ -554,7 +554,7 @@ static u32 lpi2c_imx_func(struct i2c_adapter *adapter)
 }
 
 static const struct i2c_algorithm lpi2c_imx_algo = {
-	.master_xfer	= lpi2c_imx_xfer,
+	.xfer	= lpi2c_imx_xfer,
 	.functionality	= lpi2c_imx_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 31/64] i2c: lpc2k: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (7 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 26/64] i2c: imx-lpi2c: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 37/64] i2c: mt7621: " Wolfram Sang
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Vladimir Zapolskiy, Andi Shyti, linux-arm-kernel,
	linux-kernel

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-lpc2k.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-lpc2k.c b/drivers/i2c/busses/i2c-lpc2k.c
index e3660333e91c..f0cb217973c1 100644
--- a/drivers/i2c/busses/i2c-lpc2k.c
+++ b/drivers/i2c/busses/i2c-lpc2k.c
@@ -50,7 +50,7 @@
 
 /*
  * 26 possible I2C status codes, but codes applicable only
- * to master are listed here and used in this driver
+ * to host mode are listed here and used in this driver
  */
 enum {
 	M_BUS_ERROR		= 0x00,
@@ -157,7 +157,7 @@ static void i2c_lpc2k_pump_msg(struct lpc2k_i2c *i2c)
 		break;
 
 	case MR_ADDR_R_ACK:
-		/* Receive first byte from slave */
+		/* Receive first byte from client */
 		if (i2c->msg->len == 1) {
 			/* Last byte, return NACK */
 			writel(LPC24XX_AA, i2c->base + LPC24XX_I2CONCLR);
@@ -196,7 +196,7 @@ static void i2c_lpc2k_pump_msg(struct lpc2k_i2c *i2c)
 		}
 
 		/*
-		 * One pre-last data input, send NACK to tell the slave that
+		 * One pre-last data input, send NACK to tell the client that
 		 * this is going to be the last data byte to be transferred.
 		 */
 		if (i2c->msg_idx >= i2c->msg->len - 2) {
@@ -338,7 +338,7 @@ static u32 i2c_lpc2k_functionality(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm i2c_lpc2k_algorithm = {
-	.master_xfer	= i2c_lpc2k_xfer,
+	.xfer	= i2c_lpc2k_xfer,
 	.functionality	= i2c_lpc2k_functionality,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 37/64] i2c: mt7621: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (8 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 31/64] i2c: lpc2k: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-25  8:06   ` AngeloGioacchino Del Regno
  2024-03-25  8:07   ` Stefan Roese
  2024-03-22 13:25 ` [PATCH 40/64] i2c: owl: " Wolfram Sang
                   ` (8 subsequent siblings)
  18 siblings, 2 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Stefan Roese, Andi Shyti, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
	linux-mediatek

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-mt7621.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mt7621.c b/drivers/i2c/busses/i2c-mt7621.c
index 81d46169bc1f..c567a2cf4a90 100644
--- a/drivers/i2c/busses/i2c-mt7621.c
+++ b/drivers/i2c/busses/i2c-mt7621.c
@@ -117,26 +117,26 @@ static int mtk_i2c_check_ack(struct mtk_i2c *i2c, u32 expected)
 	return ((ack & ack_expected) == ack_expected) ? 0 : -ENXIO;
 }
 
-static int mtk_i2c_master_start(struct mtk_i2c *i2c)
+static int mtk_i2c_host_start(struct mtk_i2c *i2c)
 {
 	iowrite32(SM0CTL1_START | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG);
 	return mtk_i2c_wait_idle(i2c);
 }
 
-static int mtk_i2c_master_stop(struct mtk_i2c *i2c)
+static int mtk_i2c_host_stop(struct mtk_i2c *i2c)
 {
 	iowrite32(SM0CTL1_STOP | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG);
 	return mtk_i2c_wait_idle(i2c);
 }
 
-static int mtk_i2c_master_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len)
+static int mtk_i2c_host_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len)
 {
 	iowrite32(cmd | SM0CTL1_TRI | SM0CTL1_PGLEN(page_len),
 		  i2c->base + REG_SM0CTL1_REG);
 	return mtk_i2c_wait_idle(i2c);
 }
 
-static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+static int mtk_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			       int num)
 {
 	struct mtk_i2c *i2c;
@@ -157,7 +157,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			goto err_timeout;
 
 		/* start sequence */
-		ret = mtk_i2c_master_start(i2c);
+		ret = mtk_i2c_host_start(i2c);
 		if (ret)
 			goto err_timeout;
 
@@ -169,14 +169,14 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			if (pmsg->flags & I2C_M_RD)
 				addr |= 1;
 			iowrite32(addr, i2c->base + REG_SM0D0_REG);
-			ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 2);
+			ret = mtk_i2c_host_cmd(i2c, SM0CTL1_WRITE, 2);
 			if (ret)
 				goto err_timeout;
 		} else {
 			/* 7 bits address */
 			addr = i2c_8bit_addr_from_msg(pmsg);
 			iowrite32(addr, i2c->base + REG_SM0D0_REG);
-			ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 1);
+			ret = mtk_i2c_host_cmd(i2c, SM0CTL1_WRITE, 1);
 			if (ret)
 				goto err_timeout;
 		}
@@ -202,7 +202,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 				cmd = SM0CTL1_WRITE;
 			}
 
-			ret = mtk_i2c_master_cmd(i2c, cmd, page_len);
+			ret = mtk_i2c_host_cmd(i2c, cmd, page_len);
 			if (ret)
 				goto err_timeout;
 
@@ -222,7 +222,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 		}
 	}
 
-	ret = mtk_i2c_master_stop(i2c);
+	ret = mtk_i2c_host_stop(i2c);
 	if (ret)
 		goto err_timeout;
 
@@ -230,7 +230,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
 	return i;
 
 err_ack:
-	ret = mtk_i2c_master_stop(i2c);
+	ret = mtk_i2c_host_stop(i2c);
 	if (ret)
 		goto err_timeout;
 	return -ENXIO;
@@ -247,7 +247,7 @@ static u32 mtk_i2c_func(struct i2c_adapter *a)
 }
 
 static const struct i2c_algorithm mtk_i2c_algo = {
-	.master_xfer	= mtk_i2c_master_xfer,
+	.xfer	= mtk_i2c_xfer,
 	.functionality	= mtk_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 40/64] i2c: owl: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (9 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 37/64] i2c: mt7621: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 47/64] i2c: rk3x: " Wolfram Sang
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Andreas Färber,
	Manivannan Sadhasivam, linux-arm-kernel, linux-actions,
	linux-kernel

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-owl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c
index 777f1a0278c7..cb90e1b2775c 100644
--- a/drivers/i2c/busses/i2c-owl.c
+++ b/drivers/i2c/busses/i2c-owl.c
@@ -172,7 +172,7 @@ static void owl_i2c_xfer_data(struct owl_i2c_dev *i2c_dev)
 
 	i2c_dev->err = 0;
 
-	/* Handle NACK from slave */
+	/* Handle NACK from client */
 	fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT);
 	if (fifostat & OWL_I2C_FIFOSTAT_RNB) {
 		i2c_dev->err = -ENXIO;
@@ -302,7 +302,7 @@ static int owl_i2c_xfer_common(struct i2c_adapter *adap, struct i2c_msg *msgs,
 			   OWL_I2C_CTL_IRQE, !atomic);
 
 	/*
-	 * Select: FIFO enable, Master mode, Stop enable, Data count enable,
+	 * Select: FIFO enable, host mode, Stop enable, Data count enable,
 	 * Send start bit
 	 */
 	i2c_cmd = OWL_I2C_CMD_SECL | OWL_I2C_CMD_MSS | OWL_I2C_CMD_SE |
@@ -314,7 +314,7 @@ static int owl_i2c_xfer_common(struct i2c_adapter *adap, struct i2c_msg *msgs,
 		i2c_cmd |= OWL_I2C_CMD_AS(msgs[0].len + 1) |
 			   OWL_I2C_CMD_SAS(1) | OWL_I2C_CMD_RBE;
 
-		/* Write slave address */
+		/* Write client address */
 		addr = i2c_8bit_addr_from_msg(&msgs[0]);
 		writel(addr, i2c_dev->base + OWL_I2C_REG_TXDAT);
 
@@ -420,8 +420,8 @@ static int owl_i2c_xfer_atomic(struct i2c_adapter *adap,
 }
 
 static const struct i2c_algorithm owl_i2c_algorithm = {
-	.master_xfer	     = owl_i2c_xfer,
-	.master_xfer_atomic  = owl_i2c_xfer_atomic,
+	.xfer	     = owl_i2c_xfer,
+	.xfer_atomic  = owl_i2c_xfer_atomic,
 	.functionality	     = owl_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 47/64] i2c: rk3x: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (10 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 40/64] i2c: owl: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:51   ` Heiko Stübner
  2024-03-22 13:25 ` [PATCH 53/64] i2c: st: " Wolfram Sang
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Heiko Stuebner, Andi Shyti, linux-arm-kernel,
	linux-rockchip, linux-kernel

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-rk3x.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 086fdf262e7b..01febd886bdd 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -28,8 +28,8 @@
 /* Register Map */
 #define REG_CON        0x00 /* control register */
 #define REG_CLKDIV     0x04 /* clock divisor register */
-#define REG_MRXADDR    0x08 /* slave address for REGISTER_TX */
-#define REG_MRXRADDR   0x0c /* slave register address for REGISTER_TX */
+#define REG_MRXADDR    0x08 /* client address for REGISTER_TX */
+#define REG_MRXRADDR   0x0c /* client register address for REGISTER_TX */
 #define REG_MTXCNT     0x10 /* number of bytes to be transmitted */
 #define REG_MRXCNT     0x14 /* number of bytes to be received */
 #define REG_IEN        0x18 /* interrupt enable */
@@ -68,8 +68,8 @@ enum {
 /* REG_IEN/REG_IPD bits */
 #define REG_INT_BTF       BIT(0) /* a byte was transmitted */
 #define REG_INT_BRF       BIT(1) /* a byte was received */
-#define REG_INT_MBTF      BIT(2) /* master data transmit finished */
-#define REG_INT_MBRF      BIT(3) /* master data receive finished */
+#define REG_INT_MBTF      BIT(2) /* host data transmit finished */
+#define REG_INT_MBRF      BIT(3) /* host data receive finished */
 #define REG_INT_START     BIT(4) /* START condition generated */
 #define REG_INT_STOP      BIT(5) /* STOP condition generated */
 #define REG_INT_NAKRCV    BIT(6) /* NACK received */
@@ -184,7 +184,7 @@ struct rk3x_i2c_soc_data {
  * @wait: the waitqueue to wait for i2c transfer
  * @busy: the condition for the event to wait for
  * @msg: current i2c message
- * @addr: addr of i2c slave device
+ * @addr: addr of i2c client device
  * @mode: mode of i2c transfer
  * @is_last_msg: flag determines whether it is the last msg in this transfer
  * @state: state of i2c transfer
@@ -979,7 +979,7 @@ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num)
 	/*
 	 * The I2C adapter can issue a small (len < 4) write packet before
 	 * reading. This speeds up SMBus-style register reads.
-	 * The MRXADDR/MRXRADDR hold the slave address and the slave register
+	 * The MRXADDR/MRXRADDR hold the client address and the client register
 	 * address in this case.
 	 */
 
@@ -1016,7 +1016,7 @@ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num)
 			addr |= 1; /* set read bit */
 
 			/*
-			 * We have to transmit the slave addr first. Use
+			 * We have to transmit the client addr first. Use
 			 * MOD_REGISTER_TX for that purpose.
 			 */
 			i2c->mode = REG_CON_MOD_REGISTER_TX;
@@ -1162,8 +1162,8 @@ static u32 rk3x_i2c_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm rk3x_i2c_algorithm = {
-	.master_xfer		= rk3x_i2c_xfer,
-	.master_xfer_atomic	= rk3x_i2c_xfer_polling,
+	.xfer		= rk3x_i2c_xfer,
+	.xfer_atomic	= rk3x_i2c_xfer_polling,
 	.functionality		= rk3x_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 53/64] i2c: st: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (11 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 47/64] i2c: rk3x: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 17:11   ` Easwar Hariharan
  2024-03-22 13:25 ` [PATCH 54/64] i2c: stm32f4: " Wolfram Sang
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Patrice Chotard, Andi Shyti, linux-arm-kernel,
	linux-kernel

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-st.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
index ce2333408904..9bd45ae83c0c 100644
--- a/drivers/i2c/busses/i2c-st.c
+++ b/drivers/i2c/busses/i2c-st.c
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2013 STMicroelectronics
  *
- * I2C master mode controller driver, used in STMicroelectronics devices.
+ * I2C host controller driver, used in STMicroelectronics devices.
  *
  * Author: Maxime Coquelin <maxime.coquelin@st.com>
  */
@@ -150,7 +150,7 @@ struct st_i2c_timings {
 
 /**
  * struct st_i2c_client - client specific data
- * @addr: 8-bit slave addr, including r/w bit
+ * @addr: 8-bit client addr, including r/w bit
  * @count: number of bytes to be transfered
  * @xfered: number of bytes already transferred
  * @buf: data buffer
@@ -647,7 +647,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
 {
 	struct st_i2c_client *c = &i2c_dev->client;
 	u32 ctl, i2c, it;
-	unsigned long timeout;
+	unsigned long time_left;
 	int ret;
 
 	c->addr		= i2c_8bit_addr_from_msg(msg);
@@ -667,7 +667,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
 		i2c |= SSC_I2C_ACKG;
 	st_i2c_set_bits(i2c_dev->base + SSC_I2C, i2c);
 
-	/* Write slave address */
+	/* Write client address */
 	st_i2c_write_tx_fifo(i2c_dev, c->addr);
 
 	/* Pre-fill Tx fifo with data in case of write */
@@ -685,15 +685,12 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
 		st_i2c_set_bits(i2c_dev->base + SSC_I2C, SSC_I2C_STRTG);
 	}
 
-	timeout = wait_for_completion_timeout(&i2c_dev->complete,
+	time_left = wait_for_completion_timeout(&i2c_dev->complete,
 			i2c_dev->adap.timeout);
 	ret = c->result;
 
-	if (!timeout) {
-		dev_err(i2c_dev->dev, "Write to slave 0x%x timed out\n",
-				c->addr);
+	if (!time_left)
 		ret = -ETIMEDOUT;
-	}
 
 	i2c = SSC_I2C_STOPG | SSC_I2C_REPSTRTG;
 	st_i2c_clr_bits(i2c_dev->base + SSC_I2C, i2c);
@@ -769,7 +766,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm st_i2c_algo = {
-	.master_xfer = st_i2c_xfer,
+	.xfer = st_i2c_xfer,
 	.functionality = st_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 54/64] i2c: stm32f4: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (12 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 53/64] i2c: st: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 55/64] i2c: sun6i-p2wi: " Wolfram Sang
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Pierre-Yves MORDRET, Alain Volmat, Andi Shyti,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, linux-arm-kernel,
	linux-kernel

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-stm32f4.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
index 859ac0cf7f6c..297f2ace6b94 100644
--- a/drivers/i2c/busses/i2c-stm32f4.c
+++ b/drivers/i2c/busses/i2c-stm32f4.c
@@ -95,7 +95,7 @@
 
 /**
  * struct stm32f4_i2c_msg - client specific data
- * @addr: 8-bit slave addr, including r/w bit
+ * @addr: 8-bit client addr, including r/w bit
  * @count: number of bytes to be transferred
  * @buf: data buffer
  * @result: result of the transfer
@@ -480,7 +480,7 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev)
 
 /**
  * stm32f4_i2c_handle_rx_addr() - Handle address matched interrupt in case of
- * master receiver
+ * host receiver
  * @i2c_dev: Controller's private data
  */
 static void stm32f4_i2c_handle_rx_addr(struct stm32f4_i2c_dev *i2c_dev)
@@ -643,7 +643,7 @@ static irqreturn_t stm32f4_i2c_isr_error(int irq, void *data)
 
 	/*
 	 * Acknowledge failure:
-	 * In master transmitter mode a Stop must be generated by software
+	 * In host transmitter mode a Stop must be generated by software
 	 */
 	if (status & STM32F4_I2C_SR1_AF) {
 		if (!(msg->addr & I2C_M_RD)) {
@@ -749,7 +749,7 @@ static u32 stm32f4_i2c_func(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm stm32f4_i2c_algo = {
-	.master_xfer = stm32f4_i2c_xfer,
+	.xfer = stm32f4_i2c_xfer,
 	.functionality = stm32f4_i2c_func,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 55/64] i2c: sun6i-p2wi: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (13 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 54/64] i2c: stm32f4: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 59/64] i2c: uniphier-f: " Wolfram Sang
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, linux-arm-kernel, linux-sunxi, linux-kernel

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-sun6i-p2wi.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sun6i-p2wi.c b/drivers/i2c/busses/i2c-sun6i-p2wi.c
index 85e035e7a1d7..bb01746738b1 100644
--- a/drivers/i2c/busses/i2c-sun6i-p2wi.c
+++ b/drivers/i2c/busses/i2c-sun6i-p2wi.c
@@ -10,7 +10,7 @@
  * The P2WI controller looks like an SMBus controller which only supports byte
  * data transfers. But, it differs from standard SMBus protocol on several
  * aspects:
- * - it supports only one slave device, and thus drop the address field
+ * - it supports only one client device, and thus drop the address field
  * - it adds a parity bit every 8bits of data
  * - only one read access is required to read a byte (instead of a write
  *   followed by a read access in standard SMBus protocol)
@@ -88,7 +88,7 @@ struct p2wi {
 	void __iomem *regs;
 	struct clk *clk;
 	struct reset_control *rstc;
-	int slave_addr;
+	int client_addr;
 };
 
 static irqreturn_t p2wi_interrupt(int irq, void *dev_id)
@@ -121,7 +121,7 @@ static int p2wi_smbus_xfer(struct i2c_adapter *adap, u16 addr,
 	struct p2wi *p2wi = i2c_get_adapdata(adap);
 	unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1);
 
-	if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) {
+	if (p2wi->client_addr >= 0 && addr != p2wi->client_addr) {
 		dev_err(&adap->dev, "invalid P2WI address\n");
 		return -EINVAL;
 	}
@@ -188,7 +188,7 @@ static int p2wi_probe(struct platform_device *pdev)
 	unsigned long parent_clk_freq;
 	u32 clk_freq = I2C_MAX_STANDARD_MODE_FREQ;
 	struct p2wi *p2wi;
-	u32 slave_addr;
+	u32 client_addr;
 	int clk_div;
 	int irq;
 	int ret;
@@ -207,7 +207,7 @@ static int p2wi_probe(struct platform_device *pdev)
 	}
 
 	if (of_get_child_count(np) > 1) {
-		dev_err(dev, "P2WI only supports one slave device\n");
+		dev_err(dev, "P2WI only supports one client device\n");
 		return -EINVAL;
 	}
 
@@ -215,24 +215,24 @@ static int p2wi_probe(struct platform_device *pdev)
 	if (!p2wi)
 		return -ENOMEM;
 
-	p2wi->slave_addr = -1;
+	p2wi->client_addr = -1;
 
 	/*
 	 * Authorize a p2wi node without any children to be able to use an
 	 * i2c-dev from userpace.
-	 * In this case the slave_addr is set to -1 and won't be checked when
+	 * In this case the client_addr is set to -1 and won't be checked when
 	 * launching a P2WI transfer.
 	 */
 	childnp = of_get_next_available_child(np, NULL);
 	if (childnp) {
-		ret = of_property_read_u32(childnp, "reg", &slave_addr);
+		ret = of_property_read_u32(childnp, "reg", &client_addr);
 		if (ret) {
-			dev_err(dev, "invalid slave address on node %pOF\n",
+			dev_err(dev, "invalid client address on node %pOF\n",
 				childnp);
 			return -EINVAL;
 		}
 
-		p2wi->slave_addr = slave_addr;
+		p2wi->client_addr = client_addr;
 	}
 
 	p2wi->regs = devm_platform_ioremap_resource(pdev, 0);
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 59/64] i2c: uniphier-f: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (14 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 55/64] i2c: sun6i-p2wi: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
  2024-03-22 13:25 ` [PATCH 60/64] i2c: uniphier: " Wolfram Sang
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Kunihiko Hayashi, Masami Hiramatsu,
	linux-arm-kernel, linux-kernel

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-uniphier-f.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c
index dbc91c7c3788..f075c83a81b9 100644
--- a/drivers/i2c/busses/i2c-uniphier-f.c
+++ b/drivers/i2c/busses/i2c-uniphier-f.c
@@ -12,15 +12,15 @@
 #include <linux/platform_device.h>
 
 #define UNIPHIER_FI2C_CR	0x00	/* control register */
-#define     UNIPHIER_FI2C_CR_MST	BIT(3)	/* master mode */
+#define     UNIPHIER_FI2C_CR_MST	BIT(3)	/* host mode */
 #define     UNIPHIER_FI2C_CR_STA	BIT(2)	/* start condition */
 #define     UNIPHIER_FI2C_CR_STO	BIT(1)	/* stop condition */
 #define     UNIPHIER_FI2C_CR_NACK	BIT(0)	/* do not return ACK */
 #define UNIPHIER_FI2C_DTTX	0x04	/* TX FIFO */
-#define     UNIPHIER_FI2C_DTTX_CMD	BIT(8)	/* send command (slave addr) */
+#define     UNIPHIER_FI2C_DTTX_CMD	BIT(8)	/* send command (client addr) */
 #define     UNIPHIER_FI2C_DTTX_RD	BIT(0)	/* read transaction */
 #define UNIPHIER_FI2C_DTRX	0x04	/* RX FIFO */
-#define UNIPHIER_FI2C_SLAD	0x0c	/* slave address */
+#define UNIPHIER_FI2C_SLAD	0x0c	/* client address */
 #define UNIPHIER_FI2C_CYC	0x10	/* clock cycle control */
 #define UNIPHIER_FI2C_LCTL	0x14	/* clock low period control */
 #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,
 	int fifo_space = UNIPHIER_FI2C_FIFO_SIZE;
 
 	/*
-	 * TX-FIFO stores slave address in it for the first access.
+	 * TX-FIFO stores client address in it for the first access.
 	 * Decrement the counter.
 	 */
 	if (first)
@@ -252,7 +252,7 @@ static void uniphier_fi2c_tx_init(struct uniphier_fi2c_priv *priv, u16 addr,
 
 	/* do not use TX byte counter */
 	writel(0, priv->membase + UNIPHIER_FI2C_TBC);
-	/* set slave address */
+	/* set client address */
 	writel(UNIPHIER_FI2C_DTTX_CMD | addr << 1,
 	       priv->membase + UNIPHIER_FI2C_DTTX);
 	/*
@@ -288,7 +288,7 @@ static void uniphier_fi2c_rx_init(struct uniphier_fi2c_priv *priv, u16 addr)
 
 	uniphier_fi2c_set_irqs(priv);
 
-	/* set slave address with RD bit */
+	/* set client address with RD bit */
 	writel(UNIPHIER_FI2C_DTTX_CMD | UNIPHIER_FI2C_DTTX_RD | addr << 1,
 	       priv->membase + UNIPHIER_FI2C_DTTX);
 }
@@ -310,7 +310,7 @@ static void uniphier_fi2c_recover(struct uniphier_fi2c_priv *priv)
 	i2c_recover_bus(&priv->adap);
 }
 
-static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
+static int uniphier_fi2c_xfer_one(struct i2c_adapter *adap,
 					 struct i2c_msg *msg, bool repeat,
 					 bool stop)
 {
@@ -340,7 +340,7 @@ static int uniphier_fi2c_master_xfer_one(struct i2c_adapter *adap,
 		uniphier_fi2c_tx_init(priv, msg->addr, repeat);
 
 	/*
-	 * For a repeated START condition, writing a slave address to the FIFO
+	 * For a repeated START condition, writing a client address to the FIFO
 	 * kicks the controller. So, the UNIPHIER_FI2C_CR register should be
 	 * written only for a non-repeated START condition.
 	 */
@@ -404,7 +404,7 @@ static int uniphier_fi2c_check_bus_busy(struct i2c_adapter *adap)
 	return 0;
 }
 
-static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
+static int uniphier_fi2c_xfer(struct i2c_adapter *adap,
 				     struct i2c_msg *msgs, int num)
 {
 	struct i2c_msg *msg, *emsg = msgs + num;
@@ -419,7 +419,7 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap,
 		/* Emit STOP if it is the last message or I2C_M_STOP is set. */
 		bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
 
-		ret = uniphier_fi2c_master_xfer_one(adap, msg, repeat, stop);
+		ret = uniphier_fi2c_xfer_one(adap, msg, repeat, stop);
 		if (ret)
 			return ret;
 
@@ -435,7 +435,7 @@ static u32 uniphier_fi2c_functionality(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm uniphier_fi2c_algo = {
-	.master_xfer = uniphier_fi2c_master_xfer,
+	.xfer = uniphier_fi2c_xfer,
 	.functionality = uniphier_fi2c_functionality,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [PATCH 60/64] i2c: uniphier: reword according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (15 preceding siblings ...)
  2024-03-22 13:25 ` [PATCH 59/64] i2c: uniphier-f: " Wolfram Sang
@ 2024-03-22 13:25 ` Wolfram Sang
       [not found] ` <20240322132619.6389-65-wsa+renesas@sang-engineering.com>
  2024-03-23  9:20 ` [PATCH 00/64] i2c: reword i2c_algorithm " Andi Shyti
  18 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 13:25 UTC (permalink / raw)
  To: linux-i2c
  Cc: Wolfram Sang, Andi Shyti, Kunihiko Hayashi, Masami Hiramatsu,
	linux-arm-kernel, linux-kernel

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-uniphier.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c
index 854ac25b5862..24fa15c92845 100644
--- a/drivers/i2c/busses/i2c-uniphier.c
+++ b/drivers/i2c/busses/i2c-uniphier.c
@@ -17,13 +17,13 @@
 #define     UNIPHIER_I2C_DTRM_NACK	BIT(8)	/* do not return ACK */
 #define     UNIPHIER_I2C_DTRM_RD	BIT(0)	/* read transaction */
 #define UNIPHIER_I2C_DREC	0x04	/* RX register */
-#define     UNIPHIER_I2C_DREC_MST	BIT(14)	/* 1 = master, 0 = slave */
+#define     UNIPHIER_I2C_DREC_MST	BIT(14)	/* 1 = host, 0 = target */
 #define     UNIPHIER_I2C_DREC_TX	BIT(13)	/* 1 = transmit, 0 = receive */
 #define     UNIPHIER_I2C_DREC_STS	BIT(12)	/* stop condition detected */
 #define     UNIPHIER_I2C_DREC_LRB	BIT(11)	/* no ACK */
 #define     UNIPHIER_I2C_DREC_LAB	BIT(9)	/* arbitration lost */
 #define     UNIPHIER_I2C_DREC_BBN	BIT(8)	/* bus not busy */
-#define UNIPHIER_I2C_MYAD	0x08	/* slave address */
+#define UNIPHIER_I2C_MYAD	0x08	/* target address */
 #define UNIPHIER_I2C_CLK	0x0c	/* clock frequency control */
 #define UNIPHIER_I2C_BRST	0x10	/* bus reset */
 #define     UNIPHIER_I2C_BRST_FOEN	BIT(1)	/* normal operation */
@@ -154,7 +154,7 @@ static int uniphier_i2c_stop(struct i2c_adapter *adap)
 				      UNIPHIER_I2C_DTRM_NACK);
 }
 
-static int uniphier_i2c_master_xfer_one(struct i2c_adapter *adap,
+static int uniphier_i2c_xfer_one(struct i2c_adapter *adap,
 					struct i2c_msg *msg, bool stop)
 {
 	bool is_read = msg->flags & I2C_M_RD;
@@ -213,7 +213,7 @@ static int uniphier_i2c_check_bus_busy(struct i2c_adapter *adap)
 	return 0;
 }
 
-static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
+static int uniphier_i2c_xfer(struct i2c_adapter *adap,
 				    struct i2c_msg *msgs, int num)
 {
 	struct i2c_msg *msg, *emsg = msgs + num;
@@ -227,7 +227,7 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap,
 		/* Emit STOP if it is the last message or I2C_M_STOP is set. */
 		bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP);
 
-		ret = uniphier_i2c_master_xfer_one(adap, msg, stop);
+		ret = uniphier_i2c_xfer_one(adap, msg, stop);
 		if (ret)
 			return ret;
 	}
@@ -241,7 +241,7 @@ static u32 uniphier_i2c_functionality(struct i2c_adapter *adap)
 }
 
 static const struct i2c_algorithm uniphier_i2c_algo = {
-	.master_xfer = uniphier_i2c_master_xfer,
+	.xfer = uniphier_i2c_xfer,
 	.functionality = uniphier_i2c_functionality,
 };
 
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* Re: [PATCH 47/64] i2c: rk3x: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 47/64] i2c: rk3x: " Wolfram Sang
@ 2024-03-22 13:51   ` Heiko Stübner
  0 siblings, 0 replies; 39+ messages in thread
From: Heiko Stübner @ 2024-03-22 13:51 UTC (permalink / raw)
  To: linux-i2c, Wolfram Sang
  Cc: Wolfram Sang, Andi Shyti, linux-arm-kernel, linux-rockchip,
	linux-kernel

Am Freitag, 22. März 2024, 14:25:40 CET schrieb Wolfram Sang:
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/i2c/busses/i2c-rk3x.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
> index 086fdf262e7b..01febd886bdd 100644
> --- a/drivers/i2c/busses/i2c-rk3x.c
> +++ b/drivers/i2c/busses/i2c-rk3x.c
> @@ -28,8 +28,8 @@
>  /* Register Map */
>  #define REG_CON        0x00 /* control register */
>  #define REG_CLKDIV     0x04 /* clock divisor register */
> -#define REG_MRXADDR    0x08 /* slave address for REGISTER_TX */
> -#define REG_MRXRADDR   0x0c /* slave register address for REGISTER_TX */
> +#define REG_MRXADDR    0x08 /* client address for REGISTER_TX */
> +#define REG_MRXRADDR   0x0c /* client register address for REGISTER_TX */
>  #define REG_MTXCNT     0x10 /* number of bytes to be transmitted */
>  #define REG_MRXCNT     0x14 /* number of bytes to be received */
>  #define REG_IEN        0x18 /* interrupt enable */
> @@ -68,8 +68,8 @@ enum {
>  /* REG_IEN/REG_IPD bits */
>  #define REG_INT_BTF       BIT(0) /* a byte was transmitted */
>  #define REG_INT_BRF       BIT(1) /* a byte was received */
> -#define REG_INT_MBTF      BIT(2) /* master data transmit finished */
> -#define REG_INT_MBRF      BIT(3) /* master data receive finished */
> +#define REG_INT_MBTF      BIT(2) /* host data transmit finished */
> +#define REG_INT_MBRF      BIT(3) /* host data receive finished */
>  #define REG_INT_START     BIT(4) /* START condition generated */
>  #define REG_INT_STOP      BIT(5) /* STOP condition generated */
>  #define REG_INT_NAKRCV    BIT(6) /* NACK received */
> @@ -184,7 +184,7 @@ struct rk3x_i2c_soc_data {
>   * @wait: the waitqueue to wait for i2c transfer
>   * @busy: the condition for the event to wait for
>   * @msg: current i2c message
> - * @addr: addr of i2c slave device
> + * @addr: addr of i2c client device
>   * @mode: mode of i2c transfer
>   * @is_last_msg: flag determines whether it is the last msg in this transfer
>   * @state: state of i2c transfer
> @@ -979,7 +979,7 @@ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num)
>  	/*
>  	 * The I2C adapter can issue a small (len < 4) write packet before
>  	 * reading. This speeds up SMBus-style register reads.
> -	 * The MRXADDR/MRXRADDR hold the slave address and the slave register
> +	 * The MRXADDR/MRXRADDR hold the client address and the client register
>  	 * address in this case.
>  	 */
>  
> @@ -1016,7 +1016,7 @@ static int rk3x_i2c_setup(struct rk3x_i2c *i2c, struct i2c_msg *msgs, int num)
>  			addr |= 1; /* set read bit */
>  
>  			/*
> -			 * We have to transmit the slave addr first. Use
> +			 * We have to transmit the client addr first. Use
>  			 * MOD_REGISTER_TX for that purpose.
>  			 */
>  			i2c->mode = REG_CON_MOD_REGISTER_TX;
> @@ -1162,8 +1162,8 @@ static u32 rk3x_i2c_func(struct i2c_adapter *adap)
>  }
>  
>  static const struct i2c_algorithm rk3x_i2c_algorithm = {
> -	.master_xfer		= rk3x_i2c_xfer,
> -	.master_xfer_atomic	= rk3x_i2c_xfer_polling,
> +	.xfer		= rk3x_i2c_xfer,
> +	.xfer_atomic	= rk3x_i2c_xfer_polling,
>  	.functionality		= rk3x_i2c_func,
>  };
>  
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification
       [not found] ` <20240322132619.6389-65-wsa+renesas@sang-engineering.com>
@ 2024-03-22 16:09   ` Andy Shevchenko
  2024-03-22 16:48     ` Wolfram Sang
  0 siblings, 1 reply; 39+ messages in thread
From: Andy Shevchenko @ 2024-03-22 16:09 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Andi Shyti, Krzysztof Kozlowski, linux-arm-kernel,
	chrome-platform, linux-samsung-soc, imx, linux-mips,
	linux-amlogic, linux-mediatek, openbmc, linux-omap, linuxppc-dev,
	asahi, linux-arm-msm, linux-renesas-soc, linux-stm32, linux-tegra,
	virtualization

On Fri, Mar 22, 2024 at 02:25:57PM +0100, Wolfram Sang wrote:
> Match the wording in i2c_algorithm in I2C drivers wrt. the newest I2C
> v7, SMBus 3.2, I3C specifications and replace "master/slave" with more
> appropriate terms. For some drivers, this means no more conversions are
> needed. For the others more work needs to be done but this will be
> performed incrementally along with API changes/improvements. All these
> changes here are simple search/replace results.

...

>  static const struct i2c_algorithm at91_twi_algorithm = {
> -	.master_xfer	= at91_twi_xfer,
> +	.xfer	= at91_twi_xfer,

Seems you made this by a script, can you check the indentations afterwards?

>  	.functionality	= at91_twi_func,
>  };

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification
  2024-03-22 16:09   ` [PATCH 64/64] i2c: reword i2c_algorithm in drivers " Andy Shevchenko
@ 2024-03-22 16:48     ` Wolfram Sang
  2024-03-22 17:00       ` Andy Shevchenko
  0 siblings, 1 reply; 39+ messages in thread
From: Wolfram Sang @ 2024-03-22 16:48 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-i2c, Andi Shyti, Krzysztof Kozlowski, linux-arm-kernel,
	chrome-platform, linux-samsung-soc, imx, linux-mips,
	linux-amlogic, linux-mediatek, openbmc, linux-omap, linuxppc-dev,
	asahi, linux-arm-msm, linux-renesas-soc, linux-stm32, linux-tegra,
	virtualization


[-- Attachment #1.1: Type: text/plain, Size: 351 bytes --]


> >  static const struct i2c_algorithm at91_twi_algorithm = {
> > -	.master_xfer	= at91_twi_xfer,
> > +	.xfer	= at91_twi_xfer,
> 
> Seems you made this by a script, can you check the indentations afterwards?

Yes, I noticed as well. But other (not converted) drivers have issues
there as well, so this will be a seperate patch.

Thanks!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification
  2024-03-22 16:48     ` Wolfram Sang
@ 2024-03-22 17:00       ` Andy Shevchenko
  0 siblings, 0 replies; 39+ messages in thread
From: Andy Shevchenko @ 2024-03-22 17:00 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, Andi Shyti, Krzysztof Kozlowski,
	linux-arm-kernel, chrome-platform, linux-samsung-soc, imx,
	linux-mips, linux-amlogic, linux-mediatek, openbmc, linux-omap,
	linuxppc-dev, asahi, linux-arm-msm, linux-renesas-soc,
	linux-stm32, linux-tegra, virtualization

On Fri, Mar 22, 2024 at 05:48:54PM +0100, Wolfram Sang wrote:
> 
> > >  static const struct i2c_algorithm at91_twi_algorithm = {
> > > -	.master_xfer	= at91_twi_xfer,
> > > +	.xfer	= at91_twi_xfer,
> > 
> > Seems you made this by a script, can you check the indentations afterwards?
> 
> Yes, I noticed as well. But other (not converted) drivers have issues
> there as well, so this will be a seperate patch.

The problem is that you add to a technical debt. We don't want that.
If you have not introduced a new indentation issue, it obviously is
not needed to be fixed in a separate patch. So, please consider this.

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 53/64] i2c: st: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 53/64] i2c: st: " Wolfram Sang
@ 2024-03-22 17:11   ` Easwar Hariharan
  2024-04-08  9:14     ` Wolfram Sang
  0 siblings, 1 reply; 39+ messages in thread
From: Easwar Hariharan @ 2024-03-22 17:11 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Patrice Chotard, Andi Shyti, linux-arm-kernel, linux-kernel

On 3/22/2024 6:25 AM, 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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/i2c/busses/i2c-st.c | 17 +++++++----------
>  1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
> index ce2333408904..9bd45ae83c0c 100644
> --- a/drivers/i2c/busses/i2c-st.c
> +++ b/drivers/i2c/busses/i2c-st.c
> @@ -2,7 +2,7 @@
>  /*
>   * Copyright (C) 2013 STMicroelectronics
>   *
> - * I2C master mode controller driver, used in STMicroelectronics devices.
> + * I2C host controller driver, used in STMicroelectronics devices.
>   *
>   * Author: Maxime Coquelin <maxime.coquelin@st.com>
>   */
> @@ -150,7 +150,7 @@ struct st_i2c_timings {
>  
>  /**
>   * struct st_i2c_client - client specific data
> - * @addr: 8-bit slave addr, including r/w bit
> + * @addr: 8-bit client addr, including r/w bit
>   * @count: number of bytes to be transfered
>   * @xfered: number of bytes already transferred
>   * @buf: data buffer
> @@ -647,7 +647,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
>  {
>  	struct st_i2c_client *c = &i2c_dev->client;
>  	u32 ctl, i2c, it;
> -	unsigned long timeout;
> +	unsigned long time_left;

Thanks for doing this. Is the timeout v/s time_left language also due to the specification change?
A link to the specification(s) in the commit message would be nice to have

>  	int ret;
>  
>  	c->addr		= i2c_8bit_addr_from_msg(msg);
> @@ -667,7 +667,7 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
>  		i2c |= SSC_I2C_ACKG;
>  	st_i2c_set_bits(i2c_dev->base + SSC_I2C, i2c);
>  
> -	/* Write slave address */
> +	/* Write client address */
>  	st_i2c_write_tx_fifo(i2c_dev, c->addr);
>  
>  	/* Pre-fill Tx fifo with data in case of write */
> @@ -685,15 +685,12 @@ static int st_i2c_xfer_msg(struct st_i2c_dev *i2c_dev, struct i2c_msg *msg,
>  		st_i2c_set_bits(i2c_dev->base + SSC_I2C, SSC_I2C_STRTG);
>  	}
>  
> -	timeout = wait_for_completion_timeout(&i2c_dev->complete,
> +	time_left = wait_for_completion_timeout(&i2c_dev->complete,
>  			i2c_dev->adap.timeout);
>  	ret = c->result;
>  
> -	if (!timeout) {
> -		dev_err(i2c_dev->dev, "Write to slave 0x%x timed out\n",
> -				c->addr);
> +	if (!time_left)
>  		ret = -ETIMEDOUT;
> -	}

Why did we lost the dev_err() here?

>  
>  	i2c = SSC_I2C_STOPG | SSC_I2C_REPSTRTG;
>  	st_i2c_clr_bits(i2c_dev->base + SSC_I2C, i2c);
> @@ -769,7 +766,7 @@ static u32 st_i2c_func(struct i2c_adapter *adap)
>  }
>  
>  static const struct i2c_algorithm st_i2c_algo = {
> -	.master_xfer = st_i2c_xfer,
> +	.xfer = st_i2c_xfer,
>  	.functionality = st_i2c_func,
>  };
>  


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification
  2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
                   ` (17 preceding siblings ...)
       [not found] ` <20240322132619.6389-65-wsa+renesas@sang-engineering.com>
@ 2024-03-23  9:20 ` Andi Shyti
  2024-03-26  0:36   ` Andi Shyti
  18 siblings, 1 reply; 39+ messages in thread
From: Andi Shyti @ 2024-03-23  9:20 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, asahi, chrome-platform, imx, linux-actions,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-aspeed,
	linux-kernel, linux-mediatek, linux-mips, linux-omap,
	linuxppc-dev, linux-renesas-soc, linux-riscv, linux-rockchip,
	linux-rpi-kernel, linux-samsung-soc, linux-stm32, linux-sunxi,
	linux-tegra, openbmc, virtualization

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:53PM +0100, Wolfram Sang wrote:
> Okay, we need to begin somewhere...
> 
> Start changing the wording of the I2C main header wrt. the newest I2C
> v7, SMBus 3.2, I3C specifications and replace "master/slave" with more
> appropriate terms. This first step renames the members of struct
> i2c_algorithm. Once all in-tree users are converted, the anonymous union
> will go away again. All this work will also pave the way for finally
> seperating the monolithic header into more fine-grained headers like
> "i2c/clients.h" etc. So, this is not a simple renaming-excercise but
> also a chance to update the I2C core to recent Linux standards.

yes, very good! It's clearly stated in all three documentations
that Target replaces Slave and Controller replaces Master (i3c is
at the 1.1.1 version).

> My motivation is to improve the I2C core API, in general. My motivation
> is not to clean each and every driver. I think this is impossible
> because register names based on official documentation will need to stay
> as they are. But the Linux-internal names should be updated IMO.

Also because some drivers have been written based on previous
specifications where master/slave was used.

> That being said, I worked on 62 drivers in this series beyond plain
> renames inside 'struct i2c_algorithm' because the fruits were so
> low-hanging. Before this series, 112 files in the 'busses/' directory
> contained 'master' and/or 'slave'. After the series, only 57. Why not?
> 
> Next step is updating the drivers outside the 'i2c'-folder regarding
> 'struct i2c_algorithm' so we can remove the anonymous union ASAP. To be
> able to work on this with minimal dependencies, I'd like to apply this
> series between -rc1 and -rc2.
> 
> I hope this will work for you guys. The changes are really minimal. If
> you are not comfortable with changes to your driver or need more time to
> review, please NACK the patch and I will drop the patch and/or address
> the issues separeately.
> 
> @Andi: are you okay with this approach? It means you'd need to merge
> -rc2 into your for-next branch. Or rebase if all fails.

I think it's a good plan, I'll try to support you with it.

> Speaking of Andi, thanks a lot to him taking care of the controller
> drivers these days. His work really gives me the freedom to work on I2C
> core issues again.

Thank you, Wolfram!

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification
  2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
@ 2024-03-25  2:29   ` Andrew Jeffery
  2024-03-26  0:17   ` Andi Shyti
  1 sibling, 0 replies; 39+ messages in thread
From: Andrew Jeffery @ 2024-03-25  2:29 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Brendan Higgins, Benjamin Herrenschmidt, Joel Stanley, Andi Shyti,
	openbmc, linux-arm-kernel, linux-aspeed, linux-kernel

On Fri, 2024-03-22 at 14:24 +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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 37/64] i2c: mt7621: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 37/64] i2c: mt7621: " Wolfram Sang
@ 2024-03-25  8:06   ` AngeloGioacchino Del Regno
  2024-03-25  8:07   ` Stefan Roese
  1 sibling, 0 replies; 39+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-03-25  8:06 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Stefan Roese, Andi Shyti, Matthias Brugger, linux-kernel,
	linux-arm-kernel, linux-mediatek

Il 22/03/24 14:25, Wolfram Sang ha scritto:
> 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>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 37/64] i2c: mt7621: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 37/64] i2c: mt7621: " Wolfram Sang
  2024-03-25  8:06   ` AngeloGioacchino Del Regno
@ 2024-03-25  8:07   ` Stefan Roese
  1 sibling, 0 replies; 39+ messages in thread
From: Stefan Roese @ 2024-03-25  8:07 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Andi Shyti, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-kernel, linux-arm-kernel, linux-mediatek

On 3/22/24 14:25, 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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   drivers/i2c/busses/i2c-mt7621.c | 22 +++++++++++-----------
>   1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mt7621.c b/drivers/i2c/busses/i2c-mt7621.c
> index 81d46169bc1f..c567a2cf4a90 100644
> --- a/drivers/i2c/busses/i2c-mt7621.c
> +++ b/drivers/i2c/busses/i2c-mt7621.c
> @@ -117,26 +117,26 @@ static int mtk_i2c_check_ack(struct mtk_i2c *i2c, u32 expected)
>   	return ((ack & ack_expected) == ack_expected) ? 0 : -ENXIO;
>   }
>   
> -static int mtk_i2c_master_start(struct mtk_i2c *i2c)
> +static int mtk_i2c_host_start(struct mtk_i2c *i2c)
>   {
>   	iowrite32(SM0CTL1_START | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG);
>   	return mtk_i2c_wait_idle(i2c);
>   }
>   
> -static int mtk_i2c_master_stop(struct mtk_i2c *i2c)
> +static int mtk_i2c_host_stop(struct mtk_i2c *i2c)
>   {
>   	iowrite32(SM0CTL1_STOP | SM0CTL1_TRI, i2c->base + REG_SM0CTL1_REG);
>   	return mtk_i2c_wait_idle(i2c);
>   }
>   
> -static int mtk_i2c_master_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len)
> +static int mtk_i2c_host_cmd(struct mtk_i2c *i2c, u32 cmd, int page_len)
>   {
>   	iowrite32(cmd | SM0CTL1_TRI | SM0CTL1_PGLEN(page_len),
>   		  i2c->base + REG_SM0CTL1_REG);
>   	return mtk_i2c_wait_idle(i2c);
>   }
>   
> -static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> +static int mtk_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   			       int num)
>   {
>   	struct mtk_i2c *i2c;
> @@ -157,7 +157,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   			goto err_timeout;
>   
>   		/* start sequence */
> -		ret = mtk_i2c_master_start(i2c);
> +		ret = mtk_i2c_host_start(i2c);
>   		if (ret)
>   			goto err_timeout;
>   
> @@ -169,14 +169,14 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   			if (pmsg->flags & I2C_M_RD)
>   				addr |= 1;
>   			iowrite32(addr, i2c->base + REG_SM0D0_REG);
> -			ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 2);
> +			ret = mtk_i2c_host_cmd(i2c, SM0CTL1_WRITE, 2);
>   			if (ret)
>   				goto err_timeout;
>   		} else {
>   			/* 7 bits address */
>   			addr = i2c_8bit_addr_from_msg(pmsg);
>   			iowrite32(addr, i2c->base + REG_SM0D0_REG);
> -			ret = mtk_i2c_master_cmd(i2c, SM0CTL1_WRITE, 1);
> +			ret = mtk_i2c_host_cmd(i2c, SM0CTL1_WRITE, 1);
>   			if (ret)
>   				goto err_timeout;
>   		}
> @@ -202,7 +202,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   				cmd = SM0CTL1_WRITE;
>   			}
>   
> -			ret = mtk_i2c_master_cmd(i2c, cmd, page_len);
> +			ret = mtk_i2c_host_cmd(i2c, cmd, page_len);
>   			if (ret)
>   				goto err_timeout;
>   
> @@ -222,7 +222,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   		}
>   	}
>   
> -	ret = mtk_i2c_master_stop(i2c);
> +	ret = mtk_i2c_host_stop(i2c);
>   	if (ret)
>   		goto err_timeout;
>   
> @@ -230,7 +230,7 @@ static int mtk_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
>   	return i;
>   
>   err_ack:
> -	ret = mtk_i2c_master_stop(i2c);
> +	ret = mtk_i2c_host_stop(i2c);
>   	if (ret)
>   		goto err_timeout;
>   	return -ENXIO;
> @@ -247,7 +247,7 @@ static u32 mtk_i2c_func(struct i2c_adapter *a)
>   }
>   
>   static const struct i2c_algorithm mtk_i2c_algo = {
> -	.master_xfer	= mtk_i2c_master_xfer,
> +	.xfer	= mtk_i2c_xfer,
>   	.functionality	= mtk_i2c_func,
>   };
>   

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 15/64] i2c: davinci: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 15/64] i2c: davinci: " Wolfram Sang
@ 2024-03-25 15:07   ` Bartosz Golaszewski
  0 siblings, 0 replies; 39+ messages in thread
From: Bartosz Golaszewski @ 2024-03-25 15:07 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, Andi Shyti, linux-arm-kernel, linux-kernel

On Fri, Mar 22, 2024 at 2:26 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> 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").
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification
  2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
  2024-03-25  2:29   ` Andrew Jeffery
@ 2024-03-26  0:17   ` Andi Shyti
  2024-04-08  8:35     ` Wolfram Sang
  1 sibling, 1 reply; 39+ messages in thread
From: Andi Shyti @ 2024-03-26  0:17 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Brendan Higgins, Benjamin Herrenschmidt, Joel Stanley,
	Andrew Jeffery, openbmc, linux-arm-kernel, linux-aspeed,
	linux-kernel

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:58PM +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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/i2c/busses/i2c-aspeed.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c
> index ce8c4846b7fa..4e6ea4a5cab9 100644
> --- a/drivers/i2c/busses/i2c-aspeed.c
> +++ b/drivers/i2c/busses/i2c-aspeed.c
> @@ -159,7 +159,7 @@ struct aspeed_i2c_bus {
>  	bool				send_stop;
>  	int				cmd_err;
>  	/* Protected only by i2c_lock_bus */
> -	int				master_xfer_result;
> +	int				xfer_result;
>  	/* Multi-master */
>  	bool				multi_master;
>  #if IS_ENABLED(CONFIG_I2C_SLAVE)
> @@ -608,9 +608,9 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status)
>  out_complete:
>  	bus->msgs = NULL;
>  	if (bus->cmd_err)
> -		bus->master_xfer_result = bus->cmd_err;
> +		bus->xfer_result = bus->cmd_err;
>  	else
> -		bus->master_xfer_result = bus->msgs_index + 1;
> +		bus->xfer_result = bus->msgs_index + 1;
>  	complete(&bus->cmd_complete);
>  out_no_complete:
>  	return irq_handled;
> @@ -679,7 +679,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id)
>  	return irq_remaining ? IRQ_NONE : IRQ_HANDLED;
>  }
>  
> -static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
> +static int aspeed_i2c_xfer(struct i2c_adapter *adap,
>  				  struct i2c_msg *msgs, int num)

here the alignment goes a bi off.

>  {
>  	struct aspeed_i2c_bus *bus = i2c_get_adapdata(adap);
> @@ -738,7 +738,7 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
>  		return -ETIMEDOUT;
>  	}
>  
> -	return bus->master_xfer_result;
> +	return bus->xfer_result;
>  }
>  
>  static u32 aspeed_i2c_functionality(struct i2c_adapter *adap)
> @@ -748,7 +748,7 @@ static u32 aspeed_i2c_functionality(struct i2c_adapter *adap)
>  
>  #if IS_ENABLED(CONFIG_I2C_SLAVE)
>  /* precondition: bus.lock has been acquired. */
> -static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
> +static void __aspeed_i2c_reg_target(struct aspeed_i2c_bus *bus, u16 slave_addr)

We  have the word master/slave forgotten here and there, but as
we are here, /slave_addr/target_addr/

>  {
>  	u32 addr_reg_val, func_ctrl_reg_val;
>  
> @@ -770,7 +770,7 @@ static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
>  	bus->slave_state = ASPEED_I2C_SLAVE_INACTIVE;
>  }
>  
> -static int aspeed_i2c_reg_slave(struct i2c_client *client)
> +static int aspeed_i2c_reg_target(struct i2c_client *client)
>  {
>  	struct aspeed_i2c_bus *bus = i2c_get_adapdata(client->adapter);
>  	unsigned long flags;
> @@ -781,7 +781,7 @@ static int aspeed_i2c_reg_slave(struct i2c_client *client)
>  		return -EINVAL;
>  	}
>  
> -	__aspeed_i2c_reg_slave(bus, client->addr);
> +	__aspeed_i2c_reg_target(bus, client->addr);
>  
>  	bus->slave = client;
>  	spin_unlock_irqrestore(&bus->lock, flags);
> @@ -789,7 +789,7 @@ static int aspeed_i2c_reg_slave(struct i2c_client *client)
>  	return 0;
>  }
>  
> -static int aspeed_i2c_unreg_slave(struct i2c_client *client)
> +static int aspeed_i2c_unreg_target(struct i2c_client *client)
>  {
>  	struct aspeed_i2c_bus *bus = i2c_get_adapdata(client->adapter);
>  	u32 func_ctrl_reg_val;
> @@ -814,11 +814,11 @@ static int aspeed_i2c_unreg_slave(struct i2c_client *client)
>  #endif /* CONFIG_I2C_SLAVE */
>  
>  static const struct i2c_algorithm aspeed_i2c_algo = {
> -	.master_xfer	= aspeed_i2c_master_xfer,
> +	.xfer	= aspeed_i2c_xfer,

here the alignment goes a bit off.

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification
  2024-03-23  9:20 ` [PATCH 00/64] i2c: reword i2c_algorithm " Andi Shyti
@ 2024-03-26  0:36   ` Andi Shyti
  2024-04-05  8:48     ` Wolfram Sang
  0 siblings, 1 reply; 39+ messages in thread
From: Andi Shyti @ 2024-03-26  0:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, asahi, chrome-platform, imx, linux-actions,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-aspeed,
	linux-kernel, linux-mediatek, linux-mips, linux-omap,
	linuxppc-dev, linux-renesas-soc, linux-riscv, linux-rockchip,
	linux-rpi-kernel, linux-samsung-soc, linux-stm32, linux-sunxi,
	linux-tegra, openbmc, virtualization

Hi Wolfram,

> > @Andi: are you okay with this approach? It means you'd need to merge
> > -rc2 into your for-next branch. Or rebase if all fails.
> 
> I think it's a good plan, I'll try to support you with it.

Do you feel more comfortable if I take the patches as soon as
they are reviewd?

So far I have tagged patch 1-4 and I can already merge 2,3,4 as
long as you merge patch 1.

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 07/64] i2c: bcm-iproc: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 07/64] i2c: bcm-iproc: " Wolfram Sang
@ 2024-03-26  7:29   ` Andi Shyti
  0 siblings, 0 replies; 39+ messages in thread
From: Andi Shyti @ 2024-03-26  7:29 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, linux-arm-kernel,
	linux-kernel

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:00PM +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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

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

Thanks,
Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 09/64] i2c: bcm2835: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 09/64] i2c: bcm2835: " Wolfram Sang
@ 2024-03-26 12:44   ` Florian Fainelli
  2024-03-26 19:03   ` Andi Shyti
  1 sibling, 0 replies; 39+ messages in thread
From: Florian Fainelli @ 2024-03-26 12:44 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Andi Shyti, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, linux-arm-kernel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 456 bytes --]



On 3/22/2024 6:25 AM, 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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 10/64] i2c: brcmstb: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 10/64] i2c: brcmstb: " Wolfram Sang
@ 2024-03-26 12:44   ` Florian Fainelli
  2024-03-26 19:04   ` Andi Shyti
  1 sibling, 0 replies; 39+ messages in thread
From: Florian Fainelli @ 2024-03-26 12:44 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c
  Cc: Kamal Dasu, Broadcom internal kernel review list, Andi Shyti,
	linux-arm-kernel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 456 bytes --]



On 3/22/2024 6:25 AM, 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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 09/64] i2c: bcm2835: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 09/64] i2c: bcm2835: " Wolfram Sang
  2024-03-26 12:44   ` Florian Fainelli
@ 2024-03-26 19:03   ` Andi Shyti
  1 sibling, 0 replies; 39+ messages in thread
From: Andi Shyti @ 2024-03-26 19:03 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Florian Fainelli, Broadcom internal kernel review list,
	Ray Jui, Scott Branden, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel

Hi Wolfram,

> @@ -391,7 +391,7 @@ static u32 bcm2835_i2c_func(struct i2c_adapter *adap)
>  }
>  
>  static const struct i2c_algorithm bcm2835_i2c_algo = {
> -	.master_xfer	= bcm2835_i2c_xfer,
> +	.xfer	= bcm2835_i2c_xfer,

Here you are breaking the alignment (even though I think a "tab"
alignment is not needed).

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 10/64] i2c: brcmstb: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 10/64] i2c: brcmstb: " Wolfram Sang
  2024-03-26 12:44   ` Florian Fainelli
@ 2024-03-26 19:04   ` Andi Shyti
  1 sibling, 0 replies; 39+ messages in thread
From: Andi Shyti @ 2024-03-26 19:04 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, Kamal Dasu, Broadcom internal kernel review list,
	Florian Fainelli, linux-arm-kernel, linux-kernel

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:03PM +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").
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

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

Thanks,
Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 11/64] i2c: cadence: reword according to newest specification
  2024-03-22 13:25 ` [PATCH 11/64] i2c: cadence: " Wolfram Sang
@ 2024-03-26 19:06   ` Andi Shyti
  0 siblings, 0 replies; 39+ messages in thread
From: Andi Shyti @ 2024-03-26 19:06 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, Michal Simek, linux-arm-kernel, linux-kernel

Hi Wolfram,

>  static const struct i2c_algorithm cdns_i2c_algo = {
> -	.master_xfer	= cdns_i2c_master_xfer,
> +	.xfer	= cdns_i2c_xfer,

alignment :-)

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification
  2024-03-26  0:36   ` Andi Shyti
@ 2024-04-05  8:48     ` Wolfram Sang
  0 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-04-05  8:48 UTC (permalink / raw)
  To: Andi Shyti
  Cc: linux-i2c, asahi, chrome-platform, imx, linux-actions,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-aspeed,
	linux-kernel, linux-mediatek, linux-mips, linux-omap,
	linuxppc-dev, linux-renesas-soc, linux-riscv, linux-rockchip,
	linux-rpi-kernel, linux-samsung-soc, linux-stm32, linux-sunxi,
	linux-tegra, openbmc, virtualization


[-- Attachment #1.1: Type: text/plain, Size: 399 bytes --]

Hi Andi, hi everyone,

thank you for reviewing and waiting. I had a small personal hiatus over
Easter but now I am back. This series needs another cycle, so no need to
hurry. I will address some of the review comments but not all. The
conversion (and API improvements) are some bigger tasks, so
inconsistencies inbetween can't be avoided AFAICS.

I'll keep you updated.

Happy hacking,

   Wolfram


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification
  2024-03-26  0:17   ` Andi Shyti
@ 2024-04-08  8:35     ` Wolfram Sang
  0 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-04-08  8:35 UTC (permalink / raw)
  To: Andi Shyti
  Cc: linux-i2c, Brendan Higgins, Benjamin Herrenschmidt, Joel Stanley,
	Andrew Jeffery, openbmc, linux-arm-kernel, linux-aspeed,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1137 bytes --]


> > -static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,
> > +static int aspeed_i2c_xfer(struct i2c_adapter *adap,
> >  				  struct i2c_msg *msgs, int num)
> 
> here the alignment goes a bi off.

Thanks, I missed this.

> >  #if IS_ENABLED(CONFIG_I2C_SLAVE)
> >  /* precondition: bus.lock has been acquired. */
> > -static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr)
> > +static void __aspeed_i2c_reg_target(struct aspeed_i2c_bus *bus, u16 slave_addr)
> 
> We  have the word master/slave forgotten here and there, but as
> we are here, /slave_addr/target_addr/

I can do this now. My plan was to convert it when I convert the whole
CONFIG_I2C_SLAVE interface. But "since we are here" can be argued.

> >  static const struct i2c_algorithm aspeed_i2c_algo = {
> > -	.master_xfer	= aspeed_i2c_master_xfer,
> > +	.xfer	= aspeed_i2c_xfer,
> 
> here the alignment goes a bit off.

I also wanted to fix this afterwards together with all the tab-indented
struct declarations in busses/. But maybe I better do the tab-removal
series beforehand? Would you accept such a thing?


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

* Re: [PATCH 53/64] i2c: st: reword according to newest specification
  2024-03-22 17:11   ` Easwar Hariharan
@ 2024-04-08  9:14     ` Wolfram Sang
  0 siblings, 0 replies; 39+ messages in thread
From: Wolfram Sang @ 2024-04-08  9:14 UTC (permalink / raw)
  To: Easwar Hariharan
  Cc: linux-i2c, Patrice Chotard, Andi Shyti, linux-arm-kernel,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 970 bytes --]

> > -	unsigned long timeout;
> > +	unsigned long time_left;
> 
> Thanks for doing this. Is the timeout v/s time_left language also due to the specification change?
> A link to the specification(s) in the commit message would be nice to have

I admit it is probably a seperate change...

> > -	if (!timeout) {
> > -		dev_err(i2c_dev->dev, "Write to slave 0x%x timed out\n",
> > -				c->addr);

... motivated by this "if (!timeout) dev_err("timeout!")" which is super
confusing to read because the logic is paradox.


> > +	if (!time_left)
> >  		ret = -ETIMEDOUT;
> > -	}
> 
> Why did we lost the dev_err() here?

Agreed. Another seperate change. A timeout is not something the user
need to be aware of. It can regularly happen while an EEPROM is erasing
a page. The client driver will probably handle it correctly by trying
again. Only if the client driver sees a problem, then the user should be
notified. But not in the controller driver.


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2024-04-08  9:14 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 13:24 [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification Wolfram Sang
2024-03-22 13:24 ` [PATCH 05/64] i2c: aspeed: reword " Wolfram Sang
2024-03-25  2:29   ` Andrew Jeffery
2024-03-26  0:17   ` Andi Shyti
2024-04-08  8:35     ` Wolfram Sang
2024-03-22 13:25 ` [PATCH 07/64] i2c: bcm-iproc: " Wolfram Sang
2024-03-26  7:29   ` Andi Shyti
2024-03-22 13:25 ` [PATCH 09/64] i2c: bcm2835: " Wolfram Sang
2024-03-26 12:44   ` Florian Fainelli
2024-03-26 19:03   ` Andi Shyti
2024-03-22 13:25 ` [PATCH 10/64] i2c: brcmstb: " Wolfram Sang
2024-03-26 12:44   ` Florian Fainelli
2024-03-26 19:04   ` Andi Shyti
2024-03-22 13:25 ` [PATCH 11/64] i2c: cadence: " Wolfram Sang
2024-03-26 19:06   ` Andi Shyti
2024-03-22 13:25 ` [PATCH 15/64] i2c: davinci: " Wolfram Sang
2024-03-25 15:07   ` Bartosz Golaszewski
2024-03-22 13:25 ` [PATCH 16/64] i2c: digicolor: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 26/64] i2c: imx-lpi2c: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 31/64] i2c: lpc2k: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 37/64] i2c: mt7621: " Wolfram Sang
2024-03-25  8:06   ` AngeloGioacchino Del Regno
2024-03-25  8:07   ` Stefan Roese
2024-03-22 13:25 ` [PATCH 40/64] i2c: owl: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 47/64] i2c: rk3x: " Wolfram Sang
2024-03-22 13:51   ` Heiko Stübner
2024-03-22 13:25 ` [PATCH 53/64] i2c: st: " Wolfram Sang
2024-03-22 17:11   ` Easwar Hariharan
2024-04-08  9:14     ` Wolfram Sang
2024-03-22 13:25 ` [PATCH 54/64] i2c: stm32f4: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 55/64] i2c: sun6i-p2wi: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 59/64] i2c: uniphier-f: " Wolfram Sang
2024-03-22 13:25 ` [PATCH 60/64] i2c: uniphier: " Wolfram Sang
     [not found] ` <20240322132619.6389-65-wsa+renesas@sang-engineering.com>
2024-03-22 16:09   ` [PATCH 64/64] i2c: reword i2c_algorithm in drivers " Andy Shevchenko
2024-03-22 16:48     ` Wolfram Sang
2024-03-22 17:00       ` Andy Shevchenko
2024-03-23  9:20 ` [PATCH 00/64] i2c: reword i2c_algorithm " Andi Shyti
2024-03-26  0:36   ` Andi Shyti
2024-04-05  8:48     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).