Linux I2C development
 help / color / mirror / Atom feed
* [PATCH] i2c: rtl9300: remove IO_MODE configuration
@ 2026-07-25  8:21 Michael Zavertkin
  2026-07-29 21:28 ` Andi Shyti
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Zavertkin @ 2026-07-25  8:21 UTC (permalink / raw)
  To: Chris Packham, Andi Shyti, linux-i2c, linux-kernel

IO_MODE is used to route peripheral controller to SoC pins. This is a
job for pinctrl driver.

Since select_scl now have nothing to do, remove it.

Signed-off-by: Michael Zavertkin <misha.zavertkin@mail.ru>
---
 drivers/i2c/busses/i2c-rtl9300.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
index 3a8225b0666c..c36c29e1833e 100644
--- a/drivers/i2c/busses/i2c-rtl9300.c
+++ b/drivers/i2c/busses/i2c-rtl9300.c
@@ -130,7 +130,6 @@ struct rtl9300_i2c_xfer {
 #define RTL9310_I2C_MST_DATA_CTRL			0x8
 
 #define RTL9607_I2C_CONFIG				0x22f50
-#define RTL9607_IO_MODE_EN				0x23014
 #define RTL9607_I2C_IND_WD				0x0
 #define RTL9607_I2C_IND_ADR				0x8
 #define RTL9607_I2C_IND_CMD				0x10
@@ -190,7 +189,6 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
 
 static int rtl9607_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan)
 {
-	const struct rtl9300_i2c_drv_data *drv_data;
 	int ret;
 
 	if (i2c->sda_num == chan->sda_num)
@@ -200,11 +198,6 @@ static int rtl9607_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
 	if (ret)
 		return ret;
 
-	drv_data = device_get_match_data(i2c->dev);
-	ret = drv_data->select_scl(i2c, i2c->scl_num);
-	if (ret)
-		return ret;
-
 	i2c->sda_num = chan->sda_num;
 	return 0;
 }
@@ -619,7 +612,6 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_drv_data = {
 
 static const struct rtl9300_i2c_drv_data rtl9607_i2c_drv_data = {
 	.field_desc = {
-		[F_SCL_SEL]		= GLB_REG_FIELD(RTL9607_IO_MODE_EN, 13, 14),
 		[F_EXT_SCK_5MS]		= MST_REG_FIELD(RTL9607_I2C_CONFIG, 26, 26),
 		[F_DEV_ADDR]		= MST_REG_FIELD(RTL9607_I2C_CONFIG, 14, 20),
 		[F_MEM_ADDR_WIDTH]	= MST_REG_FIELD(RTL9607_I2C_CONFIG, 12, 13),
@@ -631,7 +623,9 @@ static const struct rtl9300_i2c_drv_data rtl9607_i2c_drv_data = {
 		[F_I2C_TRIG]		= MST_REG_FIELD(RTL9607_I2C_IND_CMD, 0, 0),
 		[F_MEM_ADDR]		= MST_REG_FIELD(RTL9607_I2C_IND_ADR, 0, 31),
 	},
-	.select_scl = rtl9310_i2c_select_scl,
+	/*
+	 * No select_scl - single channel available
+	 */
 	.config_chan = rtl9607_i2c_config_chan,
 	.config_clock = rtl9607_i2c_config_clock,
 	.misc_init = rtl9607_i2c_init,
-- 
2.54.0


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

* Re: [PATCH] i2c: rtl9300: remove IO_MODE configuration
  2026-07-25  8:21 [PATCH] i2c: rtl9300: remove IO_MODE configuration Michael Zavertkin
@ 2026-07-29 21:28 ` Andi Shyti
  2026-07-31  7:08   ` Michael Zavertkin
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Shyti @ 2026-07-29 21:28 UTC (permalink / raw)
  To: Michael Zavertkin; +Cc: Chris Packham, linux-i2c, linux-kernel

Hi Michael,

On Sat, Jul 25, 2026 at 03:21:25PM +0700, Michael Zavertkin wrote:
> IO_MODE is used to route peripheral controller to SoC pins. This is a
> job for pinctrl driver.

where exactly is the pinctrl driver doing it?

Andi

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

* Re: [PATCH] i2c: rtl9300: remove IO_MODE configuration
  2026-07-29 21:28 ` Andi Shyti
@ 2026-07-31  7:08   ` Michael Zavertkin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Zavertkin @ 2026-07-31  7:08 UTC (permalink / raw)
  To: Andi Shyti; +Cc: chris.packham, linux-i2c, linux-kernel

On Wed, Jul 29, 2026 at 11:28:15PM +0200, Andi Shyti wrote:
> Hi Michael,
> 
> On Sat, Jul 25, 2026 at 03:21:25PM +0700, Michael Zavertkin wrote:
> > IO_MODE is used to route peripheral controller to SoC pins. This is a
> > job for pinctrl driver.
> 
> where exactly is the pinctrl driver doing it?
Not sure what you meant, but I'll try to give as full answer as possible

pinctrl driver should does it in set_mux() callback, while i2c DT node
initialization (correct group with correct function must be
specified in pinctrl-0 property)

The driver itself now going through code review in OpenWRT (I've been said
that the patches should go upstream, and I agree)
https://github.com/openwrt/openwrt/pull/23961

Since i2c driver for RTL9607C now requires proper connection with
pinctrl, should it be reflected in driver documentation (realtek,rtl9301-i2c.yaml)?
I.e. should pinctrl-0 be required? Or should it be pinctrl-names with
minItems: 1 like in some qcom i2c drivers (qcom,i2c-geni-qcom, qcom,i2c-qup)?


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

end of thread, other threads:[~2026-07-31  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25  8:21 [PATCH] i2c: rtl9300: remove IO_MODE configuration Michael Zavertkin
2026-07-29 21:28 ` Andi Shyti
2026-07-31  7:08   ` Michael Zavertkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox