]> Gentwo Git Trees - linux/.git/commit
i2c: rtl9300: use regmap fields and API for registers
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 27 Sep 2025 10:19:23 +0000 (10:19 +0000)
committerAndi Shyti <andi.shyti@kernel.org>
Sat, 4 Oct 2025 09:43:40 +0000 (11:43 +0200)
commit85f1c01ce2f98a4925d2610d9d3f4c2749eb9331
tree225439ef9ca801b51f3f9d9639a3fef65a1b117e
parentd3c2191d493a9a017ea816f3b38dfbcadb6cccb5
i2c: rtl9300: use regmap fields and API for registers

Adapt the RTL9300 I2C controller driver to use more of the regmap
API, especially make use of reg_field and regmap_field instead of macros
to represent registers. Most register operations are performed through
regmap_field_* API then.

Handle SCL selection using separate chip-specific functions since this
is already known to differ between the Realtek SoC families in such a
way that this cannot be properly handled using just a different
reg_field.

This makes it easier to add support for newer generations or to handle
differences between specific revisions within a series. Just by
defining a separate driver data structure with the corresponding
register field definitions and linking it to a new compatible.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Tested-by: Sven Eckelmann <sven@narfation.org>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250927101931.71575-2-jelonek.jonas@gmail.com
drivers/i2c/busses/i2c-rtl9300.c