From nobody Mon Apr 6 10:32:54 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 414863EE1F8; Thu, 19 Mar 2026 17:59: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=1773943165; cv=none; b=pG82EWdaTEMRPlDnHp/fLHzFPanxjrihmxwLi+AsVxC2vP/u3SIIKpQGpj0qot9BOd7uVv63qDP51AWVdFv8bkweZq4MoNBRqlZt4sBIHLg0F3Lyf+YF7P8iRfgqv4ct8yXGWE/H7p8kaXMcpp2gf0/vVPOR1qyrU/iLfBcdQV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943165; c=relaxed/simple; bh=gLVZnYH8RyztHWedBiBheyvBydAbsVMkC5d77hHYZlI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m4DUTvo8eOTX4IRKM5YsgKzVQKygQWy85uex583dwgEgdTRFoTsi+wUl47TQJtx1Zaz7I7OvT+Z7paTYsIG2Rzk/C7EZi5hDHp00isnCPC8xIBEuJZ5ru+vNteTe3JkJgz3N3OD4oQ0iDyNyizEGN2qGiP+43vwoyVQzC+cZK+c= 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=kgB4FtVh; 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="kgB4FtVh" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 38A3E27312; Thu, 19 Mar 2026 18:59:15 +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 NzVVZRHtfIks; Thu, 19 Mar 2026 18:59:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943154; bh=gLVZnYH8RyztHWedBiBheyvBydAbsVMkC5d77hHYZlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kgB4FtVh4SrcrA2zRxOF9T2HBlj9bEEH2UQhgBSz5s+QO1J1qkydh064b2zdQmJYY 0p33+4gWfiXPZ5KTKr45zkJayZZ3d674zlopP50DTbg4rphDtArKCz8LzDyV5pP8KX KEjyHym3nbdtZlEFD4pW4yVJky3KdV3RnpgGwWIAMEhWOqiMN9WHS3A7lLBQTsSUlm +cYtfHyNDZ4AfrG6IAdUI/Xi65utucnxzEH8BZ+8uNBzsJXg9RrmOUjYtUK2KBFRhk jQQ34JRQqZ2DgWL3L1czoNc5E7HPYHmOYVTbPhIMVoiKSdI8Dh0vlYu5DHVrd4sAaD Zq7rvkVX5IO6A== 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 v2 1/8] i2c: rtl9300: split data_reg into read and write reg Date: Thu, 19 Mar 2026 22:57:46 +0500 Message-ID: <20260319175753.32338-2-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 15092DDC3; Thu, 19 Mar 2026 17:59:29 +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=1773943171; cv=none; b=lTgIjl8Jw2qf22nlemq1yuiamZbvCniW11rNd2rl2Yi4HSYY9nrf11yJesuG6viOHe/dGUPZmnuBdmNsQXy84H22LcsmrIzRYi86ZdB6hiycyBbGMIZSGEsB1D95QS4mK2WF6u4gq8DjZWx0rsf2VM0hEParzq9jwnClqMwcj3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943171; c=relaxed/simple; bh=78qH5nIWIELIDV6PJGBxhJTVaTi35H4kfKGiY4tduC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mZbBs9Yt76Xq46/g2D7qKfPSxlDPXBYYZsku8x15AIwZRnjuWY408SbARn+0l03NCB4ZbMWfsFERQsC3l0t7PRbejmlEAjIloqzateNyVwrYRupnLYrj3jaKh9LxqU+WcaGTdsMKoRcPojmMJV/mChmyf4kg5pP5Such6SkfLMg= 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=NJUZYLwi; 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="NJUZYLwi" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 9A74B26406; Thu, 19 Mar 2026 18:59:28 +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 PAdmY0SQ_GEq; Thu, 19 Mar 2026 18:59:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943168; bh=78qH5nIWIELIDV6PJGBxhJTVaTi35H4kfKGiY4tduC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NJUZYLwiEhEGpaa9US3ETf8y2jjIL7zll14RG1N0Bs2C0JhYVBQW7OYig6q8cG7OH eAY4fM6pXgtI6QZXUGqtJSXG0i+n8h6eRrnwgrQ43op9+TdCZKlXOwjNzgF+OkJ33r R2/nzJhVJkwlcDedomg9CP3OzpNHScQcT+ESCORtx5eAOkaQOeRtp9W+TS2kHXq4zC a8C2nwqJJjtyTr2rELjiWCPp+GPPB2L3+bGJp9aev1HnV5AOwtfcJGkfMwOI/DIegY BB7zpPaMOvOrfQR3aMWAdiBLL1Hos4GZs1fD/GTfUP5IyaKCe0/bsHYka5Tm2EAhNk 6LvlJ1Wpmizxg== 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 v2 2/8] i2c: rtl9300: introduce max length property to driver data Date: Thu, 19 Mar 2026 22:57:47 +0500 Message-ID: <20260319175753.32338-3-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 983733F167F; Thu, 19 Mar 2026 17:59:32 +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=1773943173; cv=none; b=h0G174jlEtQzcHb4PN96qt7coxuJzDJdN95T8YYI+NkHIVgY3XZGaAZcH4+KB4UqepoKMdFFjvrL2Ejc9OtGp3YozeeQePNuWHoOeujn4WUP3Akiwz5CRRSlJkYtMnECSSqwlQOvPvBa2duWMZ6neCPyzll3US5jkSf5uSGvkKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943173; c=relaxed/simple; bh=GwaO3Jgs7I+IjOxIFQXKkawzKx2llBDskSmUtS3EUww=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zuh/4iqynyuIvkrG5gVZDvEgga0j3Jsx51nfa3UnnN3H1JCQYjsx0wTGBbtZIRraO1V6MZvkwyjS+OlenJ37VnJTmNLwnr6P7zud6/62IsQXcaEaVyINzaBO5RHtwrkuALTZfEcxKXn2lHf/L6NTgJ4R8FJGkazi+6Qqz3+5zDA= 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=alk1uNv1; 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="alk1uNv1" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3D94726946; Thu, 19 Mar 2026 18:59:31 +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 jGxUr-uXI2OH; Thu, 19 Mar 2026 18:59:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943170; bh=GwaO3Jgs7I+IjOxIFQXKkawzKx2llBDskSmUtS3EUww=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=alk1uNv1fPIoB6AkjUMYziLqstL+IIiDNJUS7o69kRxOyMZb2y6yGn64U3WTr85d9 SH5xj66RDeAfpYwHobDZ7U8qOVyCxVRzyuz8GvZXwIvcsVUrUKR6bNTFXNGP1A1WrY 8kaTqpkzu/lGwfTH1XEs5WuFMuIUj9cjT0JVookYrR7vUnJq/ND/VLiueKJtmKF8ep RqLpPRwdBQPedEAob5KK+D5avnHUB5GLsXSUt4EAfuDpJVsCvSR11t3ht1s8fYY8lX A2M0E/KJx6P7fBRN3PdpM/YDs/MlUoBxPjL38grmfA4d1VR4He9hCdR2gpyjuBNtaC bIzr5LXAfHqig== 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 v2 3/8] i2c: rtl9300: introduce F_BUSY to the reg_fields struct Date: Thu, 19 Mar 2026 22:57:48 +0500 Message-ID: <20260319175753.32338-4-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 1CB5F3F23D4; Thu, 19 Mar 2026 17:59:34 +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=1773943176; cv=none; b=Eitd6Y1JW61o/t0OUqVjqEsV30F6AiPFhHo4kuSfAnpWoc2KoSIiiaX/ombKRghwFfACEk9PvOnIQpqiRbNHZIKX0+9EYtgNusDqO0RDbaCZQr3Wvzsz5BKJuSJAiTdofJ2WH942gPi2VbNs4crcrk+SrJTDAPIquIn6dEKcZD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943176; c=relaxed/simple; bh=RwJI+wBXjRIWiP98ZF3hF7NJhpb6ggVHouRYyy/KwpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SyxFuqNJoVbX7cNUSMEgfWX51C4ACJgSRV+eHp6os4H4NmkZRqXOac5IGjeVEMcQEyWn3+SO4PfTa5fl/pv2h8KM8wGGLFkDvTfE7Nd8BfOav8MGV5P33XKWacKAEzES84oV8dwNPu9KZEtcGr1ynHyv5rQiwM2U97JjfhbAz6s= 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=PX0k+Jjz; 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="PX0k+Jjz" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B0578275D5; Thu, 19 Mar 2026 18:59:33 +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 NCsxeaMjxH00; Thu, 19 Mar 2026 18:59:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943173; bh=RwJI+wBXjRIWiP98ZF3hF7NJhpb6ggVHouRYyy/KwpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PX0k+JjzkZTy5KwEEFSKeXGWEh0R9NVetMs5lXDrs6lqpUBEzX9GysPV5Dis5aHg0 GPt5gX9wLhVw1RqHMa5khQoIr8aSXhOONu2DjB8QBm19ay97g+iT/U+27ARz7GoJX8 tbAU/SR7CMfsNKnOO/1EOh9kjzyls0eHUm79O2ZXnxJR8IgiAyHi+PuZJPmGb7gdLu LHBysUYFqJKkgnGjeowXnSIMVUypo0PS2MOEkwNlCoC3U/iLaLNbLojmTvETNE7PO2 Ag6bisEoMMq+5BiFYVYAI0Nhmny66RApQlzN6pdtMSmj0ajJk6WxkZTR4XSuWY21RP 5gPwhcb6mE4IQ== 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 v2 4/8] i2c: rtl9300: introduce a property for 8 bit width reg address Date: Thu, 19 Mar 2026 22:57:49 +0500 Message-ID: <20260319175753.32338-5-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 BF75E3F54B9; Thu, 19 Mar 2026 17:59:37 +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=1773943179; cv=none; b=r+0Qu3EWjEaaeComaxyjgOkT2E73oR0G1anMJWbzWGwIlA9NjqcjtQ4dRMSk0r5X62NfVOVCUQVTwhqf9IiRzIo3m07fSOoD/BSSN0Qxp2x8+H8YQVNR0EcbeulKhRQGbfREf3RpHwTrmm13ol6lRY9BFxrYOSySoTKRo+uenRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943179; c=relaxed/simple; bh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZTYJtWu38TztHA4E4wBu4/6WRsYN9OIkQCwKQIgXJ/A0iqWEJzQr5A9JgowpoGVlOnc/aFFxQKvrtQ7bTnN0kn7uBEEJZIQLfHBU8hWHScT8B2XbL+EfWm0YGu3rBFsS3fsWgZbpeF75J01jAv4CCkL16rkZFTIkEIqaSQcg2xU= 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=EkqefCDF; 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="EkqefCDF" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3493325FAE; Thu, 19 Mar 2026 18:59:36 +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 czcLqrmtE8nV; Thu, 19 Mar 2026 18:59:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943175; bh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EkqefCDFbJfvux9NUY8HggMmXh+aupGG1THcMqEpCONa2tOT8IY8dnEqQoCmS7wNr RpbqnnqziAppwmsW0lgUUlDYQH5TygElyqgZzai2tO3i+LJ7hSRzM+4whuLo+rWZMH 7n+VoUlGyKrbF5yewuqf2sY0xO9PewYpcueFPVGUFTAasFydfefTH/21iBMnMx2U78 j1bmyJQ2Ref8YnuiqxB8ttXNEU78FngwYc4rFUwm1nRcxHc4BIppelCyhKRFl9H0tN 94/rkv+qOctW4R1F6N8zjBAVcoXJ7S2JQUJYIkCjNxSNJm/ZmkNybPJztc1Or3BN6Q 2+kAq7kGL7ZkQ== 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 v2 5/8] i2c: rtl9300: introduce clk struct for upcoming rtl9607 support Date: Thu, 19 Mar 2026 22:57:50 +0500 Message-ID: <20260319175753.32338-6-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 651233F1655; Thu, 19 Mar 2026 17:59:40 +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=1773943181; cv=none; b=q4Y1+UT32NECZbHwYSd7ktj6D6+R3lljW5/iytP9H6fKgDqSuLSPTlxATzFC0exjxooaR1ORWQD+Zk4/7D8bdGaQmlQlZEJRicRyfgoy+1YIwUWaAKfUcvJXIG42g2joR8NLm67daB6OH2XVkQ+7wj1g4EjkhB9AcyD0zEyQve0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943181; c=relaxed/simple; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o23+TWMTNTihDFy90eJ5wW3S5frNUpvF8PDOtny/gmMQF2VLcPSQg+63A3xm9gFDw6JQ3337G7Kruajkbe7/tgns+Fq9dx9va5VUdKaxyKHDZZxNVuNU3oqcoNvlCW+d0pcAZGF7WQjy6/hLUlUXR1i63Aru8yTimf4lzKETQ08= 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=E4M62aes; 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="E4M62aes" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 34F5F2650C; Thu, 19 Mar 2026 18:59:39 +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 RM0SD9n4uTfm; Thu, 19 Mar 2026 18:59:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943178; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E4M62aesSk8Ls+ZRf1Atup4ipOu5CfS112Sx+IgTQcsBLJ0L8EqcubdepzrcOy3YB zYWA+pfLhbj6DeSuoynjzaPcdJBbzfQR0qvfBqsXk/8bHI5yQ6OR3JXR549Fk7wsXY jQZDq6tTGT1Nalv62TuI/na5+bxEfLeL4NkhG+QBT904eufRii+Fhjc4cKSk6/1fbd OdGROha2J6xGSyVzz4hVy5fac0+vgDYyKWj4eUvOykqZufmS/tBYZKRlorqVmXLAJo JjVXVWsPhRTvu+5qn+/HcxM7/S8hpG/I4ACQB4AVINaYHECfIpW3kFswnI0Yt1N5W9 zM9XGzNUqOOzw== 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 v2 6/8] i2c: rtl9300: intoduce new function properties to driver data Date: Thu, 19 Mar 2026 22:57:51 +0500 Message-ID: <20260319175753.32338-7-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 Mon Apr 6 10:32:54 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 D9EA93F7876; Thu, 19 Mar 2026 17:59:42 +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=1773943184; cv=none; b=arPD5gk6/TB75b2zYWKGreRFn/OYe4R8yNzq7JyHbdMasCv7fXlVqELnVN9lc71Gri1Pwks2+R61y/qFW82IPu2qvZagSR3fAKBZYjVAkHvDbNkOTPts5L12/aw5ks2uLMV9V7Q3QFrYp0QziPPMo9vXRoUEft6fFLER5gjXBJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943184; c=relaxed/simple; bh=k/JDqmiRXOfPksRprwnqB2dydKEJ8xm1rTB1qgs+v7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XCnWdaCOeNw2Y8zPgA+aKQIY1TUJMdJQ7zyKx+WMP7kAUQ0AuSBl/e0U4WMtdnwCkNw02p1+ItbkdjuDDGqKOz5kPSDcWYvn6Tivz7gEy/ZK8BqbpKMDSA5Zk8lhieHzDMPIhjFZOCyaKwZIcuGLdXZkJ2+spmnkXMLgzse7qEU= 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=R/uqfEzB; 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="R/uqfEzB" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 7AED82759D; Thu, 19 Mar 2026 18:59:41 +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 ThLIzO5U0U7C; Thu, 19 Mar 2026 18:59:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943180; bh=k/JDqmiRXOfPksRprwnqB2dydKEJ8xm1rTB1qgs+v7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R/uqfEzBVcer9LrrwLeS38ygbGxTFfjfT5BIufuk5eZe3geIVDPy7B2WVw37oM8Ke lRW0Wa0Xmedo0BLz3D98axNbphyLSfAlPfdYDO+EPEqTSSON57BHdzbWMD5/K0WkZF Xk2DVFN1KYg5a/JbrUqO4Dq3Uyo4edWQpIFkThmegoXjn6sYflTxreTXMDVnF1dfkP VpgfsybKSPNHfcPvUfePvrq19l7dovrDpM5rN+fdkIJItn+MmLfY8fU35rF1KL06xj mXRg6mpSxsiSKPPD25NfJ1uFqS6c4Pn2H6kkQvVjZOzUE1kILDohc/5T197uBdIkE2 nYPdFOboMMLow== 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 v2 7/8] dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9607C support Date: Thu, 19 Mar 2026 22:57:52 +0500 Message-ID: <20260319175753.32338-8-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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 since RTL9607C requires it along with the realtek,scl. And because RTL9607C is the only one that requires the new clocks property, add "clocks: false" to everything else. Signed-off-by: Rustam Adilov --- .../bindings/i2c/realtek,rtl9301-i2c.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml= b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml index f9a449fee2b0..35ced0dcf410 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 and require clocks. =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,18 @@ allOf: then: patternProperties: '^i2c@[89ab]$': false + - if: + properties: + compatible: + contains: + const: realtek,rtl9607-i2c + then: + required: + - realtek,scl + - clocks + else: + properties: + clocks: false =20 required: - compatible --=20 2.53.0 From nobody Mon Apr 6 10:32:54 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 CBF973F211A; Thu, 19 Mar 2026 17:59:45 +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=1773943187; cv=none; b=P19l3RkFrDGYafrndPHzE7XGqZoiNnBYy24qegUlLipXRREoyLBKGFDwRRWxcPwsOtvFFUTF9NPGD/Am1ta9AuEfm7AvdgcbfTrsSxTcIqHKlsi8KVup18ptVq0qDcV+ble6Y/1zJsnTJKJU4HKHezltOHEF2mY7W9qQw3ZQN0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773943187; c=relaxed/simple; bh=oxOd6xrPkNkZz6QA/SUlqhCBJiX5nvMMbOMTlIgZTp8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LNKwcVQSQKwao5FLAyd0mgG8yo77T5vpjqs0Fa11XApB9arPzNRtHiAL5rV51Xp9xnm5fCa+rY+8Vj7afWZj/jLNg8Lo0hKFaq3YbfjYZXqfSfLFA8winR4aqx2mmJKTFXu1gsPMu1gYTp4bpBCTbGEf5pg2o5H68t9UtCB6PTs= 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=DYJbs/Em; 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="DYJbs/Em" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 7219826406; Thu, 19 Mar 2026 18:59:44 +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 zEEeo48EMKc7; Thu, 19 Mar 2026 18:59:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1773943183; bh=oxOd6xrPkNkZz6QA/SUlqhCBJiX5nvMMbOMTlIgZTp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DYJbs/EmS5FoAhBSsli5W/HJ/HIVS6Drhjn/UWNZqxkNH+TmlcOCuKPIOaZziHHxO XblDuGeeNjOeZQoQVpf+bqwNh+mWAQpAxAYuppgrbHa7dQo0s4HvG0KN/gw3HXl5Tc ZkeNFUNsmxV6YQjem1GSJIcHRix/Mx/ttYFuAd24+XUtsjYVpS4TbEojejR/E9mXfu k/naoR5EqwxiyGnfh1kexKhp24LL5RCzvUeDDvc+vVtq3UB97d1Fx3Vnu0UkoeM/BR CbtgqRic2k9csVZKaXA9eiKBkpjzGwSElDpp4JAFiXX+Lr+keb74QWqa+ZhMtykDBL CSq2Q0ny8lDZw== 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 v2 8/8] i2c: rtl9300: add RTL9607C i2c controller support Date: Thu, 19 Mar 2026 22:57:53 +0500 Message-ID: <20260319175753.32338-9-adilov@disroot.org> In-Reply-To: <20260319175753.32338-1-adilov@disroot.org> References: <20260319175753.32338-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