Skip to content

Commit c2cac34

Browse files
Wolfram SangAndi Shyti
authored andcommitted
i2c: sun6i-p2wi: reword according to newest specification
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 <[email protected]> Acked-by: Chen-Yu Tsai <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 830f70c commit c2cac34

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/i2c/busses/i2c-sun6i-p2wi.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* The P2WI controller looks like an SMBus controller which only supports byte
1111
* data transfers. But, it differs from standard SMBus protocol on several
1212
* aspects:
13-
* - it supports only one slave device, and thus drop the address field
13+
* - it supports only one target device, and thus drop the address field
1414
* - it adds a parity bit every 8bits of data
1515
* - only one read access is required to read a byte (instead of a write
1616
* followed by a read access in standard SMBus protocol)
@@ -88,7 +88,7 @@ struct p2wi {
8888
void __iomem *regs;
8989
struct clk *clk;
9090
struct reset_control *rstc;
91-
int slave_addr;
91+
int target_addr;
9292
};
9393

9494
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,
121121
struct p2wi *p2wi = i2c_get_adapdata(adap);
122122
unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1);
123123

124-
if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) {
124+
if (p2wi->target_addr >= 0 && addr != p2wi->target_addr) {
125125
dev_err(&adap->dev, "invalid P2WI address\n");
126126
return -EINVAL;
127127
}
@@ -188,7 +188,7 @@ static int p2wi_probe(struct platform_device *pdev)
188188
unsigned long parent_clk_freq;
189189
u32 clk_freq = I2C_MAX_STANDARD_MODE_FREQ;
190190
struct p2wi *p2wi;
191-
u32 slave_addr;
191+
u32 target_addr;
192192
int clk_div;
193193
int irq;
194194
int ret;
@@ -207,32 +207,32 @@ static int p2wi_probe(struct platform_device *pdev)
207207
}
208208

209209
if (of_get_child_count(np) > 1) {
210-
dev_err(dev, "P2WI only supports one slave device\n");
210+
dev_err(dev, "P2WI only supports one target device\n");
211211
return -EINVAL;
212212
}
213213

214214
p2wi = devm_kzalloc(dev, sizeof(struct p2wi), GFP_KERNEL);
215215
if (!p2wi)
216216
return -ENOMEM;
217217

218-
p2wi->slave_addr = -1;
218+
p2wi->target_addr = -1;
219219

220220
/*
221221
* Authorize a p2wi node without any children to be able to use an
222222
* i2c-dev from userpace.
223-
* In this case the slave_addr is set to -1 and won't be checked when
223+
* In this case the target_addr is set to -1 and won't be checked when
224224
* launching a P2WI transfer.
225225
*/
226226
childnp = of_get_next_available_child(np, NULL);
227227
if (childnp) {
228-
ret = of_property_read_u32(childnp, "reg", &slave_addr);
228+
ret = of_property_read_u32(childnp, "reg", &target_addr);
229229
if (ret) {
230-
dev_err(dev, "invalid slave address on node %pOF\n",
230+
dev_err(dev, "invalid target address on node %pOF\n",
231231
childnp);
232232
return -EINVAL;
233233
}
234234

235-
p2wi->slave_addr = slave_addr;
235+
p2wi->target_addr = target_addr;
236236
}
237237

238238
p2wi->regs = devm_platform_ioremap_resource(pdev, 0);

0 commit comments

Comments
 (0)