public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kantert <jan-kernel@kantert.net>
To: chris.packham@alliedtelesis.co.nz, linux-i2c@vger.kernel.org
Cc: Jan Kantert <jan-kernel@kantert.net>
Subject: [PATCH] i2c: rtl9300: add support for 50 kHz and 2.5 MHz bus speeds
Date: Fri, 27 Feb 2026 12:11:34 +0100	[thread overview]
Message-ID: <20260227111134.2163701-1-jan-kernel@kantert.net> (raw)

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>
---
 drivers/i2c/busses/i2c-rtl9300.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
index 672cb978066d..67a5c4228fc9 100644
--- a/drivers/i2c/busses/i2c-rtl9300.c
+++ b/drivers/i2c/busses/i2c-rtl9300.c
@@ -11,10 +11,16 @@
 #include <linux/unaligned.h>
 
 enum rtl9300_bus_freq {
-	RTL9300_I2C_STD_FREQ,
-	RTL9300_I2C_FAST_FREQ,
+	RTL9300_I2C_STD_FREQ,			// 100kHz
+	RTL9300_I2C_FAST_FREQ,			// 400kHz
+	RTL9300_I2C_SUPER_FAST_FREQ,		// 2.5MHz
+	RTL9300_I2C_SLOW_FREQ,			// 50kHz
 };
 
+#define RTL9300_I2C_MAX_SUPER_FAST_FREQ		2500000
+#define RTL9300_I2C_MAX_SLOW_FREQ		50000
+
+
 struct rtl9300_i2c;
 
 struct rtl9300_i2c_chan {
@@ -433,6 +439,12 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
 		case I2C_MAX_FAST_MODE_FREQ:
 			chan->bus_freq = RTL9300_I2C_FAST_FREQ;
 			break;
+		case RTL9300_I2C_MAX_SUPER_FAST_FREQ:
+			chan->bus_freq = RTL9300_I2C_SUPER_FAST_FREQ;
+			break;
+		case RTL9300_I2C_MAX_SLOW_FREQ:
+			chan->bus_freq = RTL9300_I2C_SLOW_FREQ;
+			break;
 		default:
 			dev_warn(i2c->dev, "SDA%d clock-frequency %d not supported using default\n",
 				 sda_num, clock_freq);
-- 
2.34.1


             reply	other threads:[~2026-02-27 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27 11:11 Jan Kantert [this message]
2026-03-01 19:19 ` [PATCH] i2c: rtl9300: add support for 50 kHz and 2.5 MHz bus speeds Chris Packham
2026-04-01 22:06 ` Andi Shyti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260227111134.2163701-1-jan-kernel@kantert.net \
    --to=jan-kernel@kantert.net \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox