linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] i2c: rework and extend RTL9300 I2C driver
@ 2025-07-01  9:17 Jonas Jelonek
  2025-07-01  9:17 ` [PATCH 1/3] i2c: rework RTL9300 I2C controller driver Jonas Jelonek
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Jonas Jelonek @ 2025-07-01  9:17 UTC (permalink / raw)
  To: linux-i2c; +Cc: Chris Packham, Markus Stockhausen, Jonas Jelonek

This patch series reworks the current implementation of the driver for
I2C controller integrated into RTL9300 SoCs to simplify support
extension, and adds support for the RTL9310 series.
Goal of this is to have RTL9310 support upstream in a proper
implementation to be able to drop downstream versions of this driver.

The first commit reworks the driver to use more of the regmap API.
Instead of using macros, all registers are defined as reg_field and most
operations on these registers are performed using regmap_field and the
corresponding API. This allows to add support for further chips quite
easily by providing the correct registers and driver data. Moreover, it
avoids to add new macros and a lot of chip-specific function for every
additional chip support.

The second commit makes use of this by adding support for the RTL9310
series, providing the slightly different register layout and a few
specifics. This also introduces a new device tree property 'scl-num' to
explicitly specify the hardware instance in the device tree. This is
needed because RTL9310 does SCL selection/activation in a global
register. In contrast, on RTL9300 this is done in a master-specific
register and thus is already handled by the reg_base of the controller.
At this point I'm still open to any suggestions if and how this could be
done better to avoid a new dt property.
Both has been tested successfully on RTL9302B-based Zyxel XGS1210-12
and RTL9313-based Netgear MS510TXM.

The third commit adds proper documentation to the device tree bindings
for the RTL9310 support.

Compile-tested with Linux, run-tested as backport in OpenWrt on the
aforementioned devices.

In case I messed something up, please give a hint and I'll fix it.

Jonas Jelonek (3):
  i2c: rework RTL9300 I2C controller driver
  i2c: add RTL9310 support to RTL9300 I2C controller driver
  dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support

 .../bindings/i2c/realtek,rtl9301-i2c.yaml     |  33 ++-
 drivers/i2c/busses/i2c-rtl9300.c              | 227 +++++++++++++-----
 2 files changed, 190 insertions(+), 70 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-07-02  9:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01  9:17 [PATCH 0/3] i2c: rework and extend RTL9300 I2C driver Jonas Jelonek
2025-07-01  9:17 ` [PATCH 1/3] i2c: rework RTL9300 I2C controller driver Jonas Jelonek
2025-07-02  0:36   ` Chris Packham
2025-07-01  9:17 ` [PATCH 2/3] i2c: add RTL9310 support to " Jonas Jelonek
2025-07-01 20:14   ` AW: " markus.stockhausen
2025-07-01  9:17 ` [PATCH 3/3] dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support Jonas Jelonek
2025-07-01 11:33   ` Krzysztof Kozlowski
2025-07-01 12:34     ` Jonas Jelonek
2025-07-01 13:17       ` Krzysztof Kozlowski
2025-07-01 14:31         ` Jonas Jelonek
2025-07-02  6:11           ` Krzysztof Kozlowski
2025-07-02  7:34             ` Jonas Jelonek
2025-07-02  7:49               ` Krzysztof Kozlowski
2025-07-02  9:24                 ` Jonas Jelonek
2025-07-01 11:35   ` Krzysztof Kozlowski
2025-07-01 12:34     ` Jonas Jelonek

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).