Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: rtl9300: add support for 50 kHz and 2.5 MHz bus speeds

Some SFP modules on certain switches (for example the ONTi ONT-S508CL-8S and
XikeStor SKS8300-8X) exhibit unreliable I2C communication at the currently
supported speeds. Add support for 50 kHz and 2.5 MHz I2C bus modes on the
RTL9300 to improve compatibility with these devices.

Signed-off-by: Jan Kantert <jan-kernel@kantert.net>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260227111134.2163701-1-jan-kernel@kantert.net

authored by

Jan Kantert and committed by
Andi Shyti
879766b5 d3e2c747

+14 -2
+14 -2
drivers/i2c/busses/i2c-rtl9300.c
··· 11 11 #include <linux/unaligned.h> 12 12 13 13 enum rtl9300_bus_freq { 14 - RTL9300_I2C_STD_FREQ, 15 - RTL9300_I2C_FAST_FREQ, 14 + RTL9300_I2C_STD_FREQ, // 100kHz 15 + RTL9300_I2C_FAST_FREQ, // 400kHz 16 + RTL9300_I2C_SUPER_FAST_FREQ, // 2.5MHz 17 + RTL9300_I2C_SLOW_FREQ, // 50kHz 16 18 }; 19 + 20 + #define RTL9300_I2C_MAX_SUPER_FAST_FREQ 2500000 21 + #define RTL9300_I2C_MAX_SLOW_FREQ 50000 22 + 17 23 18 24 struct rtl9300_i2c; 19 25 ··· 438 432 break; 439 433 case I2C_MAX_FAST_MODE_FREQ: 440 434 chan->bus_freq = RTL9300_I2C_FAST_FREQ; 435 + break; 436 + case RTL9300_I2C_MAX_SUPER_FAST_FREQ: 437 + chan->bus_freq = RTL9300_I2C_SUPER_FAST_FREQ; 438 + break; 439 + case RTL9300_I2C_MAX_SLOW_FREQ: 440 + chan->bus_freq = RTL9300_I2C_SLOW_FREQ; 441 441 break; 442 442 default: 443 443 dev_warn(i2c->dev, "SDA%d clock-frequency %d not supported using default\n",