Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <wsa+renesas@sang-engineering.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Wolfram Sang and committed by
Andi Shyti
c2cac347 830f70cf

+10 -10
+10 -10
drivers/i2c/busses/i2c-sun6i-p2wi.c
··· 10 10 * The P2WI controller looks like an SMBus controller which only supports byte 11 11 * data transfers. But, it differs from standard SMBus protocol on several 12 12 * 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 14 14 * - it adds a parity bit every 8bits of data 15 15 * - only one read access is required to read a byte (instead of a write 16 16 * followed by a read access in standard SMBus protocol) ··· 88 88 void __iomem *regs; 89 89 struct clk *clk; 90 90 struct reset_control *rstc; 91 - int slave_addr; 91 + int target_addr; 92 92 }; 93 93 94 94 static irqreturn_t p2wi_interrupt(int irq, void *dev_id) ··· 121 121 struct p2wi *p2wi = i2c_get_adapdata(adap); 122 122 unsigned long dlen = P2WI_DLEN_DATA_LENGTH(1); 123 123 124 - if (p2wi->slave_addr >= 0 && addr != p2wi->slave_addr) { 124 + if (p2wi->target_addr >= 0 && addr != p2wi->target_addr) { 125 125 dev_err(&adap->dev, "invalid P2WI address\n"); 126 126 return -EINVAL; 127 127 } ··· 188 188 unsigned long parent_clk_freq; 189 189 u32 clk_freq = I2C_MAX_STANDARD_MODE_FREQ; 190 190 struct p2wi *p2wi; 191 - u32 slave_addr; 191 + u32 target_addr; 192 192 int clk_div; 193 193 int irq; 194 194 int ret; ··· 207 207 } 208 208 209 209 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"); 211 211 return -EINVAL; 212 212 } 213 213 ··· 215 215 if (!p2wi) 216 216 return -ENOMEM; 217 217 218 - p2wi->slave_addr = -1; 218 + p2wi->target_addr = -1; 219 219 220 220 /* 221 221 * Authorize a p2wi node without any children to be able to use an 222 222 * 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 224 224 * launching a P2WI transfer. 225 225 */ 226 226 childnp = of_get_next_available_child(np, NULL); 227 227 if (childnp) { 228 - ret = of_property_read_u32(childnp, "reg", &slave_addr); 228 + ret = of_property_read_u32(childnp, "reg", &target_addr); 229 229 if (ret) { 230 - dev_err(dev, "invalid slave address on node %pOF\n", 230 + dev_err(dev, "invalid target address on node %pOF\n", 231 231 childnp); 232 232 return -EINVAL; 233 233 } 234 234 235 - p2wi->slave_addr = slave_addr; 235 + p2wi->target_addr = target_addr; 236 236 } 237 237 238 238 p2wi->regs = devm_platform_ioremap_resource(pdev, 0);