2024-03-22 13:26:45

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification

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



2024-03-22 13:27:03

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 02/64] i2c: ali15x3: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-ali15x3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-ali15x3.c b/drivers/i2c/busses/i2c-ali15x3.c
index d2fa30deb054..20d73b5e6f1f 100644
--- a/drivers/i2c/busses/i2c-ali15x3.c
+++ b/drivers/i2c/busses/i2c-ali15x3.c
@@ -39,7 +39,7 @@
We make sure that the SMB is enabled. We leave the ACPI alone.

This driver controls the SMB Host only.
- The SMB Slave controller on the M15X3 is not enabled.
+ The SMB Target controller on the M15X3 is not enabled.

This driver does not use interrupts.
*/
--
2.43.0


2024-03-22 13:27:11

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 01/64] i2c: reword i2c_algorithm according to newest specification

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. The 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.

Signed-off-by: Wolfram Sang <[email protected]>
---
include/linux/i2c.h | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5e6cd43a6dbd..9acab1d21655 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -548,10 +548,18 @@ struct i2c_algorithm {
* master_xfer should return the number of messages successfully
* processed, or a negative value on error
*/
- int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
- int num);
- int (*master_xfer_atomic)(struct i2c_adapter *adap,
+ union {
+ int (*xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ int num);
+ int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ int num);
+ };
+ union {
+ int (*xfer_atomic)(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num);
+ int (*master_xfer_atomic)(struct i2c_adapter *adap,
+ struct i2c_msg *msgs, int num);
+ };
int (*smbus_xfer)(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data *data);
@@ -563,8 +571,14 @@ struct i2c_algorithm {
u32 (*functionality)(struct i2c_adapter *adap);

#if IS_ENABLED(CONFIG_I2C_SLAVE)
- int (*reg_slave)(struct i2c_client *client);
- int (*unreg_slave)(struct i2c_client *client);
+ union {
+ int (*reg_target)(struct i2c_client *client);
+ int (*reg_slave)(struct i2c_client *client);
+ };
+ union {
+ int (*unreg_target)(struct i2c_client *client);
+ int (*unreg_slave)(struct i2c_client *client);
+ };
#endif
};

--
2.43.0


2024-03-22 13:27:15

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 04/64] i2c: amd-mp2-pci: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-amd-mp2-pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c
index 143165300949..2ad0bb4661b4 100644
--- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
+++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
@@ -112,7 +112,7 @@ static void amd_mp2_pci_check_rw_event(struct amd_i2c_common *i2c_common)
struct amd_mp2_dev *privdata = i2c_common->mp2_dev;
struct pci_dev *pdev = privdata->pci_dev;
int len = i2c_common->eventval.r.length;
- u32 slave_addr = i2c_common->eventval.r.slave_addr;
+ u32 client_addr = i2c_common->eventval.r.slave_addr;
bool err = false;

if (unlikely(len != i2c_common->msg->len)) {
@@ -121,9 +121,9 @@ static void amd_mp2_pci_check_rw_event(struct amd_i2c_common *i2c_common)
err = true;
}

- if (unlikely(slave_addr != i2c_common->msg->addr)) {
- pci_err(pdev, "unexpected slave address %x (expected: %x)!\n",
- slave_addr, i2c_common->msg->addr);
+ if (unlikely(client_addr != i2c_common->msg->addr)) {
+ pci_err(pdev, "unexpected client address %x (expected: %x)!\n",
+ client_addr, i2c_common->msg->addr);
err = true;
}

--
2.43.0


2024-03-22 13:27:37

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 03/64] i2c: altera: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-altera.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-altera.c b/drivers/i2c/busses/i2c-altera.c
index 252fbd175fb1..f4dde08a3b92 100644
--- a/drivers/i2c/busses/i2c-altera.c
+++ b/drivers/i2c/busses/i2c-altera.c
@@ -168,7 +168,7 @@ static void altr_i2c_init(struct altr_i2c_dev *idev)
/* SDA Hold Time, 300ns */
writel(3 * clk_mhz / 10, idev->base + ALTR_I2C_SDA_HOLD);

- /* Mask all master interrupt bits */
+ /* Mask all interrupt bits */
altr_i2c_int_enable(idev, ALTR_I2C_ALL_IRQ, false);
}

@@ -376,7 +376,7 @@ static u32 altr_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm altr_i2c_algo = {
- .master_xfer = altr_i2c_xfer,
+ .xfer = altr_i2c_xfer,
.functionality = altr_i2c_func,
};

--
2.43.0


2024-03-22 13:28:05

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 05/64] i2c: aspeed: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:28:30

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 08/64] i2c: bcm-kona: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-bcm-kona.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c
index a57088ec2b06..404388e65eb4 100644
--- a/drivers/i2c/busses/i2c-bcm-kona.c
+++ b/drivers/i2c/busses/i2c-bcm-kona.c
@@ -85,7 +85,7 @@
#define STD_EXT_CLK_FREQ 13000000UL
#define HS_EXT_CLK_FREQ 104000000UL

-#define MASTERCODE 0x08 /* Mastercodes are 0000_1xxxb */
+#define CONTROLLER_CODE 0x08 /* Controller codes are 0000_1xxxb */

#define I2C_TIMEOUT 100 /* msecs */

@@ -544,8 +544,8 @@ static int bcm_kona_i2c_switch_to_hs(struct bcm_kona_i2c_dev *dev)
{
int rc;

- /* Send mastercode at standard speed */
- rc = bcm_kona_i2c_write_byte(dev, MASTERCODE, 1);
+ /* Send controller code at standard speed */
+ rc = bcm_kona_i2c_write_byte(dev, CONTROLLER_CODE, 1);
if (rc < 0) {
pr_err("High speed handshake failed\n");
return rc;
@@ -587,7 +587,7 @@ static int bcm_kona_i2c_switch_to_std(struct bcm_kona_i2c_dev *dev)
return rc;
}

-/* Master transfer function */
+/* Host transfer function */
static int bcm_kona_i2c_xfer(struct i2c_adapter *adapter,
struct i2c_msg msgs[], int num)
{
@@ -637,7 +637,7 @@ static int bcm_kona_i2c_xfer(struct i2c_adapter *adapter,
}
}

- /* Send slave address */
+ /* Send client address */
if (!(pmsg->flags & I2C_M_NOSTART)) {
rc = bcm_kona_i2c_do_addr(dev, pmsg);
if (rc < 0) {
@@ -697,7 +697,7 @@ static uint32_t bcm_kona_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm bcm_algo = {
- .master_xfer = bcm_kona_i2c_xfer,
+ .xfer = bcm_kona_i2c_xfer,
.functionality = bcm_kona_i2c_functionality,
};

@@ -722,7 +722,7 @@ static int bcm_kona_i2c_assign_bus_speed(struct bcm_kona_i2c_dev *dev)
dev->std_cfg = &std_cfg_table[BCM_SPD_1MHZ];
break;
case I2C_MAX_HIGH_SPEED_MODE_FREQ:
- /* Send mastercode at 100k */
+ /* Send controller code at 100k */
dev->std_cfg = &std_cfg_table[BCM_SPD_100K];
dev->hs_cfg = &hs_cfg_table[BCM_SPD_3P4MHZ];
break;
--
2.43.0


2024-03-22 13:28:43

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 09/64] i2c: bcm2835: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:28:48

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 07/64] i2c: bcm-iproc: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:29:01

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 11/64] i2c: cadence: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:29:21

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 10/64] i2c: brcmstb: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:29:24

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 13/64] i2c: cp2615: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-cp2615.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cp2615.c b/drivers/i2c/busses/i2c-cp2615.c
index cf3747d87034..91fffc39afa9 100644
--- a/drivers/i2c/busses/i2c-cp2615.c
+++ b/drivers/i2c/busses/i2c-cp2615.c
@@ -60,7 +60,7 @@ enum cp2615_i2c_status {
CP2615_CFG_LOCKED = -6,
/* read_len or write_len out of range */
CP2615_INVALID_PARAM = -4,
- /* I2C slave did not ACK in time */
+ /* I2C client did not ACK in time */
CP2615_TIMEOUT,
/* I2C bus busy */
CP2615_BUS_BUSY,
@@ -211,7 +211,7 @@ static int cp2615_check_iop(struct usb_interface *usbif)
}

static int
-cp2615_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+cp2615_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
struct usb_interface *usbif = adap->algo_data;
int i = 0, ret = 0;
@@ -250,7 +250,7 @@ cp2615_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm cp2615_i2c_algo = {
- .master_xfer = cp2615_i2c_master_xfer,
+ .xfer = cp2615_i2c_xfer,
.functionality = cp2615_i2c_func,
};

--
2.43.0


2024-03-22 13:29:33

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 12/64] i2c: cht-wc: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-cht-wc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c
index 0209933b9a84..52e3000626c5 100644
--- a/drivers/i2c/busses/i2c-cht-wc.c
+++ b/drivers/i2c/busses/i2c-cht-wc.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
- * Intel CHT Whiskey Cove PMIC I2C Master driver
+ * Intel CHT Whiskey Cove PMIC I2C controller driver
* Copyright (C) 2017 Hans de Goede <[email protected]>
*
* Based on various non upstream patches to support the CHT Whiskey Cove PMIC:
@@ -106,7 +106,7 @@ static irqreturn_t cht_wc_i2c_adap_thread_handler(int id, void *data)
return IRQ_HANDLED;
}

-static u32 cht_wc_i2c_adap_master_func(struct i2c_adapter *adap)
+static u32 cht_wc_i2c_adap_func(struct i2c_adapter *adap)
{
/* This i2c adapter only supports SMBUS byte transfers */
return I2C_FUNC_SMBUS_BYTE_DATA;
@@ -168,7 +168,7 @@ static int cht_wc_i2c_adap_smbus_xfer(struct i2c_adapter *_adap, u16 addr,
}

static const struct i2c_algorithm cht_wc_i2c_adap_algo = {
- .functionality = cht_wc_i2c_adap_master_func,
+ .functionality = cht_wc_i2c_adap_func,
.smbus_xfer = cht_wc_i2c_adap_smbus_xfer,
};

@@ -554,6 +554,6 @@ static struct platform_driver cht_wc_i2c_adap_driver = {
};
module_platform_driver(cht_wc_i2c_adap_driver);

-MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C Master driver");
+MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C controller driver");
MODULE_AUTHOR("Hans de Goede <[email protected]>");
MODULE_LICENSE("GPL");
--
2.43.0


2024-03-22 13:29:50

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 15/64] i2c: davinci: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:29:59

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 14/64] i2c: cpm: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-cpm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 4404b4aac676..306e397fec0a 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -402,7 +402,7 @@ static u32 cpm_i2c_func(struct i2c_adapter *adap)
/* -----exported algorithm data: ------------------------------------- */

static const struct i2c_algorithm cpm_i2c_algo = {
- .master_xfer = cpm_i2c_xfer,
+ .xfer = cpm_i2c_xfer,
.functionality = cpm_i2c_func,
};

@@ -570,7 +570,7 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
out_8(&cpm->i2c_reg->i2brg, brg);

out_8(&cpm->i2c_reg->i2mod, 0x00);
- out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Master mode */
+ out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Host mode */

/* Disable interrupts. */
out_8(&cpm->i2c_reg->i2cmr, 0);
--
2.43.0


2024-03-22 13:30:04

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 16/64] i2c: digicolor: reword according to newest specification

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 <[email protected]>
---
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 <[email protected]>");
-MODULE_DESCRIPTION("Conexant Digicolor I2C master driver");
+MODULE_DESCRIPTION("Conexant Digicolor I2C controller driver");
MODULE_LICENSE("GPL v2");
--
2.43.0


2024-03-22 13:30:13

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 17/64] i2c: dln2: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-dln2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
index 631109c7a098..11ed055143d3 100644
--- a/drivers/i2c/busses/i2c-dln2.c
+++ b/drivers/i2c/busses/i2c-dln2.c
@@ -175,7 +175,7 @@ static u32 dln2_i2c_func(struct i2c_adapter *a)
}

static const struct i2c_algorithm dln2_i2c_usb_algorithm = {
- .master_xfer = dln2_i2c_xfer,
+ .xfer = dln2_i2c_xfer,
.functionality = dln2_i2c_func,
};

@@ -251,6 +251,6 @@ static struct platform_driver dln2_i2c_driver = {
module_platform_driver(dln2_i2c_driver);

MODULE_AUTHOR("Laurentiu Palcu <[email protected]>");
-MODULE_DESCRIPTION("Driver for the Diolan DLN2 I2C master interface");
+MODULE_DESCRIPTION("Driver for the Diolan DLN2 I2C controller interface");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:dln2-i2c");
--
2.43.0


2024-03-22 13:30:35

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 18/64] i2c: eg20t: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-eg20t.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
index 4914bfbee2a9..e95793036f5d 100644
--- a/drivers/i2c/busses/i2c-eg20t.c
+++ b/drivers/i2c/busses/i2c-eg20t.c
@@ -337,7 +337,7 @@ static int pch_i2c_wait_for_check_xfer(struct i2c_algo_pch_data *adap)
adap->pch_event_flag = 0;

if (ioread32(p + PCH_I2CSR) & PCH_GETACK) {
- pch_dbg(adap, "Receive NACK for slave address setting\n");
+ pch_dbg(adap, "Receive NACK for client address setting\n");
return -ENXIO;
}

@@ -382,7 +382,7 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
buf = msgs->buf;
addr = msgs->addr;

- /* enable master tx */
+ /* enable host tx */
pch_setbit(adap->pch_base_address, PCH_I2CCTL, I2C_TX_MODE);

pch_dbg(adap, "I2CCTL = %x msgs->len = %d\n", ioread32(p + PCH_I2CCTL),
@@ -406,7 +406,7 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
addr_8_lsb = (addr & I2C_ADDR_MSK);
iowrite32(addr_8_lsb, p + PCH_I2CDR);
} else {
- /* set 7 bit slave address and R/W bit as 0 */
+ /* set 7 bit client address and R/W bit as 0 */
iowrite32(i2c_8bit_addr_from_msg(msgs), p + PCH_I2CDR);
if (first)
pch_i2c_start(adap);
@@ -500,7 +500,7 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
buf = msgs->buf;
addr = msgs->addr;

- /* enable master reception */
+ /* enable host reception */
pch_clrbit(adap->pch_base_address, PCH_I2CCTL, I2C_TX_MODE);

if (first) {
@@ -708,7 +708,7 @@ static u32 pch_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm pch_algorithm = {
- .master_xfer = pch_i2c_xfer,
+ .xfer = pch_i2c_xfer,
.functionality = pch_i2c_func
};

--
2.43.0


2024-03-22 13:31:23

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 20/64] i2c: fsi: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-fsi.c | 56 ++++++++++++++++++------------------
1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index 10332693edf0..5eaf2c85a72c 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * FSI-attached I2C master algorithm
+ * FSI-attached I2C controller algorithm
*
* Copyright 2018 IBM Corporation
*
@@ -145,7 +145,7 @@
/* choose timeout length from legacy driver; it's well tested */
#define I2C_ABORT_TIMEOUT msecs_to_jiffies(100)

-struct fsi_i2c_master {
+struct fsi_i2c_host {
struct fsi_device *fsi;
u8 fifo_size;
struct list_head ports;
@@ -155,7 +155,7 @@ struct fsi_i2c_master {
struct fsi_i2c_port {
struct list_head list;
struct i2c_adapter adapter;
- struct fsi_i2c_master *master;
+ struct fsi_i2c_host *host;
u16 port;
u16 xfrd;
};
@@ -183,7 +183,7 @@ static int fsi_i2c_write_reg(struct fsi_device *fsi, unsigned int reg,
return fsi_device_write(fsi, reg, &data_be, sizeof(data_be));
}

-static int fsi_i2c_dev_init(struct fsi_i2c_master *i2c)
+static int fsi_i2c_dev_init(struct fsi_i2c_host *i2c)
{
int rc;
u32 mode = I2C_MODE_ENHANCED, extended_status, watermark;
@@ -214,7 +214,7 @@ static int fsi_i2c_dev_init(struct fsi_i2c_master *i2c)
static int fsi_i2c_set_port(struct fsi_i2c_port *port)
{
int rc;
- struct fsi_device *fsi = port->master->fsi;
+ struct fsi_device *fsi = port->host->fsi;
u32 mode, dummy = 0;

rc = fsi_i2c_read_reg(fsi, I2C_FSI_MODE, &mode);
@@ -236,7 +236,7 @@ static int fsi_i2c_set_port(struct fsi_i2c_port *port)
static int fsi_i2c_start(struct fsi_i2c_port *port, struct i2c_msg *msg,
bool stop)
{
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;
u32 cmd = I2C_CMD_WITH_START | I2C_CMD_WITH_ADDR;

port->xfrd = 0;
@@ -268,7 +268,7 @@ static int fsi_i2c_write_fifo(struct fsi_i2c_port *port, struct i2c_msg *msg,
{
int write;
int rc;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;
int bytes_to_write = i2c->fifo_size - fifo_count;
int bytes_remaining = msg->len - port->xfrd;

@@ -294,7 +294,7 @@ static int fsi_i2c_read_fifo(struct fsi_i2c_port *port, struct i2c_msg *msg,
{
int read;
int rc;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;
int bytes_to_read;
int xfr_remaining = msg->len - port->xfrd;
u32 dummy;
@@ -330,7 +330,7 @@ static int fsi_i2c_get_scl(struct i2c_adapter *adap)
{
u32 stat = 0;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat);

@@ -341,7 +341,7 @@ static void fsi_i2c_set_scl(struct i2c_adapter *adap, int val)
{
u32 dummy = 0;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

if (val)
fsi_i2c_write_reg(i2c->fsi, I2C_FSI_SET_SCL, &dummy);
@@ -353,7 +353,7 @@ static int fsi_i2c_get_sda(struct i2c_adapter *adap)
{
u32 stat = 0;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat);

@@ -364,7 +364,7 @@ static void fsi_i2c_set_sda(struct i2c_adapter *adap, int val)
{
u32 dummy = 0;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

if (val)
fsi_i2c_write_reg(i2c->fsi, I2C_FSI_SET_SDA, &dummy);
@@ -377,7 +377,7 @@ static void fsi_i2c_prepare_recovery(struct i2c_adapter *adap)
int rc;
u32 mode;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode);
if (rc)
@@ -392,7 +392,7 @@ static void fsi_i2c_unprepare_recovery(struct i2c_adapter *adap)
int rc;
u32 mode;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;

rc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_MODE, &mode);
if (rc)
@@ -402,7 +402,7 @@ static void fsi_i2c_unprepare_recovery(struct i2c_adapter *adap)
fsi_i2c_write_reg(i2c->fsi, I2C_FSI_MODE, &mode);
}

-static int fsi_i2c_reset_bus(struct fsi_i2c_master *i2c,
+static int fsi_i2c_reset_bus(struct fsi_i2c_host *i2c,
struct fsi_i2c_port *port)
{
int rc;
@@ -435,7 +435,7 @@ static int fsi_i2c_reset_bus(struct fsi_i2c_master *i2c,
return fsi_i2c_dev_init(i2c);
}

-static int fsi_i2c_reset_engine(struct fsi_i2c_master *i2c, u16 port)
+static int fsi_i2c_reset_engine(struct fsi_i2c_host *i2c, u16 port)
{
int rc;
u32 mode, dummy = 0;
@@ -478,7 +478,7 @@ static int fsi_i2c_abort(struct fsi_i2c_port *port, u32 status)
unsigned long start;
u32 cmd = I2C_CMD_WITH_STOP;
u32 stat;
- struct fsi_i2c_master *i2c = port->master;
+ struct fsi_i2c_host *i2c = port->host;
struct fsi_device *fsi = i2c->fsi;

rc = fsi_i2c_reset_engine(i2c, port->port);
@@ -505,7 +505,7 @@ static int fsi_i2c_abort(struct fsi_i2c_port *port, u32 status)
if (rc)
return rc;

- /* wait until we see command complete in the master */
+ /* wait until we see command complete in the controller */
start = jiffies;

do {
@@ -579,7 +579,7 @@ static int fsi_i2c_wait(struct fsi_i2c_port *port, struct i2c_msg *msg,
unsigned long start = jiffies;

do {
- rc = fsi_i2c_read_reg(port->master->fsi, I2C_FSI_STAT,
+ rc = fsi_i2c_read_reg(port->host->fsi, I2C_FSI_STAT,
&status);
if (rc)
return rc;
@@ -609,10 +609,10 @@ static int fsi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int i, rc;
unsigned long start_time;
struct fsi_i2c_port *port = adap->algo_data;
- struct fsi_i2c_master *master = port->master;
+ struct fsi_i2c_host *host = port->host;
struct i2c_msg *msg;

- mutex_lock(&master->lock);
+ mutex_lock(&host->lock);

rc = fsi_i2c_set_port(port);
if (rc)
@@ -633,7 +633,7 @@ static int fsi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
}

unlock:
- mutex_unlock(&master->lock);
+ mutex_unlock(&host->lock);
return rc ? : num;
}

@@ -654,7 +654,7 @@ static struct i2c_bus_recovery_info fsi_i2c_bus_recovery_info = {
};

static const struct i2c_algorithm fsi_i2c_algorithm = {
- .master_xfer = fsi_i2c_xfer,
+ .xfer = fsi_i2c_xfer,
.functionality = fsi_i2c_functionality,
};

@@ -676,7 +676,7 @@ static struct device_node *fsi_i2c_find_port_of_node(struct device_node *fsi,

static int fsi_i2c_probe(struct device *dev)
{
- struct fsi_i2c_master *i2c;
+ struct fsi_i2c_host *i2c;
struct fsi_i2c_port *port;
struct device_node *np;
u32 port_no, ports, stat;
@@ -699,7 +699,7 @@ static int fsi_i2c_probe(struct device *dev)
return rc;

ports = FIELD_GET(I2C_STAT_MAX_PORT, stat) + 1;
- dev_dbg(dev, "I2C master has %d ports\n", ports);
+ dev_dbg(dev, "I2C controller has %d ports\n", ports);

for (port_no = 0; port_no < ports; port_no++) {
np = fsi_i2c_find_port_of_node(dev->of_node, port_no);
@@ -712,7 +712,7 @@ static int fsi_i2c_probe(struct device *dev)
break;
}

- port->master = i2c;
+ port->host = i2c;
port->port = port_no;

port->adapter.owner = THIS_MODULE;
@@ -742,7 +742,7 @@ static int fsi_i2c_probe(struct device *dev)

static int fsi_i2c_remove(struct device *dev)
{
- struct fsi_i2c_master *i2c = dev_get_drvdata(dev);
+ struct fsi_i2c_host *i2c = dev_get_drvdata(dev);
struct fsi_i2c_port *port, *tmp;

list_for_each_entry_safe(port, tmp, &i2c->ports, list) {
@@ -772,5 +772,5 @@ static struct fsi_driver fsi_i2c_driver = {
module_fsi_driver(fsi_i2c_driver);

MODULE_AUTHOR("Eddie James <[email protected]>");
-MODULE_DESCRIPTION("FSI attached I2C master");
+MODULE_DESCRIPTION("FSI attached I2C controller");
MODULE_LICENSE("GPL");
--
2.43.0


2024-03-22 13:31:57

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 23/64] i2c: hix5hd2: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-hix5hd2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-hix5hd2.c b/drivers/i2c/busses/i2c-hix5hd2.c
index 8e75515c3ca4..d7a834a7fec5 100644
--- a/drivers/i2c/busses/i2c-hix5hd2.c
+++ b/drivers/i2c/busses/i2c-hix5hd2.c
@@ -200,7 +200,7 @@ static void hix5hd2_read_handle(struct hix5hd2_i2c_priv *priv)
/* the last byte don't need send ACK */
writel_relaxed(I2C_READ | I2C_NO_ACK, priv->regs + HIX5I2C_COM);
} else if (priv->msg_len > 1) {
- /* if i2c master receive data will send ACK */
+ /* if i2c controller receive data will send ACK */
writel_relaxed(I2C_READ, priv->regs + HIX5I2C_COM);
} else {
hix5hd2_rw_handle_stop(priv);
@@ -384,7 +384,7 @@ static u32 hix5hd2_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm hix5hd2_i2c_algorithm = {
- .master_xfer = hix5hd2_i2c_xfer,
+ .xfer = hix5hd2_i2c_xfer,
.functionality = hix5hd2_i2c_func,
};

--
2.43.0


2024-03-22 13:32:28

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 24/64] i2c: i801: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-i801.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index a6861660cb8c..68983f0a7fef 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -87,7 +87,7 @@
* Block buffer yes
* Block process call transaction yes
* I2C block read transaction yes (doesn't use the block buffer)
- * Slave mode no
+ * Target mode no
* SMBus Host Notify yes
* Interrupt processing yes
*
@@ -1274,10 +1274,10 @@ static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
i2c_new_client_device(&priv->adapter, &info);
}

-/* Register optional slaves */
-static void i801_probe_optional_slaves(struct i801_priv *priv)
+/* Register optional clients */
+static void i801_probe_optional_clients(struct i801_priv *priv)
{
- /* Only register slaves on main SMBus channel */
+ /* Only register clients on main SMBus channel */
if (priv->features & FEATURE_IDF)
return;

@@ -1304,7 +1304,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
}
#else
static void __init input_apanel_init(void) {}
-static void i801_probe_optional_slaves(struct i801_priv *priv) {}
+static void i801_probe_optional_clients(struct i801_priv *priv) {}
#endif /* CONFIG_X86 && CONFIG_DMI */

#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
@@ -1756,7 +1756,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)

/* We ignore errors - multiplexing is optional */
i801_add_mux(priv);
- i801_probe_optional_slaves(priv);
+ i801_probe_optional_clients(priv);

pci_set_drvdata(dev, priv);

--
2.43.0


2024-03-22 13:32:52

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 26/64] i2c: imx-lpi2c: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:33:39

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 27/64] i2c: iop3xx: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-iop3xx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 2e5f0165c3d3..9973f7d83205 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -22,7 +22,7 @@
* - Make it work with IXP46x chips
* - Cleanup function names, coding style, etc
*
- * - writing to slave address causes latchup on iop331.
+ * - writing to own client address causes latchup on iop331.
* fix: driver refuses to address self.
*/

@@ -234,7 +234,7 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
int status;
int rc;

- /* avoid writing to my slave address (hangs on 80331),
+ /* avoid writing to my client address (hangs on 80331),
* forbidden in Intel developer manual
*/
if (msg->addr == MYSAR) {
@@ -350,10 +350,10 @@ iop3xx_i2c_handle_msg(struct i2c_adapter *i2c_adap, struct i2c_msg *pmsg)
}

/*
- * master_xfer() - main read/write entry
+ * xfer() - main read/write entry
*/
static int
-iop3xx_i2c_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
+iop3xx_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
int num)
{
struct i2c_algo_iop3xx_data *iop3xx_adap = i2c_adap->algo_data;
@@ -384,7 +384,7 @@ iop3xx_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm iop3xx_i2c_algo = {
- .master_xfer = iop3xx_i2c_master_xfer,
+ .xfer = iop3xx_i2c_xfer,
.functionality = iop3xx_i2c_func,
};

--
2.43.0


2024-03-22 13:33:52

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 31/64] i2c: lpc2k: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:36:39

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 39/64] i2c: octeon-core: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-octeon-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
index 845eda70b8ca..a0e6c9a43168 100644
--- a/drivers/i2c/busses/i2c-octeon-core.c
+++ b/drivers/i2c/busses/i2c-octeon-core.c
@@ -215,14 +215,14 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read)
case STAT_LOST_ARB_B0:
return -EAGAIN;

- /* Being addressed as slave, should back off & listen */
+ /* Being addressed as target, should back off & listen */
case STAT_SLAVE_60:
case STAT_SLAVE_70:
case STAT_GENDATA_ACK:
case STAT_GENDATA_NAK:
return -EOPNOTSUPP;

- /* Core busy as slave */
+ /* Core busy as target */
case STAT_SLAVE_80:
case STAT_SLAVE_88:
case STAT_SLAVE_A0:
@@ -595,7 +595,7 @@ static int octeon_i2c_hlc_comp_write(struct octeon_i2c *i2c, struct i2c_msg *msg
}

/**
- * octeon_i2c_xfer - The driver's master_xfer function
+ * octeon_i2c_xfer - The driver's xfer function
* @adap: Pointer to the i2c_adapter structure
* @msgs: Pointer to the messages to be processed
* @num: Length of the MSGS array
--
2.43.0


2024-03-22 13:36:41

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 37/64] i2c: mt7621: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:36:54

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 40/64] i2c: owl: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:37:11

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 19/64] i2c: emev2: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-emev2.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
index 557409410445..e67c55abff88 100644
--- a/drivers/i2c/busses/i2c-emev2.c
+++ b/drivers/i2c/busses/i2c-emev2.c
@@ -314,7 +314,7 @@ static u32 em_i2c_func(struct i2c_adapter *adap)
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SLAVE;
}

-static int em_i2c_reg_slave(struct i2c_client *slave)
+static int em_i2c_reg_target(struct i2c_client *slave)
{
struct em_i2c_device *priv = i2c_get_adapdata(slave->adapter);

@@ -332,7 +332,7 @@ static int em_i2c_reg_slave(struct i2c_client *slave)
return 0;
}

-static int em_i2c_unreg_slave(struct i2c_client *slave)
+static int em_i2c_unreg_target(struct i2c_client *slave)
{
struct em_i2c_device *priv = i2c_get_adapdata(slave->adapter);

@@ -352,10 +352,10 @@ static int em_i2c_unreg_slave(struct i2c_client *slave)
}

static const struct i2c_algorithm em_i2c_algo = {
- .master_xfer = em_i2c_xfer,
+ .xfer = em_i2c_xfer,
.functionality = em_i2c_func,
- .reg_slave = em_i2c_reg_slave,
- .unreg_slave = em_i2c_unreg_slave,
+ .reg_target = em_i2c_reg_target,
+ .unreg_target = em_i2c_unreg_target,
};

static int em_i2c_probe(struct platform_device *pdev)
--
2.43.0


2024-03-22 13:37:24

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 21/64] i2c: gpio: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-gpio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 4f1411b1a775..e0bd218e2f14 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -216,8 +216,8 @@ static int fops_lose_arbitration_set(void *data, u64 duration)

priv->scl_irq_data = duration;
/*
- * Interrupt on falling SCL. This ensures that the master under test has
- * really started the transfer. Interrupt on falling SDA did only
+ * Interrupt on falling SCL. This ensures that the controller under test
+ * has really started the transfer. Interrupt on falling SDA did only
* exercise 'bus busy' detection on some HW but not 'arbitration lost'.
* Note that the interrupt latency may cause the first bits to be
* transmitted correctly.
@@ -245,8 +245,8 @@ static int fops_inject_panic_set(void *data, u64 duration)

priv->scl_irq_data = duration;
/*
- * Interrupt on falling SCL. This ensures that the master under test has
- * really started the transfer.
+ * Interrupt on falling SCL. This ensures that the controller under test
+ * has really started the transfer.
*/
return i2c_gpio_fi_act_on_scl_irq(priv, inject_panic_irq);
}
--
2.43.0


2024-03-22 13:37:25

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 44/64] i2c: qup: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-qup.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 598102d16677..2aeb5c33a711 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -380,7 +380,7 @@ static int qup_i2c_poll_state_mask(struct qup_i2c_dev *qup,
u32 state;

/*
- * State transition takes 3 AHB clocks cycles + 3 I2C master clock
+ * State transition takes 3 AHB clocks cycles + 3 I2C host clock
* cycles. So retry once after a 1uS delay.
*/
do {
@@ -1607,12 +1607,12 @@ static u32 qup_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm qup_i2c_algo = {
- .master_xfer = qup_i2c_xfer,
+ .xfer = qup_i2c_xfer,
.functionality = qup_i2c_func,
};

static const struct i2c_algorithm qup_i2c_algo_v2 = {
- .master_xfer = qup_i2c_xfer_v2,
+ .xfer = qup_i2c_xfer_v2,
.functionality = qup_i2c_func,
};

--
2.43.0


2024-03-22 13:37:44

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 43/64] i2c: pxa-pci: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-pxa-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
index 08b3229c443d..6b3c6a733368 100644
--- a/drivers/i2c/busses/i2c-pxa-pci.c
+++ b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -4,7 +4,7 @@
* Author: Sebastian Andrzej Siewior <[email protected]>
*
* The CE4100's I2C device is more or less the same one as found on PXA.
- * It does not support slave mode, the register slightly moved. This PCI
+ * It does not support target mode, the register slightly moved. This PCI
* device provides three bars, every contains a single I2C controller.
*/
#include <linux/init.h>
--
2.43.0


2024-03-22 13:37:50

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 45/64] i2c: rcar: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-rcar.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 828aa2ea0fe4..4be75fdc7187 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -883,7 +883,7 @@ static int rcar_i2c_do_reset(struct rcar_i2c_priv *priv)
100, false, priv->rstc);
}

-static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
+static int rcar_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs,
int num)
{
@@ -944,7 +944,7 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
return ret;
}

-static int rcar_i2c_master_xfer_atomic(struct i2c_adapter *adap,
+static int rcar_i2c_xfer_atomic(struct i2c_adapter *adap,
struct i2c_msg *msgs,
int num)
{
@@ -1003,7 +1003,7 @@ static int rcar_i2c_master_xfer_atomic(struct i2c_adapter *adap,
return ret;
}

-static int rcar_reg_slave(struct i2c_client *slave)
+static int rcar_reg_target(struct i2c_client *slave)
{
struct rcar_i2c_priv *priv = i2c_get_adapdata(slave->adapter);

@@ -1025,7 +1025,7 @@ static int rcar_reg_slave(struct i2c_client *slave)
return 0;
}

-static int rcar_unreg_slave(struct i2c_client *slave)
+static int rcar_unreg_target(struct i2c_client *slave)
{
struct rcar_i2c_priv *priv = i2c_get_adapdata(slave->adapter);

@@ -1066,11 +1066,11 @@ static u32 rcar_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm rcar_i2c_algo = {
- .master_xfer = rcar_i2c_master_xfer,
- .master_xfer_atomic = rcar_i2c_master_xfer_atomic,
+ .xfer = rcar_i2c_xfer,
+ .xfer_atomic = rcar_i2c_xfer_atomic,
.functionality = rcar_i2c_func,
- .reg_slave = rcar_reg_slave,
- .unreg_slave = rcar_unreg_slave,
+ .reg_target = rcar_reg_target,
+ .unreg_target = rcar_unreg_target,
};

static const struct i2c_adapter_quirks rcar_i2c_quirks = {
--
2.43.0


2024-03-22 13:38:02

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 46/64] i2c: riic: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-riic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
index e43ff483c56e..685a65153fa8 100644
--- a/drivers/i2c/busses/i2c-riic.c
+++ b/drivers/i2c/busses/i2c-riic.c
@@ -12,9 +12,9 @@
*
* 1) The main xfer routine kicks off a transmission by putting the start bit
* (or repeated start) on the bus and enabling the transmit interrupt (TIE)
- * since we need to send the slave address + RW bit in every case.
+ * since we need to send the client address + RW bit in every case.
*
- * 2) TIE sends slave address + RW bit and selects how to continue.
+ * 2) TIE sends client address + RW bit and selects how to continue.
*
* 3a) Write case: We keep utilizing TIE as long as we have data to send. If we
* are done, we switch over to the transmission done interrupt (TEIE) and mark
@@ -276,7 +276,7 @@ static u32 riic_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm riic_algo = {
- .master_xfer = riic_xfer,
+ .xfer = riic_xfer,
.functionality = riic_func,
};

--
2.43.0


2024-03-22 13:38:13

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 47/64] i2c: rk3x: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:38:24

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 48/64] i2c: sh7760: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-sh7760.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c
index 8a043f5fca1e..49e83ca89101 100644
--- a/drivers/i2c/busses/i2c-sh7760.c
+++ b/drivers/i2c/busses/i2c-sh7760.c
@@ -55,7 +55,7 @@
#define MSR_MDE 0x08
#define MSR_MDT 0x04
#define MSR_MDR 0x02
-#define MSR_MAT 0x01 /* slave addr xfer done */
+#define MSR_MAT 0x01 /* addr xfer done */

#define MIE_MNRE 0x40 /* nack irq en */
#define MIE_MALE 0x20 /* arblos irq en */
@@ -154,7 +154,7 @@ static irqreturn_t sh7760_i2c_irq(int irq, void *ptr)
goto out;
}

- /* i2c slave addr was sent; set to "normal" operation */
+ /* i2c client addr was sent; set to "normal" operation */
if (msr & MSR_MAT)
OUT32(id, I2CMCR, MCR_MIE);

@@ -236,14 +236,14 @@ static irqreturn_t sh7760_i2c_irq(int irq, void *ptr)
}


-/* prepare and start a master receive operation */
+/* prepare and start a host receive operation */
static void sh7760_i2c_mrecv(struct cami2c *id)
{
int len;

id->flags |= IDF_RECV;

- /* set the slave addr reg; otherwise rcv wont work! */
+ /* set the target addr reg; otherwise rcv won't work! */
OUT32(id, I2CSAR, 0xfe);
OUT32(id, I2CMAR, (id->msg->addr << 1) | 1);

@@ -262,14 +262,14 @@ static void sh7760_i2c_mrecv(struct cami2c *id)
OUT32(id, I2CFIER, FIER_RXIE);
}

-/* prepare and start a master send operation */
+/* prepare and start a host send operation */
static void sh7760_i2c_msend(struct cami2c *id)
{
int len;

id->flags |= IDF_SEND;

- /* set the slave addr reg; otherwise xmit wont work! */
+ /* set the target addr reg; otherwise xmit won't work! */
OUT32(id, I2CSAR, 0xfe);
OUT32(id, I2CMAR, (id->msg->addr << 1) | 0);

@@ -300,7 +300,7 @@ static inline int sh7760_i2c_busy_check(struct cami2c *id)
return (IN32(id, I2CMCR) & MCR_FSDA);
}

-static int sh7760_i2c_master_xfer(struct i2c_adapter *adap,
+static int sh7760_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs,
int num)
{
@@ -362,7 +362,7 @@ static int sh7760_i2c_master_xfer(struct i2c_adapter *adap,
OUT32(id, I2CMIER, 0);
OUT32(id, I2CFIER, 0);

- /* reset slave module registers too: master mode enables slave
+ /* reset target module registers too: host mode enables target
* module for receive ops (ack, data). Without this reset,
* eternal bus activity might be reported after NACK / ARBLOST.
*/
@@ -379,7 +379,7 @@ static u32 sh7760_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm sh7760_i2c_algo = {
- .master_xfer = sh7760_i2c_master_xfer,
+ .xfer = sh7760_i2c_xfer,
.functionality = sh7760_i2c_func,
};

--
2.43.0


2024-03-22 13:38:29

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 22/64] i2c: highlander: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-highlander.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
index 7922bc917c33..ec3546a5178b 100644
--- a/drivers/i2c/busses/i2c-highlander.c
+++ b/drivers/i2c/busses/i2c-highlander.c
@@ -331,7 +331,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
/* Ensure we're in a sane state */
highlander_i2c_done(dev);

- /* Set slave address */
+ /* Set client address */
iowrite16((addr << 1) | read_write, dev->base + SMSMADR);

highlander_i2c_command(dev, command, dev->buf_len);
--
2.43.0


2024-03-22 13:38:33

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 50/64] i2c: sis5595: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-sis5595.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sis5595.c b/drivers/i2c/busses/i2c-sis5595.c
index 32476dc10ad6..198ba39a2651 100644
--- a/drivers/i2c/busses/i2c-sis5595.c
+++ b/drivers/i2c/busses/i2c-sis5595.c
@@ -257,7 +257,7 @@ static int sis5595_transaction(struct i2c_adapter *adap)
if (temp & 0x20) {
dev_err(&adap->dev, "Bus collision! SMBus may be locked until "
"next hard reset (or not...)\n");
- /* Clock stops and slave is stuck in mid-transmission */
+ /* Clock stops and client is stuck in mid-transmission */
result = -EIO;
}

--
2.43.0


2024-03-22 13:38:46

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 51/64] i2c: sis630: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-sis630.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sis630.c b/drivers/i2c/busses/i2c-sis630.c
index 3505cf29cedd..7910ba2fce15 100644
--- a/drivers/i2c/busses/i2c-sis630.c
+++ b/drivers/i2c/busses/i2c-sis630.c
@@ -18,7 +18,7 @@
+------------------------+--------------------+-------------------+
| Clock | 14kHz/56kHz | 55.56kHz/27.78kHz |
| SMBus registers offset | 0x80 | 0xE0 |
- | SMB_CNT | Bit 1 = Slave Busy | Bit 1 = Bus probe |
+ | SMB_CNT | Bit 1 = Client Busy| Bit 1 = Bus probe |
| (not used yet) | Bit 3 is reserved | Bit 3 = Last byte |
| SMB_PCOUNT | Offset + 0x06 | Offset + 0x14 |
| SMB_COUNT | 4:0 bits | 5:0 bits |
@@ -56,8 +56,8 @@

/* SMB_CNT register */
#define MSTO_EN 0x40 /* Host Master Timeout Enable */
-#define SMBCLK_SEL 0x20 /* Host master clock selection */
-#define SMB_PROBE 0x02 /* Bus Probe/Slave busy */
+#define SMBCLK_SEL 0x20 /* Host clock selection */
+#define SMB_PROBE 0x02 /* Bus Probe/Client busy */
#define SMB_HOSTBUSY 0x01 /* Host Busy */

/* SMBHOST_CNT register */
@@ -93,7 +93,7 @@ static bool high_clock;
static bool force;
module_param(high_clock, bool, 0);
MODULE_PARM_DESC(high_clock,
- "Set Host Master Clock to 56KHz (default 14KHz) (SIS630/730 only).");
+ "Set Host Clock to 56KHz (default 14KHz) (SIS630/730 only).");
module_param(force, bool, 0);
MODULE_PARM_DESC(force, "Forcibly enable the SIS630. DANGEROUS!");

@@ -144,8 +144,7 @@ static int sis630_transaction_start(struct i2c_adapter *adap, int size,

dev_dbg(&adap->dev, "saved clock 0x%02x\n", *oldclock);

- /* disable timeout interrupt,
- * set Host Master Clock to 56KHz if requested */
+ /* disable timeout interrupt, set Host Clock to 56KHz if requested */
if (high_clock)
sis630_write(SMB_CNT, SMBCLK_SEL);
else
@@ -201,10 +200,7 @@ static void sis630_transaction_end(struct i2c_adapter *adap, u8 oldclock)
dev_dbg(&adap->dev,
"SMB_CNT before clock restore 0x%02x\n", sis630_read(SMB_CNT));

- /*
- * restore old Host Master Clock if high_clock is set
- * and oldclock was not 56KHz
- */
+ /* restore old Host Clock if high_clock is set and oldclock was not 56KHz */
if (high_clock && !(oldclock & SMBCLK_SEL))
sis630_write(SMB_CNT, sis630_read(SMB_CNT) & ~SMBCLK_SEL);

--
2.43.0


2024-03-22 13:38:47

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 49/64] i2c: sh_mobile: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-sh_mobile.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index c65ac3d7eadc..276a036d8ef0 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -53,7 +53,7 @@
/* */
/* Receive operation: */
/* */
-/* 0 byte receive - not supported since slave may hold SDA low */
+/* 0 byte receive - not supported since client may hold SDA low */
/* */
/* 1 byte receive [TX] | [RX] */
/* BUS: S A8 ACK | D8(1) ACK P(*) */
@@ -93,7 +93,7 @@
/* _______________________________________________ */
/* BUSY __/ \_ */
/* */
-/* (*) The STOP condition is only sent by the master at the end of the last */
+/* (*) The STOP condition is only sent by the host at the end of the last */
/* I2C message or if the I2C_M_STOP flag is set. Similarly, the BUSY bit is */
/* only cleared after the STOP condition, so, between messages we have to */
/* poll for the DTE bit. */
@@ -495,7 +495,7 @@ static struct dma_chan *sh_mobile_i2c_request_dma_chan(struct device *dev,

ret = dmaengine_slave_config(chan, &cfg);
if (ret) {
- dev_dbg(dev, "slave_config failed for %s (%d)\n", chan_name, ret);
+ dev_dbg(dev, "DMA config failed for %s (%d)\n", chan_name, ret);
dma_release_channel(chan);
return ERR_PTR(ret);
}
@@ -540,7 +540,7 @@ static void sh_mobile_i2c_xfer_dma(struct sh_mobile_i2c_data *pd)
read ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!txdesc) {
- dev_dbg(pd->dev, "dma prep slave sg failed, using PIO\n");
+ dev_dbg(pd->dev, "dma prep sg failed, using PIO\n");
sh_mobile_i2c_cleanup_dma(pd, false);
return;
}
@@ -740,8 +740,8 @@ static u32 sh_mobile_i2c_func(struct i2c_adapter *adapter)

static const struct i2c_algorithm sh_mobile_i2c_algorithm = {
.functionality = sh_mobile_i2c_func,
- .master_xfer = sh_mobile_i2c_xfer,
- .master_xfer_atomic = sh_mobile_i2c_xfer_atomic,
+ .xfer = sh_mobile_i2c_xfer,
+ .xfer_atomic = sh_mobile_i2c_xfer_atomic,
};

static const struct i2c_adapter_quirks sh_mobile_i2c_quirks = {
--
2.43.0


2024-03-22 13:38:53

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 52/64] i2c: sprd: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-sprd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c
index 28c88901d9bc..f1a8375ccc17 100644
--- a/drivers/i2c/busses/i2c-sprd.c
+++ b/drivers/i2c/busses/i2c-sprd.c
@@ -283,7 +283,7 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap,
return i2c_dev->err;
}

-static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap,
+static int sprd_i2c_xfer(struct i2c_adapter *i2c_adap,
struct i2c_msg *msgs, int num)
{
struct sprd_i2c *i2c_dev = i2c_adap->algo_data;
@@ -314,7 +314,7 @@ static u32 sprd_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm sprd_i2c_algo = {
- .master_xfer = sprd_i2c_master_xfer,
+ .xfer = sprd_i2c_xfer,
.functionality = sprd_i2c_func,
};

@@ -378,12 +378,12 @@ static irqreturn_t sprd_i2c_isr_thread(int irq, void *dev_id)
i2c_tran = i2c_dev->count;

/*
- * If we got one ACK from slave when writing data, and we did not
+ * If we got one ACK from client when writing data, and we did not
* finish this transmission (i2c_tran is not zero), then we should
* continue to write data.
*
* For reading data, ack is always true, if i2c_tran is not 0 which
- * means we still need to contine to read data from slave.
+ * means we still need to contine to read data from client.
*/
if (i2c_tran && ack) {
sprd_i2c_data_transfer(i2c_dev);
@@ -393,7 +393,7 @@ static irqreturn_t sprd_i2c_isr_thread(int irq, void *dev_id)
i2c_dev->err = 0;

/*
- * If we did not get one ACK from slave when writing data, we should
+ * If we did not get one ACK from client when writing data, we should
* return -EIO to notify users.
*/
if (!ack)
@@ -422,7 +422,7 @@ static irqreturn_t sprd_i2c_isr(int irq, void *dev_id)
i2c_tran = i2c_dev->count;

/*
- * If we did not get one ACK from slave when writing data, then we
+ * If we did not get one ACK from client when writing data, then we
* should finish this transmission since we got some errors.
*
* When writing data, if i2c_tran == 0 which means we have writen
@@ -653,5 +653,5 @@ static struct platform_driver sprd_i2c_driver = {

module_platform_driver(sprd_i2c_driver);

-MODULE_DESCRIPTION("Spreadtrum I2C master controller driver");
+MODULE_DESCRIPTION("Spreadtrum I2C host controller driver");
MODULE_LICENSE("GPL v2");
--
2.43.0


2024-03-22 13:39:11

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 53/64] i2c: st: reword according to newest specification

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 <[email protected]>
---
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 <[email protected]>
*/
@@ -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


2024-03-22 13:39:38

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 55/64] i2c: sun6i-p2wi: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:40:03

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 59/64] i2c: uniphier-f: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:40:14

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 60/64] i2c: uniphier: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:40:25

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 61/64] i2c: viperboard: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-viperboard.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-viperboard.c b/drivers/i2c/busses/i2c-viperboard.c
index 9e153b5b0e8e..810424bc7a04 100644
--- a/drivers/i2c/busses/i2c-viperboard.c
+++ b/drivers/i2c/busses/i2c-viperboard.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
- * Nano River Technologies viperboard i2c master driver
+ * Nano River Technologies viperboard i2c controller driver
*
* (C) 2012 by Lemonage GmbH
* Author: Lars Poeschel <[email protected]>
@@ -273,8 +273,6 @@ static int vprbrd_i2c_xfer(struct i2c_adapter *i2c, struct i2c_msg *msgs,
(struct vprbrd_i2c_addr_msg *)vb->buf;
struct vprbrd_i2c_status *smsg = (struct vprbrd_i2c_status *)vb->buf;

- dev_dbg(&i2c->dev, "master xfer %d messages:\n", num);
-
for (i = 0 ; i < num ; i++) {
pmsg = &msgs[i];

@@ -345,7 +343,7 @@ static u32 vprbrd_i2c_func(struct i2c_adapter *i2c)

/* This is the actual algorithm we define */
static const struct i2c_algorithm vprbrd_algorithm = {
- .master_xfer = vprbrd_i2c_xfer,
+ .xfer = vprbrd_i2c_xfer,
.functionality = vprbrd_i2c_func,
};

@@ -461,6 +459,6 @@ static void __exit vprbrd_i2c_exit(void)
module_exit(vprbrd_i2c_exit);

MODULE_AUTHOR("Lars Poeschel <[email protected]>");
-MODULE_DESCRIPTION("I2C master driver for Nano River Techs Viperboard");
+MODULE_DESCRIPTION("I2C controller driver for Nano River Techs Viperboard");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:viperboard-i2c");
--
2.43.0


2024-03-22 13:40:38

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 62/64] i2c: xlp9xx: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-xlp9xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index 08a59a920929..9a0a1c5f5c6f 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -336,7 +336,7 @@ static int xlp9xx_i2c_xfer_msg(struct xlp9xx_i2c_dev *priv, struct i2c_msg *msg,
xlp9xx_write_i2c_reg(priv, XLP9XX_I2C_MFIFOCTRL,
XLP9XX_I2C_MFIFOCTRL_RST);

- /* set slave addr */
+ /* set client addr */
xlp9xx_write_i2c_reg(priv, XLP9XX_I2C_SLAVEADDR,
(msg->addr << XLP9XX_I2C_SLAVEADDR_ADDR_SHIFT) |
(priv->msg_read ? XLP9XX_I2C_SLAVEADDR_RW : 0));
@@ -452,7 +452,7 @@ static u32 xlp9xx_i2c_functionality(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm xlp9xx_i2c_algo = {
- .master_xfer = xlp9xx_i2c_xfer,
+ .xfer = xlp9xx_i2c_xfer,
.functionality = xlp9xx_i2c_functionality,
};

--
2.43.0


2024-03-22 13:40:47

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 63/64] i2c: scx200_acb: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/scx200_acb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 3648382b885a..0d773210f9be 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -110,7 +110,7 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
goto error;
}
if (!(status & ACBST_MASTER)) {
- errmsg = "not master";
+ errmsg = "not host";
goto error;
}
if (status & ACBST_NEGACK) {
@@ -251,7 +251,7 @@ static void scx200_acb_reset(struct scx200_acb_iface *iface)
outb(0x70, ACBCTL2);
/* Polling mode */
outb(0, ACBCTL1);
- /* Disable slave address */
+ /* Disable target address */
outb(0, ACBADDR);
/* Enable the ACCESS.bus device */
outb(inb(ACBCTL2) | ACBCTL2_ENABLE, ACBCTL2);
--
2.43.0


2024-03-22 13:40:48

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 54/64] i2c: stm32f4: reword according to newest specification

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 <[email protected]>
---
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


2024-03-22 13:41:04

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 56/64] i2c: synquacer: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-synquacer.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
index bbea521b05dd..2fa528daaf5f 100644
--- a/drivers/i2c/busses/i2c-synquacer.c
+++ b/drivers/i2c/busses/i2c-synquacer.c
@@ -66,16 +66,16 @@
#define SYNQUACER_I2C_BUS_CLK_FR(rate) (((rate) / 20000000) + 1)

/* STANDARD MODE frequency */
-#define SYNQUACER_I2C_CLK_MASTER_STD(rate) \
+#define SYNQUACER_I2C_CLK__STD(rate) \
DIV_ROUND_UP(DIV_ROUND_UP((rate), I2C_MAX_STANDARD_MODE_FREQ) - 2, 2)
/* FAST MODE frequency */
-#define SYNQUACER_I2C_CLK_MASTER_FAST(rate) \
+#define SYNQUACER_I2C_CLK__FAST(rate) \
DIV_ROUND_UP((DIV_ROUND_UP((rate), I2C_MAX_FAST_MODE_FREQ) - 2) * 2, 3)

/* (clkrate <= 18000000) */
/* calculate the value of CS bits in CCR register on standard mode */
#define SYNQUACER_I2C_CCR_CS_STD_MAX_18M(rate) \
- ((SYNQUACER_I2C_CLK_MASTER_STD(rate) - 65) \
+ ((SYNQUACER_I2C_CLK__STD(rate) - 65) \
& SYNQUACER_I2C_CCR_CS_MASK)

/* calculate the value of CS bits in CSR register on standard mode */
@@ -83,7 +83,7 @@

/* calculate the value of CS bits in CCR register on fast mode */
#define SYNQUACER_I2C_CCR_CS_FAST_MAX_18M(rate) \
- ((SYNQUACER_I2C_CLK_MASTER_FAST(rate) - 1) \
+ ((SYNQUACER_I2C_CLK__FAST(rate) - 1) \
& SYNQUACER_I2C_CCR_CS_MASK)

/* calculate the value of CS bits in CSR register on fast mode */
@@ -92,22 +92,22 @@
/* (clkrate > 18000000) */
/* calculate the value of CS bits in CCR register on standard mode */
#define SYNQUACER_I2C_CCR_CS_STD_MIN_18M(rate) \
- ((SYNQUACER_I2C_CLK_MASTER_STD(rate) - 1) \
+ ((SYNQUACER_I2C_CLK__STD(rate) - 1) \
& SYNQUACER_I2C_CCR_CS_MASK)

/* calculate the value of CS bits in CSR register on standard mode */
#define SYNQUACER_I2C_CSR_CS_STD_MIN_18M(rate) \
- (((SYNQUACER_I2C_CLK_MASTER_STD(rate) - 1) >> 5) \
+ (((SYNQUACER_I2C_CLK__STD(rate) - 1) >> 5) \
& SYNQUACER_I2C_CSR_CS_MASK)

/* calculate the value of CS bits in CCR register on fast mode */
#define SYNQUACER_I2C_CCR_CS_FAST_MIN_18M(rate) \
- ((SYNQUACER_I2C_CLK_MASTER_FAST(rate) - 1) \
+ ((SYNQUACER_I2C_CLK__FAST(rate) - 1) \
& SYNQUACER_I2C_CCR_CS_MASK)

/* calculate the value of CS bits in CSR register on fast mode */
#define SYNQUACER_I2C_CSR_CS_FAST_MIN_18M(rate) \
- (((SYNQUACER_I2C_CLK_MASTER_FAST(rate) - 1) >> 5) \
+ (((SYNQUACER_I2C_CLK__FAST(rate) - 1) >> 5) \
& SYNQUACER_I2C_CSR_CS_MASK)

/* min I2C clock frequency 14M */
@@ -255,15 +255,13 @@ static void synquacer_i2c_hw_reset(struct synquacer_i2c *i2c)
WAIT_PCLK(100, i2c->pclkrate);
}

-static int synquacer_i2c_master_start(struct synquacer_i2c *i2c,
+static int synquacer_i2c_start(struct synquacer_i2c *i2c,
struct i2c_msg *pmsg)
{
unsigned char bsr, bcr;

writeb(i2c_8bit_addr_from_msg(pmsg), i2c->base + SYNQUACER_I2C_REG_DAR);

- dev_dbg(i2c->dev, "slave:0x%02x\n", pmsg->addr);
-
/* Generate Start Condition */
bsr = readb(i2c->base + SYNQUACER_I2C_REG_BSR);
bcr = readb(i2c->base + SYNQUACER_I2C_REG_BCR);
@@ -281,7 +279,7 @@ static int synquacer_i2c_master_start(struct synquacer_i2c *i2c,
i2c->base + SYNQUACER_I2C_REG_BCR);
} else {
if (bcr & SYNQUACER_I2C_BCR_MSS) {
- dev_dbg(i2c->dev, "not in master mode");
+ dev_dbg(i2c->dev, "not in host mode");
return -EAGAIN;
}
dev_dbg(i2c->dev, "Start Condition");
@@ -329,7 +327,7 @@ static int synquacer_i2c_doxfer(struct synquacer_i2c *i2c,
i2c->msg_idx = 0;
i2c->state = STATE_START;

- ret = synquacer_i2c_master_start(i2c, i2c->msg);
+ ret = synquacer_i2c_start(i2c, i2c->msg);
if (ret < 0) {
dev_dbg(i2c->dev, "Address failed: (%d)\n", ret);
return ret;
@@ -429,7 +427,7 @@ static irqreturn_t synquacer_i2c_isr(int irq, void *dev_id)
i2c->msg++;

/* send the new start */
- ret = synquacer_i2c_master_start(i2c, i2c->msg);
+ ret = synquacer_i2c_start(i2c, i2c->msg);
if (ret < 0) {
dev_dbg(i2c->dev, "restart error (%d)\n", ret);
synquacer_i2c_stop(i2c, -EAGAIN);
@@ -473,7 +471,7 @@ static irqreturn_t synquacer_i2c_isr(int irq, void *dev_id)
i2c->msg_idx++;
i2c->msg++;

- ret = synquacer_i2c_master_start(i2c, i2c->msg);
+ ret = synquacer_i2c_start(i2c, i2c->msg);
if (ret < 0) {
dev_dbg(i2c->dev, "restart error (%d)\n", ret);
synquacer_i2c_stop(i2c, -EAGAIN);
@@ -521,7 +519,7 @@ static u32 synquacer_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm synquacer_i2c_algo = {
- .master_xfer = synquacer_i2c_xfer,
+ .xfer = synquacer_i2c_xfer,
.functionality = synquacer_i2c_functionality,
};

--
2.43.0


2024-03-22 13:41:15

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 57/64] i2c: taos-evm: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-taos-evm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-taos-evm.c b/drivers/i2c/busses/i2c-taos-evm.c
index b0f0120793e1..cb97f72291bc 100644
--- a/drivers/i2c/busses/i2c-taos-evm.c
+++ b/drivers/i2c/busses/i2c-taos-evm.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Driver for the TAOS evaluation modules
- * These devices include an I2C master which can be controlled over the
+ * These devices include an I2C controller which can be controlled over the
* serial port.
*
* Copyright (C) 2007 Jean Delvare <[email protected]>
--
2.43.0


2024-03-22 13:41:18

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 58/64] i2c: tiny-usb: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-tiny-usb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index 1bffe36c40ad..da06d1be0a2b 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -54,8 +54,6 @@ static int usb_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
struct i2c_msg *pmsg;
int i, ret;

- dev_dbg(&adapter->dev, "master xfer %d messages:\n", num);
-
pstatus = kmalloc(sizeof(*pstatus), GFP_KERNEL);
if (!pstatus)
return -ENOMEM;
@@ -142,7 +140,7 @@ static u32 usb_func(struct i2c_adapter *adapter)

/* This is the actual algorithm we define */
static const struct i2c_algorithm usb_algorithm = {
- .master_xfer = usb_xfer,
+ .xfer = usb_xfer,
.functionality = usb_func,
};

--
2.43.0


2024-03-22 13:41:20

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

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.

Signed-off-by: Wolfram Sang <[email protected]>
---
drivers/i2c/busses/i2c-amd-mp2-plat.c | 2 +-
drivers/i2c/busses/i2c-at91-master.c | 2 +-
drivers/i2c/busses/i2c-at91-slave.c | 8 ++++----
drivers/i2c/busses/i2c-axxia.c | 10 +++++-----
drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +-
drivers/i2c/busses/i2c-designware-master.c | 2 +-
drivers/i2c/busses/i2c-designware-slave.c | 8 ++++----
drivers/i2c/busses/i2c-diolan-u2c.c | 2 +-
drivers/i2c/busses/i2c-exynos5.c | 4 ++--
drivers/i2c/busses/i2c-gxp.c | 12 ++++++------
drivers/i2c/busses/i2c-hisi.c | 4 ++--
drivers/i2c/busses/i2c-img-scb.c | 2 +-
drivers/i2c/busses/i2c-imx.c | 12 ++++++------
drivers/i2c/busses/i2c-jz4780.c | 2 +-
drivers/i2c/busses/i2c-kempld.c | 2 +-
drivers/i2c/busses/i2c-meson.c | 4 ++--
drivers/i2c/busses/i2c-mlxbf.c | 8 ++++----
drivers/i2c/busses/i2c-mt65xx.c | 2 +-
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-platdrv.c | 2 +-
drivers/i2c/busses/i2c-omap.c | 4 ++--
drivers/i2c/busses/i2c-opal.c | 4 ++--
drivers/i2c/busses/i2c-pasemi-core.c | 2 +-
drivers/i2c/busses/i2c-pnx.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-robotfuzz-osif.c | 2 +-
drivers/i2c/busses/i2c-rzv2m.c | 8 ++++----
drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
drivers/i2c/busses/i2c-stm32f7.c | 14 +++++++-------
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-virtio.c | 2 +-
drivers/i2c/busses/i2c-wmt.c | 2 +-
drivers/i2c/busses/i2c-xiic.c | 2 +-
41 files changed, 95 insertions(+), 95 deletions(-)

diff --git a/drivers/i2c/busses/i2c-amd-mp2-plat.c b/drivers/i2c/busses/i2c-amd-mp2-plat.c
index 112fe2bc5662..eb47de29ec90 100644
--- a/drivers/i2c/busses/i2c-amd-mp2-plat.c
+++ b/drivers/i2c/busses/i2c-amd-mp2-plat.c
@@ -179,7 +179,7 @@ static u32 i2c_amd_func(struct i2c_adapter *a)
}

static const struct i2c_algorithm i2c_amd_algorithm = {
- .master_xfer = i2c_amd_xfer,
+ .xfer = i2c_amd_xfer,
.functionality = i2c_amd_func,
};

diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
index d311981d3e60..56223eee7755 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -739,7 +739,7 @@ static u32 at91_twi_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm at91_twi_algorithm = {
- .master_xfer = at91_twi_xfer,
+ .xfer = at91_twi_xfer,
.functionality = at91_twi_func,
};

diff --git a/drivers/i2c/busses/i2c-at91-slave.c b/drivers/i2c/busses/i2c-at91-slave.c
index d6eeea5166c0..00234bf776ab 100644
--- a/drivers/i2c/busses/i2c-at91-slave.c
+++ b/drivers/i2c/busses/i2c-at91-slave.c
@@ -62,7 +62,7 @@ static irqreturn_t atmel_twi_interrupt_slave(int irq, void *dev_id)
return IRQ_HANDLED;
}

-static int at91_reg_slave(struct i2c_client *slave)
+static int at91_reg_target(struct i2c_client *slave)
{
struct at91_twi_dev *dev = i2c_get_adapdata(slave->adapter);

@@ -86,7 +86,7 @@ static int at91_reg_slave(struct i2c_client *slave)
return 0;
}

-static int at91_unreg_slave(struct i2c_client *slave)
+static int at91_unreg_target(struct i2c_client *slave)
{
struct at91_twi_dev *dev = i2c_get_adapdata(slave->adapter);

@@ -111,8 +111,8 @@ static u32 at91_twi_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm at91_twi_algorithm_slave = {
- .reg_slave = at91_reg_slave,
- .unreg_slave = at91_unreg_slave,
+ .reg_target = at91_reg_target,
+ .unreg_target = at91_unreg_target,
.functionality = at91_twi_func,
};

diff --git a/drivers/i2c/busses/i2c-axxia.c b/drivers/i2c/busses/i2c-axxia.c
index a66f7f67b3b8..19545a44dbc9 100644
--- a/drivers/i2c/busses/i2c-axxia.c
+++ b/drivers/i2c/busses/i2c-axxia.c
@@ -673,7 +673,7 @@ static u32 axxia_i2c_func(struct i2c_adapter *adap)
return caps;
}

-static int axxia_i2c_reg_slave(struct i2c_client *slave)
+static int axxia_i2c_reg_target(struct i2c_client *slave)
{
struct axxia_i2c_dev *idev = i2c_get_adapdata(slave->adapter);
u32 slv_int_mask = SLV_STATUS_RFH;
@@ -705,7 +705,7 @@ static int axxia_i2c_reg_slave(struct i2c_client *slave)
return 0;
}

-static int axxia_i2c_unreg_slave(struct i2c_client *slave)
+static int axxia_i2c_unreg_target(struct i2c_client *slave)
{
struct axxia_i2c_dev *idev = i2c_get_adapdata(slave->adapter);

@@ -721,10 +721,10 @@ static int axxia_i2c_unreg_slave(struct i2c_client *slave)
}

static const struct i2c_algorithm axxia_i2c_algo = {
- .master_xfer = axxia_i2c_xfer,
+ .xfer = axxia_i2c_xfer,
.functionality = axxia_i2c_func,
- .reg_slave = axxia_i2c_reg_slave,
- .unreg_slave = axxia_i2c_unreg_slave,
+ .reg_target = axxia_i2c_reg_target,
+ .unreg_target = axxia_i2c_unreg_target,
};

static const struct i2c_adapter_quirks axxia_i2c_quirks = {
diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index 2737fd8abd32..4cd6a364aa3b 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -235,7 +235,7 @@ static u32 ec_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm ec_i2c_algorithm = {
- .master_xfer = ec_i2c_xfer,
+ .xfer = ec_i2c_xfer,
.functionality = ec_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
index c7e56002809a..14c61b31f877 100644
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -832,7 +832,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
}

static const struct i2c_algorithm i2c_dw_algo = {
- .master_xfer = i2c_dw_xfer,
+ .xfer = i2c_dw_xfer,
.functionality = i2c_dw_func,
};

diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c
index 2e079cf20bb5..b47ad6b16814 100644
--- a/drivers/i2c/busses/i2c-designware-slave.c
+++ b/drivers/i2c/busses/i2c-designware-slave.c
@@ -58,7 +58,7 @@ static int i2c_dw_init_slave(struct dw_i2c_dev *dev)
return 0;
}

-static int i2c_dw_reg_slave(struct i2c_client *slave)
+static int i2c_dw_reg_target(struct i2c_client *slave)
{
struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter);

@@ -83,7 +83,7 @@ static int i2c_dw_reg_slave(struct i2c_client *slave)
return 0;
}

-static int i2c_dw_unreg_slave(struct i2c_client *slave)
+static int i2c_dw_unreg_target(struct i2c_client *slave)
{
struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter);

@@ -214,8 +214,8 @@ static irqreturn_t i2c_dw_isr_slave(int this_irq, void *dev_id)

static const struct i2c_algorithm i2c_dw_algo = {
.functionality = i2c_dw_func,
- .reg_slave = i2c_dw_reg_slave,
- .unreg_slave = i2c_dw_unreg_slave,
+ .reg_target = i2c_dw_reg_target,
+ .unreg_target = i2c_dw_unreg_target,
};

void i2c_dw_configure_slave(struct dw_i2c_dev *dev)
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c
index b48b7888936f..c02459405b26 100644
--- a/drivers/i2c/busses/i2c-diolan-u2c.c
+++ b/drivers/i2c/busses/i2c-diolan-u2c.c
@@ -414,7 +414,7 @@ static u32 diolan_usb_func(struct i2c_adapter *a)
}

static const struct i2c_algorithm diolan_usb_algorithm = {
- .master_xfer = diolan_usb_xfer,
+ .xfer = diolan_usb_xfer,
.functionality = diolan_usb_func,
};

diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c
index 385ef9d9e4d4..eda5f06b158d 100644
--- a/drivers/i2c/busses/i2c-exynos5.c
+++ b/drivers/i2c/busses/i2c-exynos5.c
@@ -852,8 +852,8 @@ static u32 exynos5_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm exynos5_i2c_algorithm = {
- .master_xfer = exynos5_i2c_xfer,
- .master_xfer_atomic = exynos5_i2c_xfer_atomic,
+ .xfer = exynos5_i2c_xfer,
+ .xfer_atomic = exynos5_i2c_xfer_atomic,
.functionality = exynos5_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-gxp.c b/drivers/i2c/busses/i2c-gxp.c
index efafc0528c44..9cd29c096fe4 100644
--- a/drivers/i2c/busses/i2c-gxp.c
+++ b/drivers/i2c/busses/i2c-gxp.c
@@ -110,7 +110,7 @@ static void gxp_i2c_start(struct gxp_i2c_drvdata *drvdata)
writew(value, drvdata->base + GXP_I2CMCMD);
}

-static int gxp_i2c_master_xfer(struct i2c_adapter *adapter,
+static int gxp_i2c_xfer(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num)
{
int ret;
@@ -148,7 +148,7 @@ static u32 gxp_i2c_func(struct i2c_adapter *adap)
}

#if IS_ENABLED(CONFIG_I2C_SLAVE)
-static int gxp_i2c_reg_slave(struct i2c_client *slave)
+static int gxp_i2c_reg_target(struct i2c_client *slave)
{
struct gxp_i2c_drvdata *drvdata = i2c_get_adapdata(slave->adapter);

@@ -167,7 +167,7 @@ static int gxp_i2c_reg_slave(struct i2c_client *slave)
return 0;
}

-static int gxp_i2c_unreg_slave(struct i2c_client *slave)
+static int gxp_i2c_unreg_target(struct i2c_client *slave)
{
struct gxp_i2c_drvdata *drvdata = i2c_get_adapdata(slave->adapter);

@@ -184,11 +184,11 @@ static int gxp_i2c_unreg_slave(struct i2c_client *slave)
#endif

static const struct i2c_algorithm gxp_i2c_algo = {
- .master_xfer = gxp_i2c_master_xfer,
+ .xfer = gxp_i2c_xfer,
.functionality = gxp_i2c_func,
#if IS_ENABLED(CONFIG_I2C_SLAVE)
- .reg_slave = gxp_i2c_reg_slave,
- .unreg_slave = gxp_i2c_unreg_slave,
+ .reg_target = gxp_i2c_reg_target,
+ .unreg_target = gxp_i2c_unreg_target,
#endif
};

diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c
index 975c0b1c44de..26072cef8e6e 100644
--- a/drivers/i2c/busses/i2c-hisi.c
+++ b/drivers/i2c/busses/i2c-hisi.c
@@ -197,7 +197,7 @@ static void hisi_i2c_reset_xfer(struct hisi_i2c_controller *ctlr)
* wait for the transfer done. The major transfer process is performed
* in the IRQ handler.
*/
-static int hisi_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+static int hisi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{
struct hisi_i2c_controller *ctlr = i2c_get_adapdata(adap);
@@ -236,7 +236,7 @@ static u32 hisi_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm hisi_i2c_algo = {
- .master_xfer = hisi_i2c_master_xfer,
+ .xfer = hisi_i2c_xfer,
.functionality = hisi_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
index f9d4bfef511c..89833330ec25 100644
--- a/drivers/i2c/busses/i2c-img-scb.c
+++ b/drivers/i2c/busses/i2c-img-scb.c
@@ -1146,7 +1146,7 @@ static u32 img_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm img_i2c_algo = {
- .master_xfer = img_i2c_xfer,
+ .xfer = img_i2c_xfer,
.functionality = img_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 3842e527116b..3609d9889304 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -857,7 +857,7 @@ static void i2c_imx_slave_init(struct imx_i2c_struct *i2c_imx)
i2c_imx_enable_bus_idle(i2c_imx);
}

-static int i2c_imx_reg_slave(struct i2c_client *client)
+static int i2c_imx_reg_target(struct i2c_client *client)
{
struct imx_i2c_struct *i2c_imx = i2c_get_adapdata(client->adapter);
int ret;
@@ -880,7 +880,7 @@ static int i2c_imx_reg_slave(struct i2c_client *client)
return 0;
}

-static int i2c_imx_unreg_slave(struct i2c_client *client)
+static int i2c_imx_unreg_target(struct i2c_client *client)
{
struct imx_i2c_struct *i2c_imx = i2c_get_adapdata(client->adapter);
int ret;
@@ -1386,11 +1386,11 @@ static u32 i2c_imx_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm i2c_imx_algo = {
- .master_xfer = i2c_imx_xfer,
- .master_xfer_atomic = i2c_imx_xfer_atomic,
+ .xfer = i2c_imx_xfer,
+ .xfer_atomic = i2c_imx_xfer_atomic,
.functionality = i2c_imx_func,
- .reg_slave = i2c_imx_reg_slave,
- .unreg_slave = i2c_imx_unreg_slave,
+ .reg_target = i2c_imx_reg_target,
+ .unreg_target = i2c_imx_unreg_target,
};

static int i2c_imx_probe(struct platform_device *pdev)
diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index 55035cca0ae5..6d2c54982bca 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -730,7 +730,7 @@ static u32 jz4780_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm jz4780_i2c_algorithm = {
- .master_xfer = jz4780_i2c_xfer,
+ .xfer = jz4780_i2c_xfer,
.functionality = jz4780_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index c3a529a73b5b..4fd799740242 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -276,7 +276,7 @@ static u32 kempld_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm kempld_i2c_algorithm = {
- .master_xfer = kempld_i2c_xfer,
+ .xfer = kempld_i2c_xfer,
.functionality = kempld_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
index c7b203cc4434..f5505904aa23 100644
--- a/drivers/i2c/busses/i2c-meson.c
+++ b/drivers/i2c/busses/i2c-meson.c
@@ -448,8 +448,8 @@ static u32 meson_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm meson_i2c_algorithm = {
- .master_xfer = meson_i2c_xfer,
- .master_xfer_atomic = meson_i2c_xfer_atomic,
+ .xfer = meson_i2c_xfer,
+ .xfer_atomic = meson_i2c_xfer_atomic,
.functionality = meson_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index b3a73921ab69..cbf5e87ce6e8 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2152,7 +2152,7 @@ static s32 mlxbf_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
return mlxbf_i2c_smbus_start_transaction(priv, &request);
}

-static int mlxbf_i2c_reg_slave(struct i2c_client *slave)
+static int mlxbf_i2c_reg_target(struct i2c_client *slave)
{
struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter);
struct device *dev = &slave->dev;
@@ -2174,7 +2174,7 @@ static int mlxbf_i2c_reg_slave(struct i2c_client *slave)
return 0;
}

-static int mlxbf_i2c_unreg_slave(struct i2c_client *slave)
+static int mlxbf_i2c_unreg_target(struct i2c_client *slave)
{
struct mlxbf_i2c_priv *priv = i2c_get_adapdata(slave->adapter);
struct device *dev = &slave->dev;
@@ -2232,8 +2232,8 @@ static struct mlxbf_i2c_chip_info mlxbf_i2c_chip[] = {
static const struct i2c_algorithm mlxbf_i2c_algo = {
.smbus_xfer = mlxbf_i2c_smbus_xfer,
.functionality = mlxbf_i2c_functionality,
- .reg_slave = mlxbf_i2c_reg_slave,
- .unreg_slave = mlxbf_i2c_unreg_slave,
+ .reg_target = mlxbf_i2c_reg_target,
+ .unreg_target = mlxbf_i2c_unreg_target,
};

static struct i2c_adapter_quirks mlxbf_i2c_quirks = {
diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index a8b5719c3372..4c67f5f94f11 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -1345,7 +1345,7 @@ static u32 mtk_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm mtk_i2c_algorithm = {
- .master_xfer = mtk_i2c_transfer,
+ .xfer = mtk_i2c_transfer,
.functionality = mtk_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 36def0a9c95c..955d275676d1 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -687,7 +687,7 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id)
}

static const struct i2c_algorithm mxs_i2c_algo = {
- .master_xfer = mxs_i2c_xfer,
+ .xfer = mxs_i2c_xfer,
.functionality = mxs_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index b10574d42b7a..41cded3b017e 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -934,7 +934,7 @@ static unsigned int nmk_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm nmk_i2c_algo = {
- .master_xfer = nmk_i2c_xfer,
+ .xfer = nmk_i2c_xfer,
.functionality = nmk_i2c_functionality
};

diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
index 2fe68615942e..6259cd70939e 100644
--- a/drivers/i2c/busses/i2c-npcm7xx.c
+++ b/drivers/i2c/busses/i2c-npcm7xx.c
@@ -1257,7 +1257,7 @@ static irqreturn_t npcm_i2c_int_slave_handler(struct npcm_i2c *bus)
return IRQ_HANDLED;
}

-static int npcm_i2c_reg_slave(struct i2c_client *client)
+static int npcm_i2c_reg_target(struct i2c_client *client)
{
unsigned long lock_flags;
struct npcm_i2c *bus = i2c_get_adapdata(client->adapter);
@@ -1290,7 +1290,7 @@ static int npcm_i2c_reg_slave(struct i2c_client *client)
return 0;
}

-static int npcm_i2c_unreg_slave(struct i2c_client *client)
+static int npcm_i2c_unreg_target(struct i2c_client *client)
{
struct npcm_i2c *bus = client->adapter->algo_data;
unsigned long lock_flags;
@@ -2075,7 +2075,7 @@ static bool npcm_i2c_master_start_xmit(struct npcm_i2c *bus,
return true;
}

-static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+static int npcm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{
struct npcm_i2c *bus = container_of(adap, struct npcm_i2c, adap);
@@ -2238,11 +2238,11 @@ static const struct i2c_adapter_quirks npcm_i2c_quirks = {
};

static const struct i2c_algorithm npcm_i2c_algo = {
- .master_xfer = npcm_i2c_master_xfer,
+ .xfer = npcm_i2c_xfer,
.functionality = npcm_i2c_functionality,
#if IS_ENABLED(CONFIG_I2C_SLAVE)
- .reg_slave = npcm_i2c_reg_slave,
- .unreg_slave = npcm_i2c_unreg_slave,
+ .reg_target = npcm_i2c_reg_target,
+ .unreg_target = npcm_i2c_unreg_target,
#endif
};

diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c
index 26622d24bb1b..6d5329d6ddd8 100644
--- a/drivers/i2c/busses/i2c-nvidia-gpu.c
+++ b/drivers/i2c/busses/i2c-nvidia-gpu.c
@@ -163,7 +163,7 @@ static int gpu_i2c_write(struct gpu_i2c_dev *i2cd, u8 data)
return gpu_i2c_check_status(i2cd);
}

-static int gpu_i2c_master_xfer(struct i2c_adapter *adap,
+static int gpu_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num)
{
struct gpu_i2c_dev *i2cd = i2c_get_adapdata(adap);
@@ -234,7 +234,7 @@ static u32 gpu_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm gpu_i2c_algorithm = {
- .master_xfer = gpu_i2c_master_xfer,
+ .xfer = gpu_i2c_xfer,
.functionality = gpu_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c
index e106af83cef4..17551d33d5b0 100644
--- a/drivers/i2c/busses/i2c-ocores.c
+++ b/drivers/i2c/busses/i2c-ocores.c
@@ -455,8 +455,8 @@ static u32 ocores_func(struct i2c_adapter *adap)
}

static struct i2c_algorithm ocores_algorithm = {
- .master_xfer = ocores_xfer,
- .master_xfer_atomic = ocores_xfer_polling,
+ .xfer = ocores_xfer,
+ .xfer_atomic = ocores_xfer_polling,
.functionality = ocores_func,
};

@@ -689,13 +689,13 @@ static int ocores_i2c_probe(struct platform_device *pdev)
}

if (irq == -ENXIO) {
- ocores_algorithm.master_xfer = ocores_xfer_polling;
+ ocores_algorithm.xfer = ocores_xfer_polling;
} else {
if (irq < 0)
return irq;
}

- if (ocores_algorithm.master_xfer != ocores_xfer_polling) {
+ if (ocores_algorithm.xfer != ocores_xfer_polling) {
ret = devm_request_any_context_irq(&pdev->dev, irq,
ocores_isr, 0,
pdev->name, i2c);
diff --git a/drivers/i2c/busses/i2c-octeon-platdrv.c b/drivers/i2c/busses/i2c-octeon-platdrv.c
index 7d54b3203f71..dc6dff95c68c 100644
--- a/drivers/i2c/busses/i2c-octeon-platdrv.c
+++ b/drivers/i2c/busses/i2c-octeon-platdrv.c
@@ -122,7 +122,7 @@ static u32 octeon_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm octeon_i2c_algo = {
- .master_xfer = octeon_i2c_xfer,
+ .xfer = octeon_i2c_xfer,
.functionality = octeon_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 42165ef57946..3b9ae8e522e2 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1212,8 +1212,8 @@ omap_i2c_isr_thread(int this_irq, void *dev_id)
}

static const struct i2c_algorithm omap_i2c_algo = {
- .master_xfer = omap_i2c_xfer_irq,
- .master_xfer_atomic = omap_i2c_xfer_polling,
+ .xfer = omap_i2c_xfer_irq,
+ .xfer_atomic = omap_i2c_xfer_polling,
.functionality = omap_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
index 17ef87d50f7c..b6640d8e77af 100644
--- a/drivers/i2c/busses/i2c-opal.c
+++ b/drivers/i2c/busses/i2c-opal.c
@@ -70,7 +70,7 @@ static int i2c_opal_send_request(u32 bus_id, struct opal_i2c_request *req)
return rc;
}

-static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+static int i2c_opal_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{
unsigned long opal_id = (unsigned long)adap->algo_data;
@@ -179,7 +179,7 @@ static u32 i2c_opal_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm i2c_opal_algo = {
- .master_xfer = i2c_opal_master_xfer,
+ .xfer = i2c_opal_xfer,
.smbus_xfer = i2c_opal_smbus_xfer,
.functionality = i2c_opal_func,
};
diff --git a/drivers/i2c/busses/i2c-pasemi-core.c b/drivers/i2c/busses/i2c-pasemi-core.c
index bd8becbdeeb2..b07bf8286a47 100644
--- a/drivers/i2c/busses/i2c-pasemi-core.c
+++ b/drivers/i2c/busses/i2c-pasemi-core.c
@@ -336,7 +336,7 @@ static u32 pasemi_smb_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm smbus_algorithm = {
- .master_xfer = pasemi_i2c_xfer,
+ .xfer = pasemi_i2c_xfer,
.smbus_xfer = pasemi_smb_xfer,
.functionality = pasemi_smb_func,
};
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index a12525b3186b..e31ac2dbbd7b 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -609,7 +609,7 @@ static u32 i2c_pnx_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm pnx_algorithm = {
- .master_xfer = i2c_pnx_xfer,
+ .xfer = i2c_pnx_xfer,
.functionality = i2c_pnx_func,
};

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 76f79b68cef8..474abc4f5784 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1154,11 +1154,11 @@ static u32 i2c_pxa_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm i2c_pxa_algorithm = {
- .master_xfer = i2c_pxa_xfer,
+ .xfer = i2c_pxa_xfer,
.functionality = i2c_pxa_functionality,
#ifdef CONFIG_I2C_PXA_SLAVE
- .reg_slave = i2c_pxa_slave_reg,
- .unreg_slave = i2c_pxa_slave_unreg,
+ .reg_target = i2c_pxa_slave_reg,
+ .unreg_target = i2c_pxa_slave_unreg,
#endif
};

@@ -1244,11 +1244,11 @@ static int i2c_pxa_pio_xfer(struct i2c_adapter *adap,
}

static const struct i2c_algorithm i2c_pxa_pio_algorithm = {
- .master_xfer = i2c_pxa_pio_xfer,
+ .xfer = i2c_pxa_pio_xfer,
.functionality = i2c_pxa_functionality,
#ifdef CONFIG_I2C_PXA_SLAVE
- .reg_slave = i2c_pxa_slave_reg,
- .unreg_slave = i2c_pxa_slave_unreg,
+ .reg_target = i2c_pxa_slave_reg,
+ .unreg_target = i2c_pxa_slave_unreg,
#endif
};

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 414882c57d7f..d8d6d99dd4e7 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -463,7 +463,7 @@ static u32 cci_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm cci_algo = {
- .master_xfer = cci_xfer,
+ .xfer = cci_xfer,
.functionality = cci_func,
};

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index da94df466e83..337a80089f43 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -715,7 +715,7 @@ static u32 geni_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm geni_i2c_algo = {
- .master_xfer = geni_i2c_xfer,
+ .xfer = geni_i2c_xfer,
.functionality = geni_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-robotfuzz-osif.c b/drivers/i2c/busses/i2c-robotfuzz-osif.c
index 66dfa211e736..40985a38bec0 100644
--- a/drivers/i2c/busses/i2c-robotfuzz-osif.c
+++ b/drivers/i2c/busses/i2c-robotfuzz-osif.c
@@ -112,7 +112,7 @@ static u32 osif_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm osif_algorithm = {
- .master_xfer = osif_xfer,
+ .xfer = osif_xfer,
.functionality = osif_func,
};

diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c
index b0bfc96b9ede..60aa0a4e4247 100644
--- a/drivers/i2c/busses/i2c-rzv2m.c
+++ b/drivers/i2c/busses/i2c-rzv2m.c
@@ -321,7 +321,7 @@ static int rzv2m_i2c_stop_condition(struct rzv2m_i2c_priv *priv)
100, jiffies_to_usecs(priv->adap.timeout));
}

-static int rzv2m_i2c_master_xfer_msg(struct rzv2m_i2c_priv *priv,
+static int rzv2m_i2c_xfer_msg(struct rzv2m_i2c_priv *priv,
struct i2c_msg *msg, int stop)
{
unsigned int count = 0;
@@ -351,7 +351,7 @@ static int rzv2m_i2c_master_xfer_msg(struct rzv2m_i2c_priv *priv,
return ret;
}

-static int rzv2m_i2c_master_xfer(struct i2c_adapter *adap,
+static int rzv2m_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num)
{
struct rzv2m_i2c_priv *priv = i2c_get_adapdata(adap);
@@ -370,7 +370,7 @@ static int rzv2m_i2c_master_xfer(struct i2c_adapter *adap,

/* I2C main transfer */
for (i = 0; i < num; i++) {
- ret = rzv2m_i2c_master_xfer_msg(priv, &msgs[i], i == (num - 1));
+ ret = rzv2m_i2c_xfer_msg(priv, &msgs[i], i == (num - 1));
if (ret < 0)
goto out;
}
@@ -408,7 +408,7 @@ static const struct i2c_adapter_quirks rzv2m_i2c_quirks = {
};

static struct i2c_algorithm rzv2m_i2c_algo = {
- .master_xfer = rzv2m_i2c_master_xfer,
+ .xfer = rzv2m_i2c_xfer,
.functionality = rzv2m_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 275f7c42165c..29f5fef39b54 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -800,8 +800,8 @@ static u32 s3c24xx_i2c_func(struct i2c_adapter *adap)

/* i2c bus registration info */
static const struct i2c_algorithm s3c24xx_i2c_algorithm = {
- .master_xfer = s3c24xx_i2c_xfer,
- .master_xfer_atomic = s3c24xx_i2c_xfer_atomic,
+ .xfer = s3c24xx_i2c_xfer,
+ .xfer_atomic = s3c24xx_i2c_xfer_atomic,
.functionality = s3c24xx_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 01210452216b..6ecaafc700bc 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -1065,7 +1065,7 @@ static int stm32f7_i2c_smbus_xfer_msg(struct stm32f7_i2c_dev *i2c_dev,
f7_msg->read_write = I2C_SMBUS_READ;
break;
case I2C_SMBUS_I2C_BLOCK_DATA:
- /* Rely on emulated i2c transfer (through master_xfer) */
+ /* Rely on emulated i2c transfer (through xfer) */
return -EOPNOTSUPP;
default:
dev_err(dev, "Unsupported smbus protocol %d\n", f7_msg->size);
@@ -1888,7 +1888,7 @@ static void stm32f7_i2c_enable_wakeup(struct stm32f7_i2c_dev *i2c_dev,
}
}

-static int stm32f7_i2c_reg_slave(struct i2c_client *slave)
+static int stm32f7_i2c_reg_target(struct i2c_client *slave)
{
struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(slave->adapter);
void __iomem *base = i2c_dev->base;
@@ -1978,7 +1978,7 @@ static int stm32f7_i2c_reg_slave(struct i2c_client *slave)
return ret;
}

-static int stm32f7_i2c_unreg_slave(struct i2c_client *slave)
+static int stm32f7_i2c_unreg_target(struct i2c_client *slave)
{
struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(slave->adapter);
void __iomem *base = i2c_dev->base;
@@ -2151,12 +2151,12 @@ static u32 stm32f7_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm stm32f7_i2c_algo = {
- .master_xfer = stm32f7_i2c_xfer,
- .master_xfer_atomic = stm32f7_i2c_xfer_atomic,
+ .xfer = stm32f7_i2c_xfer,
+ .xfer_atomic = stm32f7_i2c_xfer_atomic,
.smbus_xfer = stm32f7_i2c_smbus_xfer,
.functionality = stm32f7_i2c_func,
- .reg_slave = stm32f7_i2c_reg_slave,
- .unreg_slave = stm32f7_i2c_unreg_slave,
+ .reg_target = stm32f7_i2c_reg_target,
+ .unreg_target = stm32f7_i2c_unreg_target,
};

static int stm32f7_i2c_probe(struct platform_device *pdev)
diff --git a/drivers/i2c/busses/i2c-tegra-bpmp.c b/drivers/i2c/busses/i2c-tegra-bpmp.c
index b0840fa0f53e..dabadbcc6d6a 100644
--- a/drivers/i2c/busses/i2c-tegra-bpmp.c
+++ b/drivers/i2c/busses/i2c-tegra-bpmp.c
@@ -275,8 +275,8 @@ static u32 tegra_bpmp_i2c_func(struct i2c_adapter *adapter)
}

static const struct i2c_algorithm tegra_bpmp_i2c_algo = {
- .master_xfer = tegra_bpmp_i2c_xfer,
- .master_xfer_atomic = tegra_bpmp_i2c_xfer_atomic,
+ .xfer = tegra_bpmp_i2c_xfer,
+ .xfer_atomic = tegra_bpmp_i2c_xfer_atomic,
.functionality = tegra_bpmp_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 920d5a8cbf4c..861b1c9e2627 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1437,8 +1437,8 @@ static u32 tegra_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm tegra_i2c_algo = {
- .master_xfer = tegra_i2c_xfer,
- .master_xfer_atomic = tegra_i2c_xfer_atomic,
+ .xfer = tegra_i2c_xfer,
+ .xfer_atomic = tegra_i2c_xfer_atomic,
.functionality = tegra_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
index a77cd86fe75e..de325c8e18f3 100644
--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c
+++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c
@@ -71,7 +71,7 @@ static u32 thunderx_i2c_functionality(struct i2c_adapter *adap)
}

static const struct i2c_algorithm thunderx_i2c_algo = {
- .master_xfer = octeon_i2c_xfer,
+ .xfer = octeon_i2c_xfer,
.functionality = thunderx_i2c_functionality,
};

diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c
index c60ae531ba57..52ba1e0845ca 100644
--- a/drivers/i2c/busses/i2c-virtio.c
+++ b/drivers/i2c/busses/i2c-virtio.c
@@ -183,7 +183,7 @@ static u32 virtio_i2c_func(struct i2c_adapter *adap)
}

static struct i2c_algorithm virtio_algorithm = {
- .master_xfer = virtio_i2c_xfer,
+ .xfer = virtio_i2c_xfer,
.functionality = virtio_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-wmt.c b/drivers/i2c/busses/i2c-wmt.c
index 198afee5233c..05ff6228c2dd 100644
--- a/drivers/i2c/busses/i2c-wmt.c
+++ b/drivers/i2c/busses/i2c-wmt.c
@@ -269,7 +269,7 @@ static u32 wmt_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm wmt_i2c_algo = {
- .master_xfer = wmt_i2c_xfer,
+ .xfer = wmt_i2c_xfer,
.functionality = wmt_i2c_func,
};

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 71391b590ada..7ff36df7319e 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1193,7 +1193,7 @@ static u32 xiic_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm xiic_algorithm = {
- .master_xfer = xiic_xfer,
+ .xfer = xiic_xfer,
.functionality = xiic_func,
};

--
2.43.0


2024-03-22 13:41:44

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 25/64] i2c: ibm_iic: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-ibm_iic.c | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 7fb87b78923e..f94596074446 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -136,11 +136,11 @@ static void iic_dev_init(struct ibm_iic_private* dev)

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

- /* Clear master address */
+ /* Clear client address */
out_8(&iic->lmadr, 0);
out_8(&iic->hmadr, 0);

- /* Clear slave address */
+ /* Clear target address */
out_8(&iic->lsadr, 0);
out_8(&iic->hsadr, 0);

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

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

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

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

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

-/*
- * Low level master transfer routine
- */
+/* Low level host transfer routine */
static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm,
int combined_xfer)
{
@@ -511,9 +509,7 @@ static int iic_xfer_bytes(struct ibm_iic_private* dev, struct i2c_msg* pm,
return ret > 0 ? 0 : ret;
}

-/*
- * Set target slave address for master transfer
- */
+/* Set client address for host transfer */
static inline void iic_address(struct ibm_iic_private* dev, struct i2c_msg* msg)
{
volatile struct iic_regs __iomem *iic = dev->vaddr;
@@ -546,7 +542,7 @@ static inline int iic_address_neq(const struct i2c_msg* p1,
}

/*
- * Generic master transfer entrypoint.
+ * Generic transfer entrypoint.
* Returns the number of processed messages or error (<0)
*/
static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
@@ -604,11 +600,11 @@ static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
}
}
else {
- /* Flush master data buffer (just in case) */
+ /* Flush host data buffer (just in case) */
out_8(&iic->mdcntl, in_8(&iic->mdcntl) | MDCNTL_FMDB);
}

- /* Load slave address */
+ /* Load client address */
iic_address(dev, &msgs[0]);

/* Do real transfer */
@@ -624,7 +620,7 @@ static u32 iic_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm iic_algo = {
- .master_xfer = iic_xfer,
+ .xfer = iic_xfer,
.functionality = iic_func
};

--
2.43.0


2024-03-22 13:42:24

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 30/64] i2c: ljca: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-ljca.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ljca.c b/drivers/i2c/busses/i2c-ljca.c
index b4927622177c..68aae0632f26 100644
--- a/drivers/i2c/busses/i2c-ljca.c
+++ b/drivers/i2c/busses/i2c-ljca.c
@@ -76,7 +76,7 @@ static int ljca_i2c_init(struct ljca_i2c_dev *ljca_i2c, u8 id)
return ret < 0 ? ret : 0;
}

-static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr,
+static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 client_addr,
enum ljca_xfer_type type)
{
struct ljca_i2c_rw_packet *w_packet =
@@ -88,7 +88,7 @@ static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr,

w_packet->id = ljca_i2c->i2c_info->id;
w_packet->len = cpu_to_le16(sizeof(*w_packet->data));
- w_packet->data[0] = (slave_addr << 1) | type;
+ w_packet->data[0] = (client_addr << 1) | type;

ret = ljca_transfer(ljca_i2c->ljca, LJCA_I2C_START, (u8 *)w_packet,
struct_size(w_packet, data, 1), (u8 *)r_packet,
@@ -107,7 +107,7 @@ static int ljca_i2c_start(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr,
return 0;
}

-static void ljca_i2c_stop(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr)
+static void ljca_i2c_stop(struct ljca_i2c_dev *ljca_i2c, u8 client_addr)
{
struct ljca_i2c_rw_packet *w_packet =
(struct ljca_i2c_rw_packet *)ljca_i2c->obuf;
@@ -169,16 +169,16 @@ static int ljca_i2c_pure_read(struct ljca_i2c_dev *ljca_i2c, u8 *data, u8 len)
return 0;
}

-static int ljca_i2c_read(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr, u8 *data,
+static int ljca_i2c_read(struct ljca_i2c_dev *ljca_i2c, u8 client_addr, u8 *data,
u8 len)
{
int ret;

- ret = ljca_i2c_start(ljca_i2c, slave_addr, LJCA_I2C_READ_XFER_TYPE);
+ ret = ljca_i2c_start(ljca_i2c, client_addr, LJCA_I2C_READ_XFER_TYPE);
if (!ret)
ret = ljca_i2c_pure_read(ljca_i2c, data, len);

- ljca_i2c_stop(ljca_i2c, slave_addr);
+ ljca_i2c_stop(ljca_i2c, client_addr);

return ret;
}
@@ -213,16 +213,16 @@ static int ljca_i2c_pure_write(struct ljca_i2c_dev *ljca_i2c, u8 *data, u8 len)
return 0;
}

-static int ljca_i2c_write(struct ljca_i2c_dev *ljca_i2c, u8 slave_addr,
+static int ljca_i2c_write(struct ljca_i2c_dev *ljca_i2c, u8 client_addr,
u8 *data, u8 len)
{
int ret;

- ret = ljca_i2c_start(ljca_i2c, slave_addr, LJCA_I2C_WRITE_XFER_TYPE);
+ ret = ljca_i2c_start(ljca_i2c, client_addr, LJCA_I2C_WRITE_XFER_TYPE);
if (!ret)
ret = ljca_i2c_pure_write(ljca_i2c, data, len);

- ljca_i2c_stop(ljca_i2c, slave_addr);
+ ljca_i2c_stop(ljca_i2c, client_addr);

return ret;
}
@@ -266,7 +266,7 @@ static const struct i2c_adapter_quirks ljca_i2c_quirks = {
};

static const struct i2c_algorithm ljca_i2c_algo = {
- .master_xfer = ljca_i2c_xfer,
+ .xfer = ljca_i2c_xfer,
.functionality = ljca_i2c_func,
};

--
2.43.0


2024-03-22 13:42:32

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 28/64] i2c: isch: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-isch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
index 416a9968ed28..389202625964 100644
--- a/drivers/i2c/busses/i2c-isch.c
+++ b/drivers/i2c/busses/i2c-isch.c
@@ -104,7 +104,7 @@ static int sch_transaction(void)
result = -EIO;
dev_dbg(&sch_adapter.dev, "Bus collision! SMBus may be "
"locked until next hard reset. (sorry!)\n");
- /* Clock stops and slave is stuck in mid-transmission */
+ /* Clock stops and client is stuck in mid-transmission */
} else if (temp & 0x02) {
result = -EIO;
dev_err(&sch_adapter.dev, "Error: no response!\n");
--
2.43.0


2024-03-22 13:42:42

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 38/64] i2c: mv64xxx: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-mv64xxx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index dc160cbc3155..0814f5bc8362 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -89,8 +89,8 @@ enum {
MV64XXX_I2C_STATE_WAITING_FOR_RESTART,
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK,
MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK,
- MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK,
- MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA,
+ MV64XXX_I2C_STATE_WAITING_FOR_CLIENT_ACK,
+ MV64XXX_I2C_STATE_WAITING_FOR_CLIENT_DATA,
};

/* Driver actions */
@@ -279,7 +279,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
} else {
drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA;
drv_data->state =
- MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK;
+ MV64XXX_I2C_STATE_WAITING_FOR_CLIENT_ACK;
drv_data->bytes_left--;
}
break;
@@ -307,7 +307,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data *drv_data, u32 status)
drv_data->action = MV64XXX_I2C_ACTION_RCV_DATA;
drv_data->bytes_left--;
}
- drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA;
+ drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_CLIENT_DATA;

if ((drv_data->bytes_left == 1) || drv_data->aborting)
drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_ACK;
@@ -797,8 +797,8 @@ static int mv64xxx_i2c_xfer_atomic(struct i2c_adapter *adap,
}

static const struct i2c_algorithm mv64xxx_i2c_algo = {
- .master_xfer = mv64xxx_i2c_xfer,
- .master_xfer_atomic = mv64xxx_i2c_xfer_atomic,
+ .xfer = mv64xxx_i2c_xfer,
+ .xfer_atomic = mv64xxx_i2c_xfer_atomic,
.functionality = mv64xxx_i2c_functionality,
};

--
2.43.0


2024-03-22 13:43:02

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 35/64] i2c: mlxcpld: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-mlxcpld.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c
index 099291a0411d..786d4c51f65a 100644
--- a/drivers/i2c/busses/i2c-mlxcpld.c
+++ b/drivers/i2c/busses/i2c-mlxcpld.c
@@ -197,8 +197,8 @@ static int mlxcpld_i2c_check_status(struct mlxcpld_i2c_priv *priv, int *status)
if (val & MLXCPLD_LPCI2C_TRANS_END) {
if (val & MLXCPLD_LPCI2C_STATUS_NACK)
/*
- * The slave is unable to accept the data. No such
- * slave, command not understood, or unable to accept
+ * The client is unable to accept the data. No such
+ * client, command not understood, or unable to accept
* any more data.
*/
*status = MLXCPLD_LPCI2C_NACK_IND;
@@ -280,7 +280,7 @@ static int mlxcpld_i2c_wait_for_free(struct mlxcpld_i2c_priv *priv)
}

/*
- * Wait for master transfer to complete.
+ * Wait for host transfer to complete.
* It puts current process to sleep until we get interrupt or timeout expires.
* Returns the number of transferred or read bytes or error (<0).
*/
@@ -315,7 +315,7 @@ static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv)
/*
* Actual read data len will be always the same as
* requested len. 0xff (line pull-up) will be returned
- * if slave has no data to return. Thus don't read
+ * if client has no data to return. Thus don't read
* MLXCPLD_LPCI2C_NUM_DAT_REG reg from CPLD. Only in case of
* SMBus block read transaction data len can be different,
* check this case.
@@ -375,7 +375,7 @@ static void mlxcpld_i2c_xfer_msg(struct mlxcpld_i2c_priv *priv)
}

/*
- * Set target slave address with command for master transfer.
+ * Set client address with command for host transfer.
* It should be latest executed function before CPLD transaction.
*/
cmd = (priv->xfer.msg[0].addr << 1) | priv->xfer.cmd;
@@ -449,7 +449,7 @@ static u32 mlxcpld_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm mlxcpld_i2c_algo = {
- .master_xfer = mlxcpld_i2c_xfer,
+ .xfer = mlxcpld_i2c_xfer,
.functionality = mlxcpld_i2c_func
};

--
2.43.0


2024-03-22 13:43:07

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 41/64] i2c: piix4: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-piix4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 6a0392172b2f..1f6223b88146 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -589,7 +589,7 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
result = -EIO;
dev_dbg(&piix4_adapter->dev, "Bus collision! SMBus may be "
"locked until next hard reset. (sorry!)\n");
- /* Clock stops and slave is stuck in mid-transmission */
+ /* Clock stops and client is stuck in mid-transmission */
}

if (temp & 0x04) {
--
2.43.0


2024-03-22 13:43:59

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 32/64] i2c: ls2x: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-ls2x.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ls2x.c b/drivers/i2c/busses/i2c-ls2x.c
index ebae6035701d..99fbc561e7f6 100644
--- a/drivers/i2c/busses/i2c-ls2x.c
+++ b/drivers/i2c/busses/i2c-ls2x.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Loongson-2K/Loongson LS7A I2C master mode driver
+ * Loongson-2K/Loongson LS7A I2C host controller mode driver
*
* Copyright (C) 2013 Loongson Technology Corporation Limited.
* Copyright (C) 2014-2017 Lemote, Inc.
@@ -51,7 +51,7 @@
/* Control Register Bit */
#define LS2X_CTR_EN BIT(7) /* 0: I2c frequency setting 1: Normal */
#define LS2X_CTR_IEN BIT(6) /* Enable i2c interrupt */
-#define LS2X_CTR_MST BIT(5) /* 0: Slave mode 1: Master mode */
+#define LS2X_CTR_MST BIT(5) /* 0: Target mode 1: Host mode */
#define CTR_FREQ_MASK GENMASK(7, 6)
#define CTR_READY_MASK GENMASK(7, 5)

@@ -251,7 +251,7 @@ static int ls2x_i2c_xfer_one(struct ls2x_i2c_priv *priv,
return ret;
}

-static int ls2x_i2c_master_xfer(struct i2c_adapter *adap,
+static int ls2x_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num)
{
int ret;
@@ -273,7 +273,7 @@ static unsigned int ls2x_i2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm ls2x_i2c_algo = {
- .master_xfer = ls2x_i2c_master_xfer,
+ .xfer = ls2x_i2c_xfer,
.functionality = ls2x_i2c_func,
};

--
2.43.0


2024-03-22 13:44:07

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 34/64] i2c: microchip-corei2c: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-microchip-corei2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-microchip-corei2c.c b/drivers/i2c/busses/i2c-microchip-corei2c.c
index 0b0a1c4d17ca..53a7a1bd535c 100644
--- a/drivers/i2c/busses/i2c-microchip-corei2c.c
+++ b/drivers/i2c/busses/i2c-microchip-corei2c.c
@@ -100,7 +100,7 @@
* @bus_clk_rate: current i2c bus clock rate
* @isr_status: cached copy of local ISR status
* @msg_len: number of bytes transferred in msg
- * @addr: address of the current slave
+ * @addr: address of the current client
*/
struct mchp_corei2c_dev {
void __iomem *base;
@@ -359,7 +359,7 @@ static u32 mchp_corei2c_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm mchp_corei2c_algo = {
- .master_xfer = mchp_corei2c_xfer,
+ .xfer = mchp_corei2c_xfer,
.functionality = mchp_corei2c_func,
};

--
2.43.0


2024-03-22 13:44:31

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 36/64] i2c: mpc: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-mpc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 8d73c0f405ed..135889fdb43e 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -115,7 +115,7 @@ static inline void writeccr(struct mpc_i2c *i2c, u32 x)
writeb(x, i2c->base + MPC_I2C_CR);
}

-/* Sometimes 9th clock pulse isn't generated, and slave doesn't release
+/* Sometimes 9th clock pulse isn't generated, and client doesn't release
* the bus, because it wants to send ACK.
* Following sequence of enabling/disabling and sending start/stop generates
* the 9 pulses, each with a START then ending with STOP, so it's all OK.
@@ -762,7 +762,7 @@ static int fsl_i2c_bus_recovery(struct i2c_adapter *adap)
}

static const struct i2c_algorithm mpc_algo = {
- .master_xfer = mpc_xfer,
+ .xfer = mpc_xfer,
.functionality = mpc_functionality,
};

--
2.43.0


2024-03-22 13:44:34

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 33/64] i2c: mchp-pci1xxxx: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-mchp-pci1xxxx.c | 40 +++++++++++++-------------
1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
index 5ef136c3ecb1..48fd69c87af7 100644
--- a/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
+++ b/drivers/i2c/busses/i2c-mchp-pci1xxxx.c
@@ -414,13 +414,13 @@ static void pci1xxxx_i2c_set_clear_FW_ACK(struct pci1xxxx_i2c *i2c, bool set)
writeb(regval, i2c->i2c_base + SMB_CORE_CTRL_REG_OFF);
}

-static void pci1xxxx_i2c_buffer_write(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
+static void pci1xxxx_i2c_buffer_write(struct pci1xxxx_i2c *i2c, u8 clientaddr,
u8 transferlen, unsigned char *buf)
{
void __iomem *p = i2c->i2c_base + SMBUS_MST_BUF;

- if (slaveaddr)
- writeb(slaveaddr, p++);
+ if (clientaddr)
+ writeb(clientaddr, p++);

if (buf)
memcpy_toio(p, buf, transferlen);
@@ -775,7 +775,7 @@ static void pci1xxxx_i2c_clear_flags(struct pci1xxxx_i2c *i2c)
pci1xxxx_ack_high_level_intr(i2c, ALL_HIGH_LAYER_INTR);
}

-static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
+static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 clientaddr,
unsigned char *buf, u16 total_len)
{
void __iomem *p2 = i2c->i2c_base + SMB_CORE_COMPLETION_REG_OFF3;
@@ -799,10 +799,10 @@ static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
* The I2C transfer could be more than 128 bytes. Our Core is
* capable of only sending 128 at a time.
* As far as the I2C read is concerned, initailly send the
- * read slave address along with the number of bytes to read in
- * ReadCount. After sending the slave address the interrupt
- * is generated. On seeing the ACK for the slave address, reverse the
- * buffer direction and run the DMA to initiate Read from slave.
+ * read client address along with the number of bytes to read in
+ * ReadCount. After sending the client address the interrupt
+ * is generated. On seeing the ACK for the client address, reverse the
+ * buffer direction and run the DMA to initiate Read from client.
*/
for (count = 0; count < total_len; count += transferlen) {

@@ -836,8 +836,8 @@ static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
pci1xxxx_i2c_set_transfer_dir(i2c, I2C_DIRN_WRITE);
pci1xxxx_i2c_send_start_stop(i2c, 1);

- /* Write I2c buffer with just the slave addr. */
- pci1xxxx_i2c_buffer_write(i2c, slaveaddr, 0, NULL);
+ /* Write I2c buffer with just the client addr. */
+ pci1xxxx_i2c_buffer_write(i2c, clientaddr, 0, NULL);

/* Set the count. Readcount is the transfer bytes. */
pci1xxxx_i2c_set_count(i2c, 1, 1, transferlen);
@@ -872,7 +872,7 @@ static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
/* Read the completion reg to know the reason for DMA_TERM. */
regval = readb(p2);

- /* Slave did not respond. */
+ /* Client did not respond. */
if (regval & COMPLETION_MNAKX) {
writeb(COMPLETION_MNAKX, p2);
retval = -ETIMEDOUT;
@@ -896,7 +896,7 @@ static int pci1xxxx_i2c_read(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
return retval;
}

-static int pci1xxxx_i2c_write(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
+static int pci1xxxx_i2c_write(struct pci1xxxx_i2c *i2c, u8 clientaddr,
unsigned char *buf, u16 total_len)
{
void __iomem *p2 = i2c->i2c_base + SMB_CORE_COMPLETION_REG_OFF3;
@@ -934,14 +934,14 @@ static int pci1xxxx_i2c_write(struct pci1xxxx_i2c *i2c, u8 slaveaddr,
if (count == 0) {
pci1xxxx_i2c_send_start_stop(i2c, 1);

- /* -1 for the slave address. */
+ /* -1 for the client address. */
transferlen = min_t(u16, SMBUS_BUF_MAX_SIZE - 1,
remainingbytes);
- pci1xxxx_i2c_buffer_write(i2c, slaveaddr,
+ pci1xxxx_i2c_buffer_write(i2c, clientaddr,
transferlen, &buf[count]);
/*
* The actual number of bytes written on the I2C bus
- * is including the slave address.
+ * is including the client address.
*/
actualwritelen = transferlen + 1;
} else {
@@ -993,13 +993,13 @@ static int pci1xxxx_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs, int num)
{
struct pci1xxxx_i2c *i2c = i2c_get_adapdata(adap);
- u8 slaveaddr;
+ u8 clientaddr;
int retval;
u32 i;

i2c->i2c_xfer_in_progress = true;
for (i = 0; i < num; i++) {
- slaveaddr = i2c_8bit_addr_from_msg(&msgs[i]);
+ clientaddr = i2c_8bit_addr_from_msg(&msgs[i]);

/*
* Send the STOP bit if the transfer is the final one or
@@ -1016,10 +1016,10 @@ static int pci1xxxx_i2c_xfer(struct i2c_adapter *adap,
i2c->flags &= ~I2C_FLAGS_SMB_BLK_READ;

if (msgs[i].flags & I2C_M_RD)
- retval = pci1xxxx_i2c_read(i2c, slaveaddr,
+ retval = pci1xxxx_i2c_read(i2c, clientaddr,
msgs[i].buf, msgs[i].len);
else
- retval = pci1xxxx_i2c_write(i2c, slaveaddr,
+ retval = pci1xxxx_i2c_write(i2c, clientaddr,
msgs[i].buf, msgs[i].len);

if (retval < 0)
@@ -1048,7 +1048,7 @@ static u32 pci1xxxx_i2c_get_funcs(struct i2c_adapter *adap)
}

static const struct i2c_algorithm pci1xxxx_i2c_algo = {
- .master_xfer = pci1xxxx_i2c_xfer,
+ .xfer = pci1xxxx_i2c_xfer,
.functionality = pci1xxxx_i2c_get_funcs,
};

--
2.43.0


2024-03-22 13:45:54

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 29/64] i2c: ismt: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-ismt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index c74985d77b0e..67c9d9768edd 100644
--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -54,7 +54,7 @@
* Hardware PEC yes
* Block buffer yes
* Block process call transaction yes
- * Slave mode no
+ * Target mode no
*/

#include <linux/module.h>
--
2.43.0


2024-03-22 13:46:04

by Wolfram Sang

[permalink] [raw]
Subject: [PATCH 42/64] i2c: powermac: reword according to newest specification

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 <[email protected]>
---
drivers/i2c/busses/i2c-powermac.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 8e57ebe595be..03abc5f3cb9e 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -25,7 +25,7 @@ MODULE_LICENSE("GPL");
/*
* SMBUS-type transfer entrypoint
*/
-static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap,
+static s32 i2c_powermac_smbus_xfer(struct i2c_adapter *adap,
u16 addr,
unsigned short flags,
char read_write,
@@ -127,11 +127,11 @@ static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap,
}

/*
- * Generic i2c master transfer entrypoint. This driver only support single
+ * Generic i2c transfer entrypoint. This driver only supports single
* messages (for "lame i2c" transfers). Anything else should use the smbus
* entry point
*/
-static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
+static int i2c_powermac_xfer(struct i2c_adapter *adap,
struct i2c_msg *msgs,
int num)
{
@@ -180,7 +180,7 @@ static u32 i2c_powermac_func(struct i2c_adapter * adapter)
/* For now, we only handle smbus */
static const struct i2c_algorithm i2c_powermac_algorithm = {
.smbus_xfer = i2c_powermac_smbus_xfer,
- .master_xfer = i2c_powermac_master_xfer,
+ .xfer = i2c_powermac_xfer,
.functionality = i2c_powermac_func,
};

--
2.43.0


2024-03-22 13:51:38

by Wolfram Sang

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

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 <[email protected]>
---
drivers/i2c/busses/i2c-au1550.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
index 8e43f25c117e..77d85feda631 100644
--- a/drivers/i2c/busses/i2c-au1550.c
+++ b/drivers/i2c/busses/i2c-au1550.c
@@ -81,11 +81,11 @@ static int wait_ack(struct i2c_au1550_data *adap)
return 0;
}

-static int wait_master_done(struct i2c_au1550_data *adap)
+static int wait_host_done(struct i2c_au1550_data *adap)
{
int i;

- /* Wait for Master Done. */
+ /* Wait for Host Done. */
for (i = 0; i < 2 * adap->xfer_timeout; i++) {
if ((RD(adap, PSC_SMBEVNT) & PSC_SMBEVNT_MD) != 0)
return 0;
@@ -120,12 +120,12 @@ do_address(struct i2c_au1550_data *adap, unsigned int addr, int rd, int q)
if (q)
addr |= PSC_SMBTXRX_STP;

- /* Put byte into fifo, start up master. */
+ /* Put byte into fifo, start up host controller */
WR(adap, PSC_SMBTXRX, addr);
WR(adap, PSC_SMBPCR, PSC_SMBPCR_MS);
if (wait_ack(adap))
return -EIO;
- return (q) ? wait_master_done(adap) : 0;
+ return (q) ? wait_host_done(adap) : 0;
}

static int wait_for_rx_byte(struct i2c_au1550_data *adap, unsigned char *out)
@@ -175,7 +175,7 @@ static int i2c_read(struct i2c_au1550_data *adap, unsigned char *buf,

/* The last byte has to indicate transfer done. */
WR(adap, PSC_SMBTXRX, PSC_SMBTXRX_STP);
- if (wait_master_done(adap))
+ if (wait_host_done(adap))
return -EIO;

buf[i] = (unsigned char)(RD(adap, PSC_SMBTXRX) & 0xff);
@@ -204,7 +204,7 @@ static int i2c_write(struct i2c_au1550_data *adap, unsigned char *buf,
data = buf[i];
data |= PSC_SMBTXRX_STP;
WR(adap, PSC_SMBTXRX, data);
- if (wait_master_done(adap))
+ if (wait_host_done(adap))
return -EIO;
return 0;
}
@@ -246,7 +246,7 @@ static u32 au1550_func(struct i2c_adapter *adap)
}

static const struct i2c_algorithm au1550_algo = {
- .master_xfer = au1550_xfer,
+ .xfer = au1550_xfer,
.functionality = au1550_func,
};

--
2.43.0


2024-03-22 14:06:25

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH 47/64] i2c: rk3x: reword according to newest specification

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 <[email protected]>

Reviewed-by: Heiko Stuebner <[email protected]>

> ---
> 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,
> };
>
>





2024-03-22 14:35:22

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

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.
>
> Signed-off-by: Wolfram Sang <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>

Regards,
Bjorn

2024-03-22 14:35:50

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 44/64] i2c: qup: reword according to newest specification

On Fri, Mar 22, 2024 at 02:25:37PM +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 <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>

Regards,
Bjorn

> ---
> drivers/i2c/busses/i2c-qup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index 598102d16677..2aeb5c33a711 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -380,7 +380,7 @@ static int qup_i2c_poll_state_mask(struct qup_i2c_dev *qup,
> u32 state;
>
> /*
> - * State transition takes 3 AHB clocks cycles + 3 I2C master clock
> + * State transition takes 3 AHB clocks cycles + 3 I2C host clock
> * cycles. So retry once after a 1uS delay.
> */
> do {
> @@ -1607,12 +1607,12 @@ static u32 qup_i2c_func(struct i2c_adapter *adap)
> }
>
> static const struct i2c_algorithm qup_i2c_algo = {
> - .master_xfer = qup_i2c_xfer,
> + .xfer = qup_i2c_xfer,
> .functionality = qup_i2c_func,
> };
>
> static const struct i2c_algorithm qup_i2c_algo_v2 = {
> - .master_xfer = qup_i2c_xfer_v2,
> + .xfer = qup_i2c_xfer_v2,
> .functionality = qup_i2c_func,
> };
>
> --
> 2.43.0
>

2024-03-22 15:14:02

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

On 22/03/2024 at 14:25, Wolfram Sang wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> 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.
>
> Signed-off-by: Wolfram Sang <[email protected]>
> ---

[..]

> drivers/i2c/busses/i2c-at91-master.c | 2 +-
> drivers/i2c/busses/i2c-at91-slave.c | 8 ++++----

[..]

Acked-by: Nicolas Ferre <[email protected]> # for at91
Probably file names themselves will need some care, in a second time.

Thanks. Regards,
Nicolas

[..]

> --
> 2.43.0
>


2024-03-22 16:48:20

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification


> Acked-by: Nicolas Ferre <[email protected]> # for at91
> Probably file names themselves will need some care, in a second time.

Totally true. I am aware of that. But one step after the other...


Attachments:
(No filename) (214.00 B)
signature.asc (849.00 B)
Download all attachments

2024-03-22 17:07:03

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

On Fri, Mar 22, 2024 at 9:47 AM Wolfram Sang
<[email protected]> wrote:
>
>
> > Acked-by: Nicolas Ferre <[email protected]> # for at91
> > Probably file names themselves will need some care, in a second time.
>
> Totally true. I am aware of that. But one step after the other...
>

Kind of odd though to change function names but not parameter names of
those very same functions.

Guenter

2024-03-22 17:10:13

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification


> Kind of odd though to change function names but not parameter names of
> those very same functions.

Ouch, this is definitely a valid point. Seems like this series will need
a respin after all. Will wait for further comments, though.

Thanks!


Attachments:
(No filename) (256.00 B)
signature.asc (849.00 B)
Download all attachments

2024-03-22 17:11:36

by Easwar Hariharan

[permalink] [raw]
Subject: Re: [PATCH 53/64] i2c: st: reword according to newest specification

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 <[email protected]>
> ---
> 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 <[email protected]>
> */
> @@ -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,
> };
>


2024-03-22 22:28:38

by Vadim Pasternak

[permalink] [raw]
Subject: RE: [PATCH 35/64] i2c: mlxcpld: reword according to newest specification



> -----Original Message-----
> From: Wolfram Sang <[email protected]>
> Sent: Friday, 22 March 2024 15:25
> To: [email protected]
> Cc: Wolfram Sang <[email protected]>; Vadim Pasternak
> <[email protected]>; Michael Shych <[email protected]>; Andi Shyti
> <[email protected]>; [email protected]
> Subject: [PATCH 35/64] i2c: mlxcpld: reword according to newest specification
>
> 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 <[email protected]>

Acked-by: Vadim Pasternak <[email protected]>

> ---
> drivers/i2c/busses/i2c-mlxcpld.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-
> mlxcpld.c
> index 099291a0411d..786d4c51f65a 100644
> --- a/drivers/i2c/busses/i2c-mlxcpld.c
> +++ b/drivers/i2c/busses/i2c-mlxcpld.c
> @@ -197,8 +197,8 @@ static int mlxcpld_i2c_check_status(struct
> mlxcpld_i2c_priv *priv, int *status)
> if (val & MLXCPLD_LPCI2C_TRANS_END) {
> if (val & MLXCPLD_LPCI2C_STATUS_NACK)
> /*
> - * The slave is unable to accept the data. No such
> - * slave, command not understood, or unable to
> accept
> + * The client is unable to accept the data. No such
> + * client, command not understood, or unable to
> accept
> * any more data.
> */
> *status = MLXCPLD_LPCI2C_NACK_IND;
> @@ -280,7 +280,7 @@ static int mlxcpld_i2c_wait_for_free(struct
> mlxcpld_i2c_priv *priv) }
>
> /*
> - * Wait for master transfer to complete.
> + * Wait for host transfer to complete.
> * It puts current process to sleep until we get interrupt or timeout expires.
> * Returns the number of transferred or read bytes or error (<0).
> */
> @@ -315,7 +315,7 @@ static int mlxcpld_i2c_wait_for_tc(struct
> mlxcpld_i2c_priv *priv)
> /*
> * Actual read data len will be always the same as
> * requested len. 0xff (line pull-up) will be returned
> - * if slave has no data to return. Thus don't read
> + * if client has no data to return. Thus don't read
> * MLXCPLD_LPCI2C_NUM_DAT_REG reg from CPLD. Only in
> case of
> * SMBus block read transaction data len can be different,
> * check this case.
> @@ -375,7 +375,7 @@ static void mlxcpld_i2c_xfer_msg(struct
> mlxcpld_i2c_priv *priv)
> }
>
> /*
> - * Set target slave address with command for master transfer.
> + * Set client address with command for host transfer.
> * It should be latest executed function before CPLD transaction.
> */
> cmd = (priv->xfer.msg[0].addr << 1) | priv->xfer.cmd; @@ -449,7
> +449,7 @@ static u32 mlxcpld_i2c_func(struct i2c_adapter *adap) }
>
> static const struct i2c_algorithm mlxcpld_i2c_algo = {
> - .master_xfer = mlxcpld_i2c_xfer,
> + .xfer = mlxcpld_i2c_xfer,
> .functionality = mlxcpld_i2c_func
> };
>
> --
> 2.43.0

2024-03-23 09:20:53

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification

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

2024-03-23 09:47:26

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 01/64] i2c: reword i2c_algorithm according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:54PM +0100, Wolfram Sang wrote:
> 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

nit: "I3C 1.1.1" as you added the version to every specification.

> appropriate terms. The 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.
>
> Signed-off-by: Wolfram Sang <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Andi

2024-03-25 10:08:10

by Baolin Wang

[permalink] [raw]
Subject: Re: [PATCH 52/64] i2c: sprd: reword according to newest specification



On 2024/3/22 21: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 <[email protected]>

LGTM. Thanks.
Reviewed-by: Baolin Wang <[email protected]>

> ---
> drivers/i2c/busses/i2c-sprd.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c
> index 28c88901d9bc..f1a8375ccc17 100644
> --- a/drivers/i2c/busses/i2c-sprd.c
> +++ b/drivers/i2c/busses/i2c-sprd.c
> @@ -283,7 +283,7 @@ static int sprd_i2c_handle_msg(struct i2c_adapter *i2c_adap,
> return i2c_dev->err;
> }
>
> -static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap,
> +static int sprd_i2c_xfer(struct i2c_adapter *i2c_adap,
> struct i2c_msg *msgs, int num)
> {
> struct sprd_i2c *i2c_dev = i2c_adap->algo_data;
> @@ -314,7 +314,7 @@ static u32 sprd_i2c_func(struct i2c_adapter *adap)
> }
>
> static const struct i2c_algorithm sprd_i2c_algo = {
> - .master_xfer = sprd_i2c_master_xfer,
> + .xfer = sprd_i2c_xfer,
> .functionality = sprd_i2c_func,
> };
>
> @@ -378,12 +378,12 @@ static irqreturn_t sprd_i2c_isr_thread(int irq, void *dev_id)
> i2c_tran = i2c_dev->count;
>
> /*
> - * If we got one ACK from slave when writing data, and we did not
> + * If we got one ACK from client when writing data, and we did not
> * finish this transmission (i2c_tran is not zero), then we should
> * continue to write data.
> *
> * For reading data, ack is always true, if i2c_tran is not 0 which
> - * means we still need to contine to read data from slave.
> + * means we still need to contine to read data from client.
> */
> if (i2c_tran && ack) {
> sprd_i2c_data_transfer(i2c_dev);
> @@ -393,7 +393,7 @@ static irqreturn_t sprd_i2c_isr_thread(int irq, void *dev_id)
> i2c_dev->err = 0;
>
> /*
> - * If we did not get one ACK from slave when writing data, we should
> + * If we did not get one ACK from client when writing data, we should
> * return -EIO to notify users.
> */
> if (!ack)
> @@ -422,7 +422,7 @@ static irqreturn_t sprd_i2c_isr(int irq, void *dev_id)
> i2c_tran = i2c_dev->count;
>
> /*
> - * If we did not get one ACK from slave when writing data, then we
> + * If we did not get one ACK from client when writing data, then we
> * should finish this transmission since we got some errors.
> *
> * When writing data, if i2c_tran == 0 which means we have writen
> @@ -653,5 +653,5 @@ static struct platform_driver sprd_i2c_driver = {
>
> module_platform_driver(sprd_i2c_driver);
>
> -MODULE_DESCRIPTION("Spreadtrum I2C master controller driver");
> +MODULE_DESCRIPTION("Spreadtrum I2C host controller driver");
> MODULE_LICENSE("GPL v2");

2024-03-25 10:55:34

by Andrew Jeffery

[permalink] [raw]
Subject: Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification

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 <[email protected]>

Reviewed-by: Andrew Jeffery <[email protected]>

2024-03-25 13:16:15

by George Cherian

[permalink] [raw]
Subject: Re: [PATCH 62/64] i2c: xlp9xx: reword according to newest specification

On 2024-03-22 at 18:55:55, Wolfram Sang ([email protected]) 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 <[email protected]>

Acked-by: George Cherian <[email protected]>

2024-03-25 13:20:36

by Jarkko Nikula

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

On 3/22/24 3:25 PM, 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.
>
> Signed-off-by: Wolfram Sang <[email protected]>
> ---
> drivers/i2c/busses/i2c-amd-mp2-plat.c | 2 +-
> drivers/i2c/busses/i2c-at91-master.c | 2 +-
> drivers/i2c/busses/i2c-at91-slave.c | 8 ++++----
> drivers/i2c/busses/i2c-axxia.c | 10 +++++-----
> drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +-
> drivers/i2c/busses/i2c-designware-master.c | 2 +-
> drivers/i2c/busses/i2c-designware-slave.c | 8 ++++----
> drivers/i2c/busses/i2c-diolan-u2c.c | 2 +-
> drivers/i2c/busses/i2c-exynos5.c | 4 ++--
> drivers/i2c/busses/i2c-gxp.c | 12 ++++++------
> drivers/i2c/busses/i2c-hisi.c | 4 ++--
> drivers/i2c/busses/i2c-img-scb.c | 2 +-
> drivers/i2c/busses/i2c-imx.c | 12 ++++++------
> drivers/i2c/busses/i2c-jz4780.c | 2 +-
> drivers/i2c/busses/i2c-kempld.c | 2 +-
> drivers/i2c/busses/i2c-meson.c | 4 ++--
> drivers/i2c/busses/i2c-mlxbf.c | 8 ++++----
> drivers/i2c/busses/i2c-mt65xx.c | 2 +-
> 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-platdrv.c | 2 +-
> drivers/i2c/busses/i2c-omap.c | 4 ++--
> drivers/i2c/busses/i2c-opal.c | 4 ++--
> drivers/i2c/busses/i2c-pasemi-core.c | 2 +-
> drivers/i2c/busses/i2c-pnx.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-robotfuzz-osif.c | 2 +-
> drivers/i2c/busses/i2c-rzv2m.c | 8 ++++----
> drivers/i2c/busses/i2c-s3c2410.c | 4 ++--
> drivers/i2c/busses/i2c-stm32f7.c | 14 +++++++-------
> 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-virtio.c | 2 +-
> drivers/i2c/busses/i2c-wmt.c | 2 +-
> drivers/i2c/busses/i2c-xiic.c | 2 +-
> 41 files changed, 95 insertions(+), 95 deletions(-)
>

> diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c
> index c7e56002809a..14c61b31f877 100644
> --- a/drivers/i2c/busses/i2c-designware-master.c
> +++ b/drivers/i2c/busses/i2c-designware-master.c
> @@ -832,7 +832,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
> }
>
> static const struct i2c_algorithm i2c_dw_algo = {
> - .master_xfer = i2c_dw_xfer,
> + .xfer = i2c_dw_xfer,
> .functionality = i2c_dw_func,
> };
>
> diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c
> index 2e079cf20bb5..b47ad6b16814 100644
> --- a/drivers/i2c/busses/i2c-designware-slave.c
> +++ b/drivers/i2c/busses/i2c-designware-slave.c
> @@ -58,7 +58,7 @@ static int i2c_dw_init_slave(struct dw_i2c_dev *dev)
> return 0;
> }
>
> -static int i2c_dw_reg_slave(struct i2c_client *slave)
> +static int i2c_dw_reg_target(struct i2c_client *slave)
> {
> struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter);
>
> @@ -83,7 +83,7 @@ static int i2c_dw_reg_slave(struct i2c_client *slave)
> return 0;
> }
>
> -static int i2c_dw_unreg_slave(struct i2c_client *slave)
> +static int i2c_dw_unreg_target(struct i2c_client *slave)
> {
> struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter);
>
> @@ -214,8 +214,8 @@ static irqreturn_t i2c_dw_isr_slave(int this_irq, void *dev_id)
>
> static const struct i2c_algorithm i2c_dw_algo = {
> .functionality = i2c_dw_func,
> - .reg_slave = i2c_dw_reg_slave,
> - .unreg_slave = i2c_dw_unreg_slave,
> + .reg_target = i2c_dw_reg_target,
> + .unreg_target = i2c_dw_unreg_target,
> };

Acked-by: Jarkko Nikula <[email protected]>

2024-03-25 13:37:46

by Oleksij Rempel

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

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.
>
> Signed-off-by: Wolfram Sang <[email protected]>

Acked-by: Oleksij Rempel <[email protected]> # for i2c-imx.c

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

Subject: Re: [PATCH 37/64] i2c: mt7621: reword according to newest specification

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 <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>



2024-03-25 13:39:58

by Stefan Roese

[permalink] [raw]
Subject: Re: [PATCH 37/64] i2c: mt7621: reword according to newest specification

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 <[email protected]>

Reviewed-by: Stefan Roese <[email protected]>

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: [email protected]

2024-03-25 17:37:47

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH 15/64] i2c: davinci: reword according to newest specification

On Fri, Mar 22, 2024 at 2:26 PM Wolfram Sang
<[email protected]> 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 <[email protected]>
> ---

Acked-by: Bartosz Golaszewski <[email protected]>

2024-03-25 23:46:16

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 02/64] i2c: ali15x3: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:55PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 00:12:52

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 03/64] i2c: altera: reword according to newest specification

Hi Wolfram,

>
> - /* Mask all master interrupt bits */
> + /* Mask all interrupt bits */

"Mask all controller's interrupt bits" would have been redundant.

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 00:14:13

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 04/64] i2c: amd-mp2-pci: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:24:57PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 00:17:56

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification

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 <[email protected]>
> ---
> 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

2024-03-26 00:37:08

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification

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

2024-03-26 00:51:41

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH 34/64] i2c: microchip-corei2c: reword according to newest specification

On Fri, Mar 22, 2024 at 02:25:27PM +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 <[email protected]>

Acked-by: Conor Dooley <[email protected]>

Thanks,
Conor.


Attachments:
(No filename) (480.00 B)
signature.asc (235.00 B)
Download all attachments

2024-03-26 07:28:05

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 06/64] i2c: au1550: reword according to newest specification

Hi Wolfram,

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

..

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

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

..

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

Here there was some alignment which now is gone.

Andi

2024-03-26 07:29:26

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 07/64] i2c: bcm-iproc: reword according to newest specification

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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 07:40:22

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 08/64] i2c: bcm-kona: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:01PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 12:44:32

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 09/64] i2c: bcm2835: reword according to newest specification



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 <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2024-03-26 12:45:05

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 10/64] i2c: brcmstb: reword according to newest specification



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 <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2024-03-26 15:33:14

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 08/64] i2c: bcm-kona: reword according to newest specification



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 <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian


Attachments:
smime.p7s (4.12 kB)
S/MIME Cryptographic Signature

2024-03-26 19:03:50

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 09/64] i2c: bcm2835: reword according to newest specification

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

2024-03-26 19:09:35

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 14/64] i2c: cpm: reword according to newest specification

Hi Wolfram,

..

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

I2COM_MASTER might be coming from the datasheet.

Reviewed-by: Andi Shyti <[email protected]>

Thanks,

2024-03-26 19:12:50

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 10/64] i2c: brcmstb: reword according to newest specification

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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 19:15:29

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 11/64] i2c: cadence: reword according to newest specification

Hi Wolfram,

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

alignment :-)

Andi

2024-03-26 19:17:08

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 12/64] i2c: cht-wc: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:05PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 19:17:12

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 17/64] i2c: dln2: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:10PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 19:19:59

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 18/64] i2c: eg20t: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:11PM +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 <[email protected]>
> ---
> drivers/i2c/busses/i2c-eg20t.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
> index 4914bfbee2a9..e95793036f5d 100644
> --- a/drivers/i2c/busses/i2c-eg20t.c
> +++ b/drivers/i2c/busses/i2c-eg20t.c
> @@ -337,7 +337,7 @@ static int pch_i2c_wait_for_check_xfer(struct i2c_algo_pch_data *adap)
> adap->pch_event_flag = 0;
>
> if (ioread32(p + PCH_I2CSR) & PCH_GETACK) {
> - pch_dbg(adap, "Receive NACK for slave address setting\n");
> + pch_dbg(adap, "Receive NACK for client address setting\n");
> return -ENXIO;
> }
>
> @@ -382,7 +382,7 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
> buf = msgs->buf;
> addr = msgs->addr;
>
> - /* enable master tx */
> + /* enable host tx */

maybe we should also specify that we are using both host and
client for master in the commit message.

In any case,

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-26 20:28:59

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 20/64] i2c: fsi: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:13PM +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 <[email protected]>
> ---
> drivers/i2c/busses/i2c-fsi.c | 56 ++++++++++++++++++------------------
> 1 file changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
> index 10332693edf0..5eaf2c85a72c 100644
> --- a/drivers/i2c/busses/i2c-fsi.c
> +++ b/drivers/i2c/busses/i2c-fsi.c
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0+
> /*
> - * FSI-attached I2C master algorithm
> + * FSI-attached I2C controller algorithm

As this change is all about renaming, I think we need to be a bit
more consistent in using either host or controller, at least
within the same driver.

In this driver you are using sometimes host and sometimes
controller.

Thanks,
Andi

2024-03-27 20:44:19

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 21/64] i2c: gpio: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:14PM +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 <[email protected]>

Reviewed-by: Andi Shyti <[email protected]>

Thanks,
Andi

2024-03-27 21:07:19

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 22/64] i2c: highlander: reword according to newest specification

Hi Wolfram,

On Fri, Mar 22, 2024 at 02:25:15PM +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").

I'm just noticing... what do you mean with client/target? Can you
please be a bit more specific?

If I search through the three documents I find the word "client"
written only once in the i3c document.

> Signed-off-by: Wolfram Sang <[email protected]>
> ---
> drivers/i2c/busses/i2c-highlander.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
> index 7922bc917c33..ec3546a5178b 100644
> --- a/drivers/i2c/busses/i2c-highlander.c
> +++ b/drivers/i2c/busses/i2c-highlander.c
> @@ -331,7 +331,7 @@ static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
> /* Ensure we're in a sane state */
> highlander_i2c_done(dev);
>
> - /* Set slave address */
> + /* Set client address */

/client/target/ ?

Andi

2024-04-02 12:45:55

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 64/64] i2c: reword i2c_algorithm in drivers according to newest specification

On Fri, Mar 22, 2024 at 2:27 PM Wolfram Sang
<[email protected]> 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.
>
> Signed-off-by: Wolfram Sang <[email protected]>

Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2024-04-05 08:48:56

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 00/64] i2c: reword i2c_algorithm according to newest specification

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


Attachments:
(No filename) (413.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-08 08:35:55

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 01/64] i2c: reword i2c_algorithm according to newest specification


> > 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
>
> nit: "I3C 1.1.1" as you added the version to every specification.

Added, thanks!


Attachments:
(No filename) (246.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-08 08:36:05

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 05/64] i2c: aspeed: reword according to newest specification


> > -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?


Attachments:
(No filename) (1.11 kB)
signature.asc (849.00 B)
Download all attachments

2024-04-08 08:51:10

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 06/64] i2c: au1550: reword according to newest specification


> > - /* Wait for Master Done. */
> > + /* Wait for Host Done. */
>
> here, rather than Master/Controller, the change is Master/Host,
> which is different from what is stated in the commit log.

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

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


Attachments:
(No filename) (768.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-08 09:04:46

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 14/64] i2c: cpm: reword according to newest specification


> > out_8(&cpm->i2c_reg->i2mod, 0x00);
> > - out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Master mode */
> > + out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Host mode */
>
> I2COM_MASTER might be coming from the datasheet.

Maybe we can just drop the comment? The value we write is pretty
self-explaining.


Attachments:
(No filename) (322.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-08 09:07:39

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 22/64] i2c: highlander: reword according to newest specification


> I'm just noticing... what do you mean with client/target? Can you
> please be a bit more specific?

I described it somewhere (and Easwar mentioned it in another thread by
now), but, yes, it needs to be better described. This will be also in my
updates to the I2C docs.


Attachments:
(No filename) (281.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-08 09:15:49

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 53/64] i2c: st: reword according to newest specification

> > - 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.


Attachments:
(No filename) (970.00 B)
signature.asc (849.00 B)
Download all attachments

2024-04-10 15:20:10

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 22/64] i2c: highlander: reword according to newest specification

Hi Wolfram,

On Mon, Apr 08, 2024 at 11:07:20AM +0200, Wolfram Sang wrote:
> > I'm just noticing... what do you mean with client/target? Can you
> > please be a bit more specific?
>
> I described it somewhere (and Easwar mentioned it in another thread by
> now), but, yes, it needs to be better described. This will be also in my
> updates to the I2C docs.

yes, I understood the difference between "client" and "target".
The problem I see here is that this is not described in the
specification (except for some pictures in the i3c, iirc).

So that the change slave/client looks a bit arbitrary and I hear
some people don't like it.

That's why I need to know a bit more about the choice :-)

Thanks,
Andi

2024-04-10 15:25:44

by Andi Shyti

[permalink] [raw]
Subject: Re: [PATCH 14/64] i2c: cpm: reword according to newest specification

> > > out_8(&cpm->i2c_reg->i2mod, 0x00);
> > > - out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Master mode */
> > > + out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Host mode */
> >
> > I2COM_MASTER might be coming from the datasheet.
>
> Maybe we can just drop the comment? The value we write is pretty
> self-explaining.

indeed.

Andi

2024-04-12 06:47:47

by Jochen Friedrich

[permalink] [raw]
Subject: Re: [PATCH 14/64] i2c: cpm: reword according to newest specification

>>>> out_8(&cpm->i2c_reg->i2mod, 0x00);
>>>> - out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Master mode */
>>>> + out_8(&cpm->i2c_reg->i2com, I2COM_MASTER); /* Host mode */
>>> I2COM_MASTER might be coming from the datasheet.
>> Maybe we can just drop the comment? The value we write is pretty
>> self-explaining.
> indeed.
>
> Andi

I also agree. You might add my Acked-By: <[email protected]> here. Jochen