[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250809220713.1038947-1-jelonek.jonas@gmail.com>
Date: Sat, 9 Aug 2025 22:07:01 +0000
From: Jonas Jelonek <jelonek.jonas@...il.com>
To: Chris Packham <chris.packham@...iedtelesis.co.nz>,
Andi Shyti <andi.shyti@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>
Cc: linux-i2c@...r.kernel.org,
Conor Dooley <conor+dt@...nel.org>,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Markus Stockhausen <markus.stockhausen@....de>,
Sven Eckelmann <sven@...fation.org>,
Harshal Gohel <hg@...onwunderlich.de>,
Jonas Jelonek <jelonek.jonas@...il.com>
Subject: [PATCH v5 00/11] i2c: rework and extend RTL9300 I2C driver
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
Powered by blists - more mailing lists