From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Eddie James <eajames@linux.ibm.com>,
Andi Shyti <andi.shyti@kernel.org>,
openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 15/60] i2c: fsi: reword according to newest specification
Date: Sat, 6 Jul 2024 13:20:15 +0200 [thread overview]
Message-ID: <20240706112116.24543-16-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20240706112116.24543-1-wsa+renesas@sang-engineering.com>
Change the wording of this driver wrt. the newest I2C v7 and SMBus 3.2
specifications and replace "master/slave" with more appropriate terms.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
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..ae016a9431da 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_ctrl {
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_ctrl *ctrl;
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_ctrl *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->ctrl->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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *i2c = port->ctrl;
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_ctrl *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_ctrl *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_ctrl *i2c = port->ctrl;
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->ctrl->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_ctrl *ctrl = port->ctrl;
struct i2c_msg *msg;
- mutex_lock(&master->lock);
+ mutex_lock(&ctrl->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(&ctrl->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_ctrl *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->ctrl = 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_ctrl *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 <eajames@us.ibm.com>");
-MODULE_DESCRIPTION("FSI attached I2C master");
+MODULE_DESCRIPTION("FSI attached I2C controller");
MODULE_LICENSE("GPL");
--
2.43.0
next prev parent reply other threads:[~2024-07-06 11:21 UTC|newest]
Thread overview: 136+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-06 11:20 [PATCH v2 00/60] i2c: reword first drivers according to newest specification Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 01/60] i2c: reword i2c_algorithm " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 02/60] i2c: ali15x3: reword " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 03/60] i2c: altera: " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 04/60] i2c: au1550: " Wolfram Sang
2024-07-09 21:51 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 05/60] i2c: bcm-kona: " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 06/60] i2c: bcm2835: " Wolfram Sang
2024-07-09 21:51 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 07/60] i2c: brcmstb: " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 08/60] i2c: cht-wc: " Wolfram Sang
2024-07-07 16:55 ` Hans de Goede
2024-07-06 11:20 ` [PATCH v2 09/60] i2c: cp2615: " Wolfram Sang
2024-07-06 15:07 ` Bence Csókás
2024-07-06 15:12 ` Wolfram Sang
2024-07-09 22:15 ` Andi Shyti
2024-07-10 6:41 ` [PATCH v3] " Wolfram Sang
2024-07-10 17:51 ` Bence Csókás
2024-07-06 11:20 ` [PATCH v2 10/60] i2c: cros-ec-tunnel: reword according to newest specification Wolfram Sang
2024-07-09 22:18 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 11/60] i2c: davinci: " Wolfram Sang
2024-07-10 8:04 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 12/60] i2c: digicolor: " Wolfram Sang
2024-07-10 8:05 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 13/60] i2c: diolan-u2c: " Wolfram Sang
2024-07-06 13:44 ` Guenter Roeck
2024-07-10 8:05 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 14/60] i2c: dln2: " Wolfram Sang
2024-07-06 11:20 ` Wolfram Sang [this message]
2024-07-09 14:35 ` [PATCH v2 15/60] i2c: fsi: " Eddie James
2024-07-10 8:08 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 16/60] i2c: gpio: " Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 17/60] i2c: highlander: " Wolfram Sang
2024-07-10 8:08 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 18/60] i2c: hisi: " Wolfram Sang
2024-07-10 8:09 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 19/60] i2c: hix5hd2: " Wolfram Sang
2024-07-10 8:09 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 20/60] i2c: i801: " Wolfram Sang
2024-07-10 8:10 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 21/60] i2c: ibm_iic: " Wolfram Sang
2024-07-10 21:43 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 22/60] i2c: iop3xx: " Wolfram Sang
2024-07-10 21:44 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 23/60] i2c: isch: " Wolfram Sang
2024-07-10 21:45 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 24/60] i2c: jz4780: " Wolfram Sang
2024-07-08 11:20 ` Paul Cercueil
2024-07-10 21:45 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 25/60] i2c: kempld: " Wolfram Sang
2024-07-10 21:46 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 26/60] i2c: ljca: " Wolfram Sang
2024-07-10 21:49 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 27/60] i2c: lpc2k: " Wolfram Sang
2024-07-10 21:54 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 28/60] i2c: ls2x: " Wolfram Sang
2024-07-10 21:56 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 29/60] i2c: mlxcpld: " Wolfram Sang
2024-07-10 21:57 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 30/60] i2c: mpc: " Wolfram Sang
2024-07-07 20:52 ` Chris Packham
2024-07-10 21:58 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 31/60] i2c: mt7621: " Wolfram Sang
2024-07-10 21:59 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 32/60] i2c: mv64xxx: " Wolfram Sang
2024-07-10 22:11 ` Andi Shyti
2024-07-10 22:21 ` Wolfram Sang
2024-07-11 8:05 ` Andi Shyti
2024-07-16 8:38 ` Gregory CLEMENT
2024-07-16 8:57 ` Wolfram Sang
2024-07-11 10:21 ` Andi Shyti
2024-07-16 8:41 ` Gregory CLEMENT
2024-07-06 11:20 ` [PATCH v2 33/60] i2c: ocores: " Wolfram Sang
2024-07-11 8:01 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 34/60] i2c: octeon: " Wolfram Sang
2024-07-11 8:02 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 35/60] i2c: opal: " Wolfram Sang
2024-07-11 8:06 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 36/60] i2c: owl: " Wolfram Sang
2024-07-11 8:06 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 37/60] i2c: pasemi: " Wolfram Sang
2024-07-07 10:50 ` Sven Peter
2024-07-11 8:07 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 38/60] i2c: piix4: " Wolfram Sang
2024-07-11 8:09 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 39/60] i2c: powermac: " Wolfram Sang
2024-07-11 8:10 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 40/60] i2c: pxa-pci: " Wolfram Sang
2024-07-11 8:10 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 41/60] i2c: riic: " Wolfram Sang
2024-07-11 10:21 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 42/60] i2c: rk3x: " Wolfram Sang
2024-07-11 10:22 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 43/60] i2c: robotfuzz-osif: " Wolfram Sang
2024-07-11 10:23 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 44/60] i2c: rzv2m: " Wolfram Sang
2024-07-11 10:23 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 45/60] i2c: sis5595: " Wolfram Sang
2024-07-11 10:24 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 46/60] i2c: sprd: " Wolfram Sang
2024-07-11 10:25 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 47/60] i2c: stm32f4: " Wolfram Sang
2024-07-09 11:32 ` Alain Volmat
2024-07-09 11:38 ` Pierre Yves MORDRET
2024-07-11 10:25 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 48/60] i2c: sun6i-p2wi: " Wolfram Sang
2024-07-06 11:43 ` Chen-Yu Tsai
2024-07-11 10:26 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 49/60] i2c: taos-evm: " Wolfram Sang
2024-07-11 10:27 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 50/60] i2c: tegra-bpmp: " Wolfram Sang
2024-07-11 10:27 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 51/60] i2c: thunderx-pcidrv: " Wolfram Sang
2024-07-11 12:44 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 52/60] i2c: tiny-usb: " Wolfram Sang
2024-07-11 12:58 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 53/60] i2c: uniphier-f: " Wolfram Sang
2024-07-11 12:59 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 54/60] i2c: uniphier: " Wolfram Sang
2024-07-11 13:00 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 55/60] i2c: viperboard: " Wolfram Sang
2024-07-11 13:02 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 56/60] i2c: viai2c: " Wolfram Sang
2024-07-11 13:05 ` Andi Shyti
2024-07-11 14:44 ` Wolfram Sang
2024-07-06 11:20 ` [PATCH v2 57/60] i2c: nvidia-gpu: " Wolfram Sang
2024-07-11 13:05 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 58/60] i2c: virtio: " Wolfram Sang
2024-07-08 5:53 ` Viresh Kumar
2024-07-11 13:06 ` Andi Shyti
2024-07-06 11:20 ` [PATCH v2 59/60] i2c: cpm: " Wolfram Sang
2024-07-06 11:21 ` [PATCH v2 60/60] i2c: st: " Wolfram Sang
2024-07-09 10:21 ` Alain Volmat
2024-07-11 13:07 ` Andi Shyti
2024-07-11 13:16 ` [PATCH v2 00/60] i2c: reword first drivers " Andi Shyti
2024-07-11 14:45 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240706112116.24543-16-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=andi.shyti@kernel.org \
--cc=eajames@linux.ibm.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).