linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 00/11] i2c: rework and extend RTL9300 I2C driver
@ 2025-08-09 22:07 Jonas Jelonek
  2025-08-09 22:07 ` [PATCH v5 01/11] i2c: rtl9300: use regmap fields and API for registers Jonas Jelonek
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: Jonas Jelonek @ 2025-08-09 22:07 UTC (permalink / raw)
  To: Chris Packham, Andi Shyti, Rob Herring, Krzysztof Kozlowski
  Cc: linux-i2c, Conor Dooley, devicetree, linux-kernel,
	Markus Stockhausen, Sven Eckelmann, Harshal Gohel, Jonas Jelonek

This patch series reworks the current implementation of the driver for
I2C controller integrated into RTL9300 SoCs to have better overall code
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 patch changes the driver to use more of the regmap API.
Instead of using macros, all registers are defined as reg_field and
operations on these registers are performed using regmap_field and the
corresponding API. This simplifies adding support for further chip
families and avoids potential redundant code by just providing
chip-specific functions for every chip family.

Further patches add some checks to fix issues based on incorrect passed
values, remove SMBus Quick support (not actually supported by hardware)
and reorder some operations to be at a proper location.

The last patch and penultimate patch add support for RTL9310 series to
the driver and adjust the dt-bindings accordingly.

Simple operations have been tested successfully on RTL9302B-based Zyxel
XGS1210-12 and RTL9313-based Netgear MS510TXM, with simple SFP EEPROM
read. Other operations need testing from people with devices available.

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

I splitted the changes to my best knowledge, to simplify review. If
suggested, I might combine some of them for final merge.

--
Changelog

v5: - added more patches to fix further issues/do further cleanup
        - remove SMBus Quick support (not supported by hardware)
        - move setting SCL frequency to config_io
        - only set read message format (RD_MODE) once on probing
        - add check to avoid len = 0 being allowed as length
    - adjusted cover letter

v4: - fixed an incorrect check for number of channels which was already
      present in original code

v3: - narrowed vendor property per variant to be required only
      for RTL9310
    - narrowed usable child-node i2c addresses per variant
    - no changes to driver patches

v2: - Patch 1:
        - adjusted commit message
        - retained Tested-By and Reviewed-By from Chris Packham
    - Patch 2:
        - simplified check as suggested by Markus Stockhausen
        - fixed commit message
    - Patch 3 (all requested by Krzysztof):
        - use vendor property instead of generic
        - add front compatibles to make binding complete
        - fix commit message
    - reordered patches, dt-bindings patch now comes before its 'user'
    - properly add device-tree list and relevant maintainers to To/Cc

--

Jonas Jelonek (11):
  i2c: rtl9300: use regmap fields and API for registers
  i2c: rtl9300: fix channel number bound check
  dt-bindings: i2c: realtek,rtl9301-i2c: fix wording and typos
  i2c: rtl9300: rename internal sda_pin to sda_num
  i2c: rtl9300: check if xfer length is valid
  i2c: rtl9300: remove SMBus Quick operation support
  i2c: rtl9300: move setting SCL frequency to config_io
  i2c: rtl9300: do not set read mode on every transfer
  i2c: rtl9300: separate xfer configuration and execution
  dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support
  i2c: rtl9300: add support for RTL9310 I2C controller

 .../bindings/i2c/realtek,rtl9301-i2c.yaml     |  45 +-
 drivers/i2c/busses/i2c-rtl9300.c              | 477 +++++++++++-------
 2 files changed, 321 insertions(+), 201 deletions(-)


base-commit: 7e161a991ea71e6ec526abc8f40c6852ebe3d946
prerequisite-patch-id: 603f6da5f9ccbf40aa1e8247144e2413f676ef24
prerequisite-patch-id: 4328bb2802794cbd46f4952a22cbc73e022d0c12
prerequisite-patch-id: 90d8673eb6c9444937ea335ae8a934414e0a9ecd
prerequisite-patch-id: de876ceafb623d95a41af42b3e3dae7538023e33
prerequisite-patch-id: ecc2a415352d9ed09975b06b97b750b5182f4147
-- 
2.48.1


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

end of thread, other threads:[~2025-08-18 15:13 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-09 22:07 [PATCH v5 00/11] i2c: rework and extend RTL9300 I2C driver Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 01/11] i2c: rtl9300: use regmap fields and API for registers Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 02/11] i2c: rtl9300: fix channel number bound check Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 03/11] dt-bindings: i2c: realtek,rtl9301-i2c: fix wording and typos Jonas Jelonek
2025-08-18 15:10   ` Rob Herring (Arm)
2025-08-09 22:07 ` [PATCH v5 04/11] i2c: rtl9300: rename internal sda_pin to sda_num Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 05/11] i2c: rtl9300: check if xfer length is valid Jonas Jelonek
2025-08-10  5:51   ` Wolfram Sang
2025-08-10  7:01     ` Sven Eckelmann
2025-08-10  9:22       ` Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 06/11] i2c: rtl9300: remove SMBus Quick operation support Jonas Jelonek
2025-08-10  7:13   ` Sven Eckelmann
2025-08-10  9:31     ` Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 07/11] i2c: rtl9300: move setting SCL frequency to config_io Jonas Jelonek
2025-08-10  8:49   ` Markus Elfring
2025-08-10  8:54     ` Sven Eckelmann
2025-08-10  9:10     ` Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 08/11] i2c: rtl9300: do not set read mode on every transfer Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 09/11] i2c: rtl9300: separate xfer configuration and execution Jonas Jelonek
2025-08-09 22:07 ` [PATCH v5 10/11] dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support Jonas Jelonek
2025-08-18 15:13   ` Rob Herring (Arm)
2025-08-09 22:07 ` [PATCH v5 11/11] i2c: rtl9300: add support for RTL9310 I2C controller Jonas Jelonek
2025-08-10 10:39   ` Sven Eckelmann

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