From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75CBC35BDA7; Mon, 23 Mar 2026 07:14:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250049; cv=none; b=TdOpEOHz0owSR3sSOA/5qXzsZQO9w5bxFqGeq+727LfyI6HVLBFE9w2YEh8s8uBySQlhZ1MqBYrFoToxokiQxkwzyqXUnikxqNAHk+KjkZKEybfjnn3nRh8PG3n1uAjeGjbyw8dHpGWq6lcHgr92Vd3iRKhTvkwBuq3lcVj4zd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250049; c=relaxed/simple; bh=gLVZnYH8RyztHWedBiBheyvBydAbsVMkC5d77hHYZlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ONUf+BP3B9soK+w7gFxdrRfXsoNt7D4Lwo981D2z+negeU/SxZ3ayvCubad5YFlyX2ZQj8HfAX+p4UwHMvUYXgvJRV1xkAQebl+4tMWv/GmyxHygZR728jZb6HRqfaipOx/ZI9VjC6SROAEqvK+LxwD9n4Vzc+zK3pMzGyDWQZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=U+gM+0gN; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="U+gM+0gN" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 22B5E26E75; Mon, 23 Mar 2026 08:14:06 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1qItY33FDTtG; Mon, 23 Mar 2026 08:14:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250045; bh=gLVZnYH8RyztHWedBiBheyvBydAbsVMkC5d77hHYZlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=U+gM+0gNBuymEwi3lLFZKOmKFpTLkRE2QGc8UTP13NZC1JYYIN1O4jhmc4ZSxy8rH vZ5+r33jt6DWJNrgIE6hag4yksM9uJ4b4mCeqK2mbrDCzx7ew3bw9zz/dfD6f6TYsp Rtu2ukIA+7J4FuGHw1yRw6WuWAD9oLQH4FCxyjS6qzetC1UZ5Fc1BD3D9BFSnbol40 zXGSKdKQ0rLFYHodOvipcqU87ro6mhU+LWmx9T/9pBKiRBGJ6oZQuQGZ1ZnAJu/w5r s4FByYEuouiAhx0h1HNgecAbgCHADN5mVp41enWp99jBenWj+p7s97FFJNehlFFpeC ya/kATkN/MuQw== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 1/8] i2c: rtl9300: split data_reg into read and write reg Date: Mon, 23 Mar 2026 12:13:30 +0500 Message-ID: <20260323071337.15410-2-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In RTL9607C i2c controller, there are 2 separate registers for reads and writes as opposed the combined 1 on rtl9300 and rtl9310. In preparation for RTL9607C support, split it up into rd_reg and wd_reg properties and change the i2c read and write functions accordingly. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index 67a5c4228fc9..9bf4c6b08e05 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -61,7 +61,8 @@ enum rtl9300_i2c_reg_fields { struct rtl9300_i2c_drv_data { struct rtl9300_i2c_reg_field field_desc[F_NUM_FIELDS]; int (*select_scl)(struct rtl9300_i2c *i2c, u8 scl); - u32 data_reg; + u32 rd_reg; + u32 wd_reg; u8 max_nchan; }; =20 @@ -74,7 +75,8 @@ struct rtl9300_i2c { struct rtl9300_i2c_chan chans[RTL9310_I2C_MUX_NCHAN]; struct regmap_field *fields[F_NUM_FIELDS]; u32 reg_base; - u32 data_reg; + u32 rd_reg; + u32 wd_reg; u8 scl_num; u8 sda_num; struct mutex lock; @@ -171,7 +173,7 @@ static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8= *buf, u8 len) if (len > 16) return -EIO; =20 - ret =3D regmap_bulk_read(i2c->regmap, i2c->data_reg, vals, ARRAY_SIZE(val= s)); + ret =3D regmap_bulk_read(i2c->regmap, i2c->rd_reg, vals, ARRAY_SIZE(vals)= ); if (ret) return ret; =20 @@ -198,12 +200,12 @@ static int rtl9300_i2c_write(struct rtl9300_i2c *i2c,= u8 *buf, u8 len) vals[reg] |=3D buf[i] << shift; } =20 - return regmap_bulk_write(i2c->regmap, i2c->data_reg, vals, ARRAY_SIZE(val= s)); + return regmap_bulk_write(i2c->regmap, i2c->wd_reg, vals, ARRAY_SIZE(vals)= ); } =20 static int rtl9300_i2c_writel(struct rtl9300_i2c *i2c, u32 data) { - return regmap_write(i2c->regmap, i2c->data_reg, data); + return regmap_write(i2c->regmap, i2c->wd_reg, data); } =20 static int rtl9300_i2c_prepare_xfer(struct rtl9300_i2c *i2c, struct rtl930= 0_i2c_xfer *xfer) @@ -268,14 +270,14 @@ static int rtl9300_i2c_do_xfer(struct rtl9300_i2c *i2= c, struct rtl9300_i2c_xfer if (!xfer->write) { switch (xfer->type) { case RTL9300_I2C_XFER_BYTE: - ret =3D regmap_read(i2c->regmap, i2c->data_reg, &val); + ret =3D regmap_read(i2c->regmap, i2c->rd_reg, &val); if (ret) return ret; =20 *xfer->data =3D val & 0xff; break; case RTL9300_I2C_XFER_WORD: - ret =3D regmap_read(i2c->regmap, i2c->data_reg, &val); + ret =3D regmap_read(i2c->regmap, i2c->rd_reg, &val); if (ret) return ret; =20 @@ -408,7 +410,8 @@ static int rtl9300_i2c_probe(struct platform_device *pd= ev) if (device_get_child_node_count(dev) > drv_data->max_nchan) return dev_err_probe(dev, -EINVAL, "Too many channels\n"); =20 - i2c->data_reg =3D i2c->reg_base + drv_data->data_reg; + i2c->rd_reg =3D i2c->reg_base + drv_data->rd_reg; + i2c->wd_reg =3D i2c->reg_base + drv_data->wd_reg; for (i =3D 0; i < F_NUM_FIELDS; i++) { fields[i] =3D drv_data->field_desc[i].field; if (drv_data->field_desc[i].scope =3D=3D REG_SCOPE_MASTER) @@ -499,7 +502,8 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_dr= v_data =3D { [F_SDA_SEL] =3D GLB_REG_FIELD(RTL9300_I2C_MST_GLB_CTRL, 0, 7), }, .select_scl =3D rtl9300_i2c_select_scl, - .data_reg =3D RTL9300_I2C_MST_DATA_WORD0, + .rd_reg =3D RTL9300_I2C_MST_DATA_WORD0, + .wd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .max_nchan =3D RTL9300_I2C_MUX_NCHAN, }; =20 @@ -519,7 +523,8 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_dr= v_data =3D { [F_MEM_ADDR] =3D MST_REG_FIELD(RTL9310_I2C_MST_MEMADDR_CTRL, 0, 23), }, .select_scl =3D rtl9310_i2c_select_scl, - .data_reg =3D RTL9310_I2C_MST_DATA_CTRL, + .rd_reg =3D RTL9310_I2C_MST_DATA_CTRL, + .wd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .max_nchan =3D RTL9310_I2C_MUX_NCHAN, }; =20 --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FD3535CB6F; Mon, 23 Mar 2026 07:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250051; cv=none; b=l7mljSBtSHfW3QmCyJ0NyWPCai/w6C2EfSOhC7opzIVMHZpSafgUbOKPipHiTYrOrLqENGPDk/2H5mDFB97DcI69PGRyZ26o26EA0/6726FF6sNuI1vZZEhVTomo7JPhT6Fa6JwXxZTFeC+0Odlt8wkg7ajt3bGGxYqtQORrhLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250051; c=relaxed/simple; bh=78qH5nIWIELIDV6PJGBxhJTVaTi35H4kfKGiY4tduC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RoNyN3kvaaHScPlMtCGMwXcvQ3TANMnQ4P3F3k3RMeEYGWVs42FZ7wsH2+Xz63s3c/mi/edaSKpCRIVzyy1K8SsALt5+mIPMmkBslUzoGS+Yf4i1XB+0XMcQY536eV2PtJqSK4+WW3998DCCFthCu7veUJvfUEt2Jn4HUAnAas8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=OnX3S6+B; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="OnX3S6+B" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C967526F37; Mon, 23 Mar 2026 08:14:08 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 9Rg9mkcuE9jR; Mon, 23 Mar 2026 08:14:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250048; bh=78qH5nIWIELIDV6PJGBxhJTVaTi35H4kfKGiY4tduC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OnX3S6+BnP5VdU5Zh6cnnKuQR5p2Z9GUB3B27YwxEvHJnZTFtyHKYcmafeS5GrOPh NY9XmR42k4JLtmtksExKQmUJ0fRNGxtMEQ9cbBaAWmTKE3nuUvlUIstSrg2iwFyRgu ICnc9V+ugA0ILNCGHh2Xd8OAktxjUh/qRfGJqo3rATUR3hBGTfvS8GsrckO4fWJ7xO aJfZnRUrR6Rth+mWCPRonx0vOgFFsO946zRCQ/VHTTRqEK4PBVOGNsqQZHMzM4MJMA 6XnC/pgTmblb27VdlxOoc7LCX5eOKmD5r56b4w6Flr7Ct1yWyI4x8K5dLE2yhwbyrj mMeTr7/ro4wKw== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 2/8] i2c: rtl9300: introduce max length property to driver data Date: Mon, 23 Mar 2026 12:13:31 +0500 Message-ID: <20260323071337.15410-3-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In RTL9607C i2c controller, theoretical maximum the data length can be is 4 bytes as opposed to 16 bytes on rtl9300 and rtl9310. Introduce a new property to the driver data struct for that. Adjust if statement in prepare_xfer function to follow that new property instead of the hardcoded value. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index 9bf4c6b08e05..2cada6038b44 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -64,11 +64,14 @@ struct rtl9300_i2c_drv_data { u32 rd_reg; u32 wd_reg; u8 max_nchan; + u8 max_data_len; }; =20 #define RTL9300_I2C_MUX_NCHAN 8 #define RTL9310_I2C_MUX_NCHAN 12 =20 +#define RTL9300_I2C_MAX_DATA_LEN 16 + struct rtl9300_i2c { struct regmap *regmap; struct device *dev; @@ -210,9 +213,11 @@ static int rtl9300_i2c_writel(struct rtl9300_i2c *i2c,= u32 data) =20 static int rtl9300_i2c_prepare_xfer(struct rtl9300_i2c *i2c, struct rtl930= 0_i2c_xfer *xfer) { + const struct rtl9300_i2c_drv_data *drv_data; int ret; =20 - if (xfer->data_len < 1 || xfer->data_len > 16) + drv_data =3D device_get_match_data(i2c->dev); + if (xfer->data_len < 1 || xfer->data_len > drv_data->max_data_len) return -EINVAL; =20 ret =3D regmap_field_write(i2c->fields[F_DEV_ADDR], xfer->dev_addr); @@ -505,6 +510,7 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_dr= v_data =3D { .rd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .wd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .max_nchan =3D RTL9300_I2C_MUX_NCHAN, + .max_data_len =3D RTL9300_I2C_MAX_DATA_LEN, }; =20 static const struct rtl9300_i2c_drv_data rtl9310_i2c_drv_data =3D { @@ -526,6 +532,7 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_dr= v_data =3D { .rd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .wd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .max_nchan =3D RTL9310_I2C_MUX_NCHAN, + .max_data_len =3D RTL9300_I2C_MAX_DATA_LEN, }; =20 static const struct of_device_id i2c_rtl9300_dt_ids[] =3D { --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C385835CB6E; Mon, 23 Mar 2026 07:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250055; cv=none; b=jWFJHw3pm9uAgntz8oop3tC9OVGzESGLbXaQAde9xH03842+R+NRfsp9gCKTFn2FBjj82A75R/wP2Mo8vcoknHAk9FZgsG06apMgyrXQuLn+PQd6xn+/myPVm9P/HijjOLXweLaVjWTldesHIIj+t2pPLwxgM48Q3+nLI1JVAoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250055; c=relaxed/simple; bh=GwaO3Jgs7I+IjOxIFQXKkawzKx2llBDskSmUtS3EUww=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ntzp0NfzimevEI8Xec5dwyJJRqcUUQkxHTTzbqPzjj5bi8h69RjRLm7tqcu4N4oHs+5l7/zgy9OM0BwpJcpP6Sf7F2/f+Vzl4qX7EkEs4ciyaRJ20N85rTCOGUY2RVHFBnWS/5pqL51qK0wbY1IOG+Ds1E2ec8GNEmQTKsOC4wc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=LwDS8Obc; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="LwDS8Obc" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6927326E75; Mon, 23 Mar 2026 08:14:12 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nIWg8zhIfRCh; Mon, 23 Mar 2026 08:14:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250051; bh=GwaO3Jgs7I+IjOxIFQXKkawzKx2llBDskSmUtS3EUww=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LwDS8ObcWoSMcO8nSeoBhxyVKOjuv88eoxyuucqKwom4+CICBgh193qT75znbKCGC r1O5BmNWn3E7+4yyIxmH6WW8Kpav7f0SUYBt7cjYeCCDlCCzWnMg4EpztcSeDHrhSx Jzdva5D+zgnxdE+vm/S5Ql5oJ+SGcKCMu2vEJeFdnuT9QKoQCzIotEFq/NGSi4CDFq vPFzD/ATTZxOqzSdPg9CfToLN8wwxEzPZh2bf4NJ+J4S+5nAdYagpF2UvPees+FsHJ qEp+XXBI8/tFUK7jUMmA6mj5YaQYrhRrsq7wJwKi8OqBEdawRg2zAR+wRW+GV9h38m KZtEY8aIxAYpQ== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 3/8] i2c: rtl9300: introduce F_BUSY to the reg_fields struct Date: Mon, 23 Mar 2026 12:13:32 +0500 Message-ID: <20260323071337.15410-4-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In RTL9607C i2c controller the busy check operation is done on the separate bit of the command register as opposed to self clearing command trigger bit on the rtl9300 and rtl9310 i2c controllers. Introduce a new F_BUSY field to the reg_fields struct for that and change the regmap read poll function to use F_BUSY instead of I2C_TRIG. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index 2cada6038b44..e40b4692a3fa 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -53,6 +53,7 @@ enum rtl9300_i2c_reg_fields { F_SCL_SEL, F_SDA_OUT_SEL, F_SDA_SEL, + F_BUSY, =20 /* keep last */ F_NUM_FIELDS @@ -262,7 +263,7 @@ static int rtl9300_i2c_do_xfer(struct rtl9300_i2c *i2c,= struct rtl9300_i2c_xfer if (ret) return ret; =20 - ret =3D regmap_field_read_poll_timeout(i2c->fields[F_I2C_TRIG], val, !val= , 100, 100000); + ret =3D regmap_field_read_poll_timeout(i2c->fields[F_BUSY], val, !val, 10= 0, 100000); if (ret) return ret; =20 @@ -505,6 +506,7 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_dr= v_data =3D { [F_MEM_ADDR_WIDTH] =3D MST_REG_FIELD(RTL9300_I2C_MST_CTRL2, 2, 3), [F_SCL_FREQ] =3D MST_REG_FIELD(RTL9300_I2C_MST_CTRL2, 0, 1), [F_SDA_SEL] =3D GLB_REG_FIELD(RTL9300_I2C_MST_GLB_CTRL, 0, 7), + [F_BUSY] =3D MST_REG_FIELD(RTL9300_I2C_MST_CTRL1, 0, 0), }, .select_scl =3D rtl9300_i2c_select_scl, .rd_reg =3D RTL9300_I2C_MST_DATA_WORD0, @@ -527,6 +529,7 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_dr= v_data =3D { [F_I2C_FAIL] =3D MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 1, 1), [F_I2C_TRIG] =3D MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0), [F_MEM_ADDR] =3D MST_REG_FIELD(RTL9310_I2C_MST_MEMADDR_CTRL, 0, 23), + [F_BUSY] =3D MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0), }, .select_scl =3D rtl9310_i2c_select_scl, .rd_reg =3D RTL9310_I2C_MST_DATA_CTRL, --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E0E935BDA7; Mon, 23 Mar 2026 07:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250057; cv=none; b=UMvgbe9q2JYDuuJaU3WzkQ32j6+ZejAl7DIBd7R9crHK647PLRCAJxeX72AMqbGovKSC8dYX4h3gFCbHMRivamcP+X5YNPWTiy+59FVqrvKSuE/VKLnilhPA2wj8AetMNWFZPUTD60hTKOWkvGB6qNXFRSQOQbfCYbX7v2X6nHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250057; c=relaxed/simple; bh=RwJI+wBXjRIWiP98ZF3hF7NJhpb6ggVHouRYyy/KwpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TMLzgml/8To48SYuXOS1MpBe1bbEMx9R7o/jWUEEBlbneg8G04/7JwCgsZXjDin8x6053e2KjbfbKshwdQcH1rFbhonjUDshuxEGr4bE3CVpaxPAYNL/mzPSLUPqli/X+VFjuqGt0NE2Joa0wWnOkUyPJwMnSpgD4/pBQq47agE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=YpVTqa47; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="YpVTqa47" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id E87AE261C4; Mon, 23 Mar 2026 08:14:14 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2Y4E-sblliR5; Mon, 23 Mar 2026 08:14:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250054; bh=RwJI+wBXjRIWiP98ZF3hF7NJhpb6ggVHouRYyy/KwpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YpVTqa47PyLxWw80uhaRsuU3lhgcT2X15OzT1lQYZX/8N/DNEV+wW8mnJhhL0Bmq1 6icWhIivTmIbcpf8a5JIv9h9RPh1m8U4EVkrbS4Qw9SyVOLlQ9piZiGGlQWFpbVUBz stLlXH37ZZ3j+hwh3xB25batMgLRkEEIp66XALaTCfucDza+lLSteLimurcvrP84/R uxKCRA3ukANhJed7bstMPOmzM+yGc5ZBJf3SZbNekty48QWwShL3U8c3jg1sFeP5wA amTTGp2Cw1zXlZ6HbYBXraEvEF+K9++E9mGqFFEVUNFJKYeaNhShxiNwTQ7SKvQ+GG E0mr/vV+D3DPA== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 4/8] i2c: rtl9300: introduce a property for 8 bit width reg address Date: Mon, 23 Mar 2026 12:13:33 +0500 Message-ID: <20260323071337.15410-5-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In RTL9607C i2c controller, in order to indicate that the width of memory address is 8 bits, 0 is written to MEM_ADDR_WIDTH field as opposed to 1 for RTL9300 and RTL9310. Introduce a new property to a driver data to indicate what value need to written to MEM_ADDR_WIDTH field for this case. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index e40b4692a3fa..ffbc6c52861b 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -66,6 +66,7 @@ struct rtl9300_i2c_drv_data { u32 wd_reg; u8 max_nchan; u8 max_data_len; + u8 reg_addr_8bit_len; }; =20 #define RTL9300_I2C_MUX_NCHAN 8 @@ -111,6 +112,7 @@ struct rtl9300_i2c_xfer { #define RTL9300_I2C_MST_DATA_WORD2 0x10 #define RTL9300_I2C_MST_DATA_WORD3 0x14 #define RTL9300_I2C_MST_GLB_CTRL 0x384 +#define RTL9300_REG_ADDR_8BIT_LEN 1 =20 #define RTL9310_I2C_MST_IF_CTRL 0x1004 #define RTL9310_I2C_MST_IF_SEL 0x1008 @@ -305,6 +307,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *a= dap, u16 addr, unsigned s union i2c_smbus_data *data) { struct rtl9300_i2c_chan *chan =3D i2c_get_adapdata(adap); + const struct rtl9300_i2c_drv_data *drv_data; struct rtl9300_i2c *i2c =3D chan->i2c; struct rtl9300_i2c_xfer xfer =3D {0}; int ret; @@ -314,6 +317,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *a= dap, u16 addr, unsigned s =20 guard(rtl9300_i2c)(i2c); =20 + drv_data =3D device_get_match_data(i2c->dev); ret =3D rtl9300_i2c_config_chan(i2c, chan); if (ret) return ret; @@ -321,7 +325,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *a= dap, u16 addr, unsigned s xfer.dev_addr =3D addr & 0x7f; xfer.write =3D (read_write =3D=3D I2C_SMBUS_WRITE); xfer.reg_addr =3D command; - xfer.reg_addr_len =3D 1; + xfer.reg_addr_len =3D drv_data->reg_addr_8bit_len; =20 switch (size) { case I2C_SMBUS_BYTE: @@ -513,6 +517,7 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_dr= v_data =3D { .wd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .max_nchan =3D RTL9300_I2C_MUX_NCHAN, .max_data_len =3D RTL9300_I2C_MAX_DATA_LEN, + .reg_addr_8bit_len =3D RTL9300_REG_ADDR_8BIT_LEN, }; =20 static const struct rtl9300_i2c_drv_data rtl9310_i2c_drv_data =3D { @@ -536,6 +541,7 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_dr= v_data =3D { .wd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .max_nchan =3D RTL9310_I2C_MUX_NCHAN, .max_data_len =3D RTL9300_I2C_MAX_DATA_LEN, + .reg_addr_8bit_len =3D RTL9300_REG_ADDR_8BIT_LEN, }; =20 static const struct of_device_id i2c_rtl9300_dt_ids[] =3D { --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E84ED35E943; Mon, 23 Mar 2026 07:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250060; cv=none; b=hZjZgHX7fg0hZmZyKKmpsICmLbvIaXaEQ4xDQcQJj/tZ87ps7Kzo9wJmnYv+T6FJzKFwY0utrc/Pl1YV2QfxVngKiuGMRr71iMxBGa0hlAjW+nKKuOoywDXJQbHa3/HVo4dI4hU9mDraKQsvJuiim/unMQiYPOgDKnuwQ/rwXtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250060; c=relaxed/simple; bh=FUqz7MjKzDOGrnWMcC8BN+pmaNsiLf8N0I4JL3kLhR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jQ4S0E99dRs++17AKyg3B/c5cZbxKuwuNCT536NYqWBO54GR3oSzgUBrc7s4aXaU2Z4NKaI0L68OzmiIubzknbuCvzLyaAW3G/QqmHbS4l8L9hrp2UZq9j2v9rS+wtMlFdxTod1jsdQvDNysqipMGdtfMoVsFXB6YsRTt1z0QUA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Skdx0hwX; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Skdx0hwX" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 69C7D264BA; Mon, 23 Mar 2026 08:14:17 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wkhYi2GLVI0I; Mon, 23 Mar 2026 08:14:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250056; bh=FUqz7MjKzDOGrnWMcC8BN+pmaNsiLf8N0I4JL3kLhR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Skdx0hwXUSjd86SQEAOlbXXABxBeiCxeqg8Qut5uPOhMVOKC4P7xETDS9Cc/A7mXZ 6VRbDgDU6BMzqUkBjjt/2zhQh0oB/6do85uMy/hXA+Gv1e5X6mfJ7M/d26A4/yH06t 5vB/sK/fMky1SJrF3SjfrFTTmxso1Ikj9FiZimLBVYDEvwc2FdmgI1UOoWQ94PBKLK I1YNPG/B22sOXjQ3V/4Tkl8GUVRqTNmHHlWpQkOkICLu9xVrpI7FFZZud/o6MM0o+p V0ArKrbyCz3/VWV08UoqDo6XP+FIngnck02Rip+HNHCMYHBJMOz7rQir93yNxgJJgf iW68iedJc7Mxw== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 5/8] dt-bindings: i2c: realtek,rtl9301-i2c: extend for clocks and RTL9607C support Date: Mon, 23 Mar 2026 12:13:34 +0500 Message-ID: <20260323071337.15410-6-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the "realtek,rtl9607-i2c" compatible for i2c controller on the RTL9607C SoC series. Add a clocks property to the properties to describe the i2c reference clock and make it available for all the compatibles. This i2c reference clock is assumed to be coming from switchcore region via Lexra bus as the other SoC peripherals. RTL9607C requires the "realtek,scl" and "clocks" to be specified and so handle it under separate if check for "realtek,rtl9607-i2c". Signed-off-by: Rustam Adilov --- .../bindings/i2c/realtek,rtl9301-i2c.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml= b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml index f9a449fee2b0..5873cfdc5b3e 100644 --- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml +++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml @@ -15,6 +15,8 @@ description: assigned to either I2C controller. RTL9310 SoCs have equal capabilities but support 12 common SDA lines whi= ch can be assigned to either I2C controller. + RTL9607C SoCs have equal capabilities but each controller only supports 1 + SCL/SDA line. =20 properties: compatible: @@ -34,6 +36,7 @@ properties: - enum: - realtek,rtl9301-i2c - realtek,rtl9310-i2c + - realtek,rtl9607-i2c =20 reg: items: @@ -51,6 +54,9 @@ properties: The SCL line number of this I2C controller. enum: [ 0, 1 ] =20 + clocks: + maxItems: 1 + patternProperties: '^i2c@[0-9ab]$': $ref: /schemas/i2c/i2c-controller.yaml @@ -81,6 +87,15 @@ allOf: then: patternProperties: '^i2c@[89ab]$': false + - if: + properties: + compatible: + contains: + const: realtek,rtl9607-i2c + then: + required: + - realtek,scl + - clocks =20 required: - compatible --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 426E935F18B; Mon, 23 Mar 2026 07:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250062; cv=none; b=AsrbJ6GFqE/mdB9zmGfTVJb96dLSSH+5lAwS48sQCRo3Jl2BnogLprIzRpZKpckPwR0SHhTYGlnbjGX7fjxuayaMCB6aHgvhyL4r3r6nhOtYSKVlqVzn8El/Ob56hK+pUJTJw++W2AthPjNaLPqAOcgT19yFDTQ6oqDUinYHCoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250062; c=relaxed/simple; bh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V5O3NgHFaXY7wgYr44rliHiWh3F6xscE+hT429yIPSLeFqw49SuVspVSk9SmcS3Gc/wmZXhqH6HISoOh2h95t0LnugBWWXIj7ULpqiZJvlQAzafI/W9oMA8eKRVCfS6wnhQV7F3a2mBmy0TjXPNnS1vbZiiKJg8afaZBml6NZtE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=C0xD6u/T; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="C0xD6u/T" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id CE001265BE; Mon, 23 Mar 2026 08:14:19 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MSUvnCwkrqQa; Mon, 23 Mar 2026 08:14:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250059; bh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C0xD6u/Ti2FzYoZ7GB8Byy81RaH10bEPdeSPOJXGWzFzWh3UDSzUa7AIwv7we4hIC Qmvh5w8peCXd3AaT6km+nnD/8olzTT7qFU28O7nGng5q8abO0OhW276nO4R4//A3HG KTwTPGvVokH6KORVCEKPdtWADFthneWA7vtHf6eDoo0lDSmpD9TPdoOCPlQIAEPSc/ EaipHBdooi34kQcZP6cCbMDuJMMYOwDaEJd025com3J8fcYYbXmzn5BApEL+j0K6YP 0849NnWKT2HOPGxy1Ltn3hhDA0w7z0ZEuScsM2m4dSj7dwGchbqt/MyqrZnW6EyaRA +jwht6ArPztAA== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 6/8] i2c: rtl9300: introduce clk struct for upcoming rtl9607 support Date: Mon, 23 Mar 2026 12:13:35 +0500 Message-ID: <20260323071337.15410-7-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In RTL9607C i2c controller, there is 10 bit CLK_DIV field for setting the clock of i2c interface which depends on the rate of i2c clk (which seems be fixed to 62.5MHz according to Realtek SDK). Introduce the clk struct and the respective F_CLK_DIV and clk_div which are going to be used in the upcoming patch for rtl9607c i2c controller support addition. devm_clk_get_optional_enabled() function was used for cleaner code as it automatically returns NULL if the clk is not present, which is going to be the case for RTL9300 and RTL9310 i2c controllers. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index ffbc6c52861b..16af49ccd1dd 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only =20 #include +#include #include #include #include @@ -28,6 +29,7 @@ struct rtl9300_i2c_chan { struct rtl9300_i2c *i2c; enum rtl9300_bus_freq bus_freq; u8 sda_num; + u32 clk_div; }; =20 enum rtl9300_i2c_reg_scope { @@ -54,6 +56,7 @@ enum rtl9300_i2c_reg_fields { F_SDA_OUT_SEL, F_SDA_SEL, F_BUSY, + F_CLK_DIV, =20 /* keep last */ F_NUM_FIELDS @@ -85,6 +88,7 @@ struct rtl9300_i2c { u8 scl_num; u8 sda_num; struct mutex lock; + struct clk *clk; }; =20 DEFINE_GUARD(rtl9300_i2c, struct rtl9300_i2c *, mutex_lock(&_T->lock), mut= ex_unlock(&_T->lock)) @@ -432,6 +436,10 @@ static int rtl9300_i2c_probe(struct platform_device *p= dev) if (ret) return ret; =20 + i2c->clk =3D devm_clk_get_optional_enabled(dev, NULL); + if (IS_ERR(i2c->clk)) + return dev_err_probe(dev, PTR_ERR(i2c->clk), "Failed to enable i2c clock= \n"); + i =3D 0; for_each_child_of_node_scoped(dev->of_node, child) { struct rtl9300_i2c_chan *chan =3D &i2c->chans[i]; --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6DBD35FF75; Mon, 23 Mar 2026 07:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250065; cv=none; b=DC87ELJ9A+NBrcZ1m/slMAtSjo8QSb3ssvX/pVXP5DzcgU32aBBzetpgFvfLWjbXAu99UP/PxSg77Bd/W0D8XogoMAjDFL4WV2F5RBn5ixZ/1HA1h9TBnGeOy4Na2eEDKi4NayIRTtQ7908FLUyHo6t+LotYHjeys4Vm4oUJrEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250065; c=relaxed/simple; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N5G38mq9y2MbBHxQ78E0E1eykPP3Zpj6jsjdCyklthniHsmZ7o/hMEbIySb6vwvQayaHtUUrF1pLsUls5XdUErFGvTgP4bJi+YxF3TTrCpXYBYCmoddbs/Z0K5TxmQCHHOClX+0i6ndE/FWWdCUxgxTTVXGWC7mEcpqWz8qmMbE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Iy68iOFU; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Iy68iOFU" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3DD6F264BA; Mon, 23 Mar 2026 08:14:22 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id q4WPY-7QvB6f; Mon, 23 Mar 2026 08:14:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250061; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Iy68iOFUXCTz2u0gIugNWa5sDoLh/LWEMEhcUonbniFkcIpl3PwRZAQsCt6SMVqOA qqHVNYlT7ACWZYZySfbWu6P//pg/zJDhvn2Rv5U+6kvJ3G40CGlJHQpnPmYb8qOoMD 8TTEU0T24QZfnPHlF9BAoLGM4jZZzPWCeBHnnEyzMm8BMfhUW2VZ8FXk3CKs1wiofd CGlmqlCV5EOJjnbrFlZX7XG7xyV1pff5NHjLcbqcapSNCS82nL5HDus70dqkh6ENmH G4CHAc7hbg0svYxN3EVwJDoaZgmX6RAwEprfl4cD8jXeSYddzHI//j9ohxizK1AvbJ /kXVWd3TcgJyw== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 7/8] i2c: rtl9300: intoduce new function properties to driver data Date: Mon, 23 Mar 2026 12:13:36 +0500 Message-ID: <20260323071337.15410-8-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Due to the very nature of differences between RTL9607C i2c controller and RTL9300 / RTL9310 that are incompatible with each other in some areas of this driver, for example in clock configuration, channel configuration and initialization at the end of the probe, introduce new function properties to the driver data struct to handle those differences. With these new properties, create configuration functions for RTL9300 and RTL9310 and assign them to their respective driver data structs. Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 66 +++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index 16af49ccd1dd..b718b74afe0d 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -65,6 +65,9 @@ enum rtl9300_i2c_reg_fields { struct rtl9300_i2c_drv_data { struct rtl9300_i2c_reg_field field_desc[F_NUM_FIELDS]; int (*select_scl)(struct rtl9300_i2c *i2c, u8 scl); + int (*config_chan)(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan= ); + void (*config_clock)(u32 clock_freq, struct rtl9300_i2c_chan *chan); + int (*misc_init)(struct rtl9300_i2c *i2c); u32 rd_reg; u32 wd_reg; u8 max_nchan; @@ -175,6 +178,30 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c = *i2c, struct rtl9300_i2c_c return 0; } =20 +static void rtl9300_i2c_config_clock(u32 clock_freq, struct rtl9300_i2c_ch= an *chan) +{ + struct rtl9300_i2c *i2c =3D chan->i2c; + + switch (clock_freq) { + case I2C_MAX_STANDARD_MODE_FREQ: + chan->bus_freq =3D RTL9300_I2C_STD_FREQ; + break; + case I2C_MAX_FAST_MODE_FREQ: + chan->bus_freq =3D RTL9300_I2C_FAST_FREQ; + break; + case RTL9300_I2C_MAX_SUPER_FAST_FREQ: + chan->bus_freq =3D RTL9300_I2C_SUPER_FAST_FREQ; + break; + case RTL9300_I2C_MAX_SLOW_FREQ: + chan->bus_freq =3D RTL9300_I2C_SLOW_FREQ; + break; + default: + dev_warn(i2c->dev, "SDA%d clock-frequency %d not supported using default= \n", + chan->sda_num, clock_freq); + break; + } +} + static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, u8 len) { u32 vals[4] =3D {}; @@ -322,7 +349,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *a= dap, u16 addr, unsigned s guard(rtl9300_i2c)(i2c); =20 drv_data =3D device_get_match_data(i2c->dev); - ret =3D rtl9300_i2c_config_chan(i2c, chan); + ret =3D drv_data->config_chan(i2c, chan); if (ret) return ret; =20 @@ -389,6 +416,12 @@ static struct i2c_adapter_quirks rtl9300_i2c_quirks = =3D { .max_write_len =3D 16, }; =20 +static int rtl9300_i2c_init(struct rtl9300_i2c *i2c) +{ + /* only use standard read format */ + return regmap_field_write(i2c->fields[F_RD_MODE], 0); +} + static int rtl9300_i2c_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -453,27 +486,11 @@ static int rtl9300_i2c_probe(struct platform_device *= pdev) if (ret) clock_freq =3D I2C_MAX_STANDARD_MODE_FREQ; =20 - switch (clock_freq) { - case I2C_MAX_STANDARD_MODE_FREQ: - chan->bus_freq =3D RTL9300_I2C_STD_FREQ; - break; - case I2C_MAX_FAST_MODE_FREQ: - chan->bus_freq =3D RTL9300_I2C_FAST_FREQ; - break; - case RTL9300_I2C_MAX_SUPER_FAST_FREQ: - chan->bus_freq =3D RTL9300_I2C_SUPER_FAST_FREQ; - break; - case RTL9300_I2C_MAX_SLOW_FREQ: - chan->bus_freq =3D RTL9300_I2C_SLOW_FREQ; - break; - default: - dev_warn(i2c->dev, "SDA%d clock-frequency %d not supported using defaul= t\n", - sda_num, clock_freq); - break; - } - chan->sda_num =3D sda_num; chan->i2c =3D i2c; + + drv_data->config_clock(clock_freq, chan); + adap =3D &i2c->chans[i].adap; adap->owner =3D THIS_MODULE; adap->algo =3D &rtl9300_i2c_algo; @@ -491,8 +508,7 @@ static int rtl9300_i2c_probe(struct platform_device *pd= ev) } i2c->sda_num =3D 0xff; =20 - /* only use standard read format */ - ret =3D regmap_field_write(i2c->fields[F_RD_MODE], 0); + ret =3D drv_data->misc_init(i2c); if (ret) return ret; =20 @@ -521,6 +537,9 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_dr= v_data =3D { [F_BUSY] =3D MST_REG_FIELD(RTL9300_I2C_MST_CTRL1, 0, 0), }, .select_scl =3D rtl9300_i2c_select_scl, + .config_chan =3D rtl9300_i2c_config_chan, + .config_clock =3D rtl9300_i2c_config_clock, + .misc_init =3D rtl9300_i2c_init, .rd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .wd_reg =3D RTL9300_I2C_MST_DATA_WORD0, .max_nchan =3D RTL9300_I2C_MUX_NCHAN, @@ -545,6 +564,9 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_dr= v_data =3D { [F_BUSY] =3D MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0), }, .select_scl =3D rtl9310_i2c_select_scl, + .config_chan =3D rtl9300_i2c_config_chan, + .config_clock =3D rtl9300_i2c_config_clock, + .misc_init =3D rtl9300_i2c_init, .rd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .wd_reg =3D RTL9310_I2C_MST_DATA_CTRL, .max_nchan =3D RTL9310_I2C_MUX_NCHAN, --=20 2.53.0 From nobody Fri Apr 3 22:31:47 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0E6236074D; Mon, 23 Mar 2026 07:14:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250068; cv=none; b=M4lpjTDWIjWGJ+bgqiiJi7lVFBHmkVNfkbIYmyg3POQ5QHV4dJYdBVQfJ4s5iSJrVp9eWyBPbGp8FNKrGcoJXioB6nL+wvhyNvY9cFejqGfX5zz6YH1WGh0UbtnQ2dbqo3NLfwF0KdzPIq5h5Wb+y1E9QJKOkyhg0TpHgrKC6GQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774250068; c=relaxed/simple; bh=oxOd6xrPkNkZz6QA/SUlqhCBJiX5nvMMbOMTlIgZTp8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rVNJEtb5puR0i/KkziIOOT/TaU3KGZwVtwDfvmYnZaAupYtg9CjEvXNTRLWyStiY+u4ult4YmTU+Ju9isKE/7W4MPM5jjUuyDlKnQojAda21a7T+o2bJ18ig9MKmS1BqbFXplUJtAADVK4Hr96ehePqBpVdc9FZ3J5sxBpN1B/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=HAM10rI0; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="HAM10rI0" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 2B976261C4; Mon, 23 Mar 2026 08:14:25 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id POKP_fx2Ba68; Mon, 23 Mar 2026 08:14:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1774250064; bh=oxOd6xrPkNkZz6QA/SUlqhCBJiX5nvMMbOMTlIgZTp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HAM10rI0Oq9NmTG+n60W6oE6lkujvMJBHaxbuaeAnaLIk5CpT4PMceWD1ifVig52s 7XyNxFvH0Lm7KUH20piZdMcysI8+u94OX/Fxme38NqpgrdVMEJUy7vTCUmzjgcHcN/ vpQENNS4Z2kCg15OND+tdIl9G43oYBfFlL9uEhWc4bkH0AN7CfuYMfV+G8+bwYRHNi KUPk6BObEubKYzcE0atXLO6kQnGPgo7uuaMPdz+0A+pukiOxU2tJWd4WABUpb2FzSO TOAy+1qOi/6z8DdtDYCppGuhgl+wW9YmjoCd2xeU8bYHZpRy+MDwBFmYTryAHYPwhZ Bt9AJagSiQO2w== From: Rustam Adilov To: Chris Packham , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [PATCH v4 8/8] i2c: rtl9300: add RTL9607C i2c controller support Date: Mon, 23 Mar 2026 12:13:37 +0500 Message-ID: <20260323071337.15410-9-adilov@disroot.org> In-Reply-To: <20260323071337.15410-1-adilov@disroot.org> References: <20260323071337.15410-1-adilov@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for the internal I2C controllers of RTL9607C series based SoCs. Add register definitions, chip-specific functions and macros too. Make use of the clk introduced from the previous patch to get the clk_div value and use it during the rtl9607c channel configuration. Introduce a new EXT_SCK_5MS field to the reg fields struct which is going to be initialized by rtl9607c init function at the end of the probe. This patch depends on all the previous patches in this patch series. Reviewed-by: Chris Packham Signed-off-by: Rustam Adilov --- drivers/i2c/busses/i2c-rtl9300.c | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9= 300.c index b718b74afe0d..8cedffbb2964 100644 --- a/drivers/i2c/busses/i2c-rtl9300.c +++ b/drivers/i2c/busses/i2c-rtl9300.c @@ -57,6 +57,7 @@ enum rtl9300_i2c_reg_fields { F_SDA_SEL, F_BUSY, F_CLK_DIV, + F_EXT_SCK_5MS, =20 /* keep last */ F_NUM_FIELDS @@ -77,8 +78,10 @@ struct rtl9300_i2c_drv_data { =20 #define RTL9300_I2C_MUX_NCHAN 8 #define RTL9310_I2C_MUX_NCHAN 12 +#define RTL9607_I2C_MUX_NCHAN 1 =20 #define RTL9300_I2C_MAX_DATA_LEN 16 +#define RTL9607_I2C_MAX_DATA_LEN 4 =20 struct rtl9300_i2c { struct regmap *regmap; @@ -127,6 +130,14 @@ struct rtl9300_i2c_xfer { #define RTL9310_I2C_MST_MEMADDR_CTRL 0x4 #define RTL9310_I2C_MST_DATA_CTRL 0x8 =20 +#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 +#define RTL9607_I2C_IND_RD 0x18 +#define RTL9607_REG_ADDR_8BIT_LEN 0 + static int rtl9300_i2c_reg_addr_set(struct rtl9300_i2c *i2c, u32 reg, u16 = len) { int ret; @@ -178,6 +189,27 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c = *i2c, struct rtl9300_i2c_c return 0; } =20 +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 =3D=3D chan->sda_num) + return 0; + + ret =3D regmap_field_write(i2c->fields[F_CLK_DIV], chan->clk_div); + if (ret) + return ret; + + drv_data =3D device_get_match_data(i2c->dev); + ret =3D drv_data->select_scl(i2c, i2c->scl_num); + if (ret) + return ret; + + i2c->sda_num =3D chan->sda_num; + return 0; +} + static void rtl9300_i2c_config_clock(u32 clock_freq, struct rtl9300_i2c_ch= an *chan) { struct rtl9300_i2c *i2c =3D chan->i2c; @@ -202,6 +234,13 @@ static void rtl9300_i2c_config_clock(u32 clock_freq, s= truct rtl9300_i2c_chan *ch } } =20 +static void rtl9607_i2c_config_clock(u32 clock_freq, struct rtl9300_i2c_ch= an *chan) +{ + struct rtl9300_i2c *i2c =3D chan->i2c; + + chan->clk_div =3D clk_get_rate(i2c->clk) / clock_freq - 1; +} + static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, u8 len) { u32 vals[4] =3D {}; @@ -422,6 +461,11 @@ static int rtl9300_i2c_init(struct rtl9300_i2c *i2c) return regmap_field_write(i2c->fields[F_RD_MODE], 0); } =20 +static int rtl9607_i2c_init(struct rtl9300_i2c *i2c) +{ + return regmap_field_write(i2c->fields[F_EXT_SCK_5MS], 1); +} + static int rtl9300_i2c_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -574,6 +618,31 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_d= rv_data =3D { .reg_addr_8bit_len =3D RTL9300_REG_ADDR_8BIT_LEN, }; =20 +static const struct rtl9300_i2c_drv_data rtl9607_i2c_drv_data =3D { + .field_desc =3D { + [F_SCL_SEL] =3D GLB_REG_FIELD(RTL9607_IO_MODE_EN, 13, 14), + [F_EXT_SCK_5MS] =3D MST_REG_FIELD(RTL9607_I2C_CONFIG, 26, 26), + [F_DEV_ADDR] =3D MST_REG_FIELD(RTL9607_I2C_CONFIG, 14, 20), + [F_MEM_ADDR_WIDTH] =3D MST_REG_FIELD(RTL9607_I2C_CONFIG, 12, 13), + [F_DATA_WIDTH] =3D MST_REG_FIELD(RTL9607_I2C_CONFIG, 10, 11), + [F_CLK_DIV] =3D MST_REG_FIELD(RTL9607_I2C_CONFIG, 0, 9), + [F_I2C_FAIL] =3D MST_REG_FIELD(RTL9607_I2C_IND_CMD, 3, 3), + [F_BUSY] =3D MST_REG_FIELD(RTL9607_I2C_IND_CMD, 2, 2), + [F_RWOP] =3D MST_REG_FIELD(RTL9607_I2C_IND_CMD, 1, 1), + [F_I2C_TRIG] =3D MST_REG_FIELD(RTL9607_I2C_IND_CMD, 0, 0), + [F_MEM_ADDR] =3D MST_REG_FIELD(RTL9607_I2C_IND_ADR, 0, 31), + }, + .select_scl =3D rtl9310_i2c_select_scl, + .config_chan =3D rtl9607_i2c_config_chan, + .config_clock =3D rtl9607_i2c_config_clock, + .misc_init =3D rtl9607_i2c_init, + .rd_reg =3D RTL9607_I2C_IND_RD, + .wd_reg =3D RTL9607_I2C_IND_WD, + .max_nchan =3D RTL9607_I2C_MUX_NCHAN, + .max_data_len =3D RTL9607_I2C_MAX_DATA_LEN, + .reg_addr_8bit_len =3D RTL9607_REG_ADDR_8BIT_LEN, +}; + static const struct of_device_id i2c_rtl9300_dt_ids[] =3D { { .compatible =3D "realtek,rtl9301-i2c", .data =3D (void *) &rtl9300_i2c_= drv_data }, { .compatible =3D "realtek,rtl9302b-i2c", .data =3D (void *) &rtl9300_i2c= _drv_data }, @@ -583,6 +652,7 @@ static const struct of_device_id i2c_rtl9300_dt_ids[] = =3D { { .compatible =3D "realtek,rtl9311-i2c", .data =3D (void *) &rtl9310_i2c_= drv_data }, { .compatible =3D "realtek,rtl9312-i2c", .data =3D (void *) &rtl9310_i2c_= drv_data }, { .compatible =3D "realtek,rtl9313-i2c", .data =3D (void *) &rtl9310_i2c_= drv_data }, + { .compatible =3D "realtek,rtl9607-i2c", .data =3D (void *) &rtl9607_i2c_= drv_data }, {} }; MODULE_DEVICE_TABLE(of, i2c_rtl9300_dt_ids); --=20 2.53.0