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

Configure Feed

Select the types of activity you want to include in your feed.

i2c: rtl9300: introduce F_BUSY to the reg_fields struct

In RTL9607C i2c controller the busy check operation is done on the
separate bit of the command register as opposed to self clearing
command trigger bit on the rtl9300 and rtl9310 i2c controllers.

Introduce a new F_BUSY field to the reg_fields struct for that
and change the regmap read poll function to use F_BUSY
instead of I2C_TRIG.

Signed-off-by: Rustam Adilov <adilov@disroot.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260401180648.337834-4-adilov@disroot.org

authored by

Rustam Adilov and committed by
Andi Shyti
55284a80 98773df6

+4 -1
+4 -1
drivers/i2c/busses/i2c-rtl9300.c
··· 53 53 F_SCL_SEL, 54 54 F_SDA_OUT_SEL, 55 55 F_SDA_SEL, 56 + F_BUSY, 56 57 57 58 /* keep last */ 58 59 F_NUM_FIELDS ··· 263 262 if (ret) 264 263 return ret; 265 264 266 - ret = regmap_field_read_poll_timeout(i2c->fields[F_I2C_TRIG], val, !val, 100, 100000); 265 + ret = regmap_field_read_poll_timeout(i2c->fields[F_BUSY], val, !val, 100, 100000); 267 266 if (ret) 268 267 return ret; 269 268 ··· 506 505 [F_MEM_ADDR_WIDTH] = MST_REG_FIELD(RTL9300_I2C_MST_CTRL2, 2, 3), 507 506 [F_SCL_FREQ] = MST_REG_FIELD(RTL9300_I2C_MST_CTRL2, 0, 1), 508 507 [F_SDA_SEL] = GLB_REG_FIELD(RTL9300_I2C_MST_GLB_CTRL, 0, 7), 508 + [F_BUSY] = MST_REG_FIELD(RTL9300_I2C_MST_CTRL1, 0, 0), 509 509 }, 510 510 .select_scl = rtl9300_i2c_select_scl, 511 511 .rd_reg = RTL9300_I2C_MST_DATA_WORD0, ··· 529 527 [F_I2C_FAIL] = MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 1, 1), 530 528 [F_I2C_TRIG] = MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0), 531 529 [F_MEM_ADDR] = MST_REG_FIELD(RTL9310_I2C_MST_MEMADDR_CTRL, 0, 23), 530 + [F_BUSY] = MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0), 532 531 }, 533 532 .select_scl = rtl9310_i2c_select_scl, 534 533 .rd_reg = RTL9310_I2C_MST_DATA_CTRL,