realtek: backport upstream RTL9300 I2C driver
authorJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 24 Jun 2025 16:22:00 +0000 (16:22 +0000)
committerRobert Marko <robimarko@gmail.com>
Wed, 13 Aug 2025 12:23:35 +0000 (14:23 +0200)
commit44655c97bb67419225235c2cf24cb53d750c0771
treedbfa3349e134f02ab23b139b4cb73266d6611338
parente005cdea10284975e81e77282d654a358f33d640
realtek: backport upstream RTL9300 I2C driver

Backport/add all patches for the upstream RTL9300 I2C driver.

The upstream driver was added in 6.13 and was heavily based on our
downstream driver except for how the multiplexing behaviour is handled.
This driver was working fine with basic SFP operation on RTL930x devices
but there was no support for RTL931x though.

Major advantage over our downstream driver is: The multiplexing
behaviour is handled completely by the driver. Thus, there's no need for
a separate rtl9300-mux driver as we had it downstream. Moreover, this
simplifies the DTS of affected devices a lot since we can now move the
controller definition - which is in the DTS of each device so far - to
the base DTSI.

Currently pending patches are also included because the progress on
getting this upstream seems really slow right now, albeit upstream
maintainers may require several changes to the current state.

These include:
- patches fixing several issues in the driver
- patches doing a refactoring of the driver and adding support for RTL931x

See the commit messages included in each patch to have details on the
changes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19736
Signed-off-by: Robert Marko <robimarko@gmail.com>
19 files changed:
target/linux/realtek/patches-6.12/003-v6.13-01-dt-bindings-i2c-Add-Realtek-RTL-I2C-Controller.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/003-v6.13-02-i2c-Add-driver-for-the-RTL9300-I2C-controller.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/004-v6.16-dt-bindings-i2c-realtek-rtl9301-Fix-missing-reg-cons.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/100-01-i2c-rtl9300-Fix-out-of-bounds-bug-in-rtl9300_i2c_smb.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/100-02-i2c-rtl9300-Fix-multi-byte-I2C-write.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/100-03-i2c-rtl9300-Increase-timeout-for-transfer-polling.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/100-04-i2c-rtl9300-Add-missing-count-byte-for-SMBus-Block-O.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/100-05-i2c-rtl9300-Implement-I2C-block-read-and-write.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-01-i2c-rtl9300-use-regmap-fields-and-API-for-registe.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-02-i2c-rtl9300-fix-channel-number-bound-check.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-03-dt-bindings-i2c-realtek-rtl9301-i2c-fix-wording-a.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-04-i2c-rtl9300-rename-internal-sda_pin-to-sda_num.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-05-i2c-rtl9300-check-if-xfer-length-is-valid.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-06-i2c-rtl9300-remove-SMBus-Quick-operation-support.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-07-i2c-rtl9300-move-setting-SCL-frequency-to-config_.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-08-i2c-rtl9300-do-not-set-read-mode-on-every-transfe.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-09-i2c-rtl9300-separate-xfer-configuration-and-execu.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-10-dt-bindings-i2c-realtek-rtl9301-i2c-extend-for-RT.patch [new file with mode: 0644]
target/linux/realtek/patches-6.12/101-11-i2c-rtl9300-add-support-for-RTL9310-I2C-controlle.patch [new file with mode: 0644]