Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216488/?format=api
{ "id": 2216488, "url": "http://patchwork.ozlabs.org/api/patches/2216488/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20260326152656.14030-8-adilov@disroot.org/", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api", "name": "Linux I2C development", "link_name": "linux-i2c", "list_id": "linux-i2c.vger.kernel.org", "list_email": "linux-i2c@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260326152656.14030-8-adilov@disroot.org>", "list_archive_url": null, "date": "2026-03-26T15:26:55", "name": "[v5,7/8] i2c: rtl9300: intoduce new function properties to driver data", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "f4df71749ba20a966ebeecffb7f8105b3c3d575f", "submitter": { "id": 92795, "url": "http://patchwork.ozlabs.org/api/people/92795/?format=api", "name": "Rustam Adilov", "email": "adilov@disroot.org" }, "delegate": { "id": 149066, "url": "http://patchwork.ozlabs.org/api/users/149066/?format=api", "username": "cazzacarna", "first_name": "Andi", "last_name": "Shyti", "email": "andi.shyti@kernel.org" }, "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/patch/20260326152656.14030-8-adilov@disroot.org/mbox/", "series": [ { "id": 497610, "url": "http://patchwork.ozlabs.org/api/series/497610/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=497610", "date": "2026-03-26T15:26:49", "name": "i2c: rtl9300: support for RTL9607C I2C controller", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/497610/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216488/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216488/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-i2c+bounces-16811-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-i2c@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256\n header.s=mail header.b=ir/0oiuq;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16811-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org\n header.b=\"ir/0oiuq\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=178.21.23.139", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=disroot.org", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=disroot.org" ], "Received": [ "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhSjD2D1nz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 02:43:12 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 4CE573008299\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 15:30:25 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5580A410D1B;\n\tThu, 26 Mar 2026 15:27:46 +0000 (UTC)", "from layka.disroot.org (layka.disroot.org [178.21.23.139])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ECF5410D0F;\n\tThu, 26 Mar 2026 15:27:44 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1])\n\tby disroot.org (Postfix) with ESMTP id 41EAF26129;\n\tThu, 26 Mar 2026 16:27:43 +0100 (CET)", "from layka.disroot.org ([127.0.0.1])\n by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id HJKt3LxRcoaH; Thu, 26 Mar 2026 16:27:42 +0100 (CET)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774538866; cv=none;\n b=ptCxGBHDVxKFD7HjjMQXs08PXmzqzw8rEACBNWUYrN2CBpoDv0ugWkNmkR7IvtgPr6baeiuPTTLF1Gr3e0CNhYnAlGY1FlxmTCGPjKu1ZU/+8bS3f8bVAZt3vm2gdziCcFSzb+ySjkBNfzIuHK6PKip81Y/AB7D3hdwrjODUo/0=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774538866; c=relaxed/simple;\n\tbh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=QjU0KcwNPBJ8pNllJxcKu82uloYuYTg8F04fhF7Vnc+0aFEWwwurTruy/V/87W2Jo2nlnURnFF5MjexknEdLf1E50gO/ROFpcf4b+d1qkAeICictdnTgghoXXHHmhlg2bzFsjw523TZkPkfY7AU7uUjw408ktRg5Mfltwu6izWU=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=disroot.org;\n spf=pass smtp.mailfrom=disroot.org;\n dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org\n header.b=ir/0oiuq; arc=none smtp.client-ip=178.21.23.139", "X-Virus-Scanned": "SPAM Filter at disroot.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;\n\tt=1774538862; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=ir/0oiuqYwvf3nPaTT4ywMVIzU/qmMQecsU7dgY5prKKGGNrSP+JYvBkn7L1e6oab\n\t /2YRPvEHkAO0GJk3z82LBewCzGGWMIjHYmf3C50/EXuCQucCDpU6vhY+8PbU3JlnOs\n\t X481yBDrrWkl/d/b+6HeT1OQTaQLc3cBNqTHyUFbUX8nbT7sn3zUMRrZt41p5vxqlg\n\t p0N1FtvLV9yBbFo7WptqcOizqBbjOiV/Kc22rB+g+bZNiZ/gLyFScxfMTDoZrvLGzp\n\t xoot2L3A8yBf64mrTzb0sp/h803b5E8AVTBjTIyDOt1Ip7oM5nL8mr+by8hDsfryo9\n\t npQuPQkefvPOw==", "From": "Rustam Adilov <adilov@disroot.org>", "To": "Chris Packham <chris.packham@alliedtelesis.co.nz>,\n\tAndi Shyti <andi.shyti@kernel.org>,\n\tRob Herring <robh@kernel.org>,\n\tKrzysztof Kozlowski <krzk+dt@kernel.org>,\n\tConor Dooley <conor+dt@kernel.org>,\n\tlinux-i2c@vger.kernel.org,\n\tdevicetree@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Cc": "Rustam Adilov <adilov@disroot.org>", "Subject": "[PATCH v5 7/8] i2c: rtl9300: intoduce new function properties to\n driver data", "Date": "Thu, 26 Mar 2026 20:26:55 +0500", "Message-ID": "<20260326152656.14030-8-adilov@disroot.org>", "In-Reply-To": "<20260326152656.14030-1-adilov@disroot.org>", "References": "<20260326152656.14030-1-adilov@disroot.org>", "Precedence": "bulk", "X-Mailing-List": "linux-i2c@vger.kernel.org", "List-Id": "<linux-i2c.vger.kernel.org>", "List-Subscribe": "<mailto:linux-i2c+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-i2c+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Due to the very nature of differences between RTL9607C i2c controller\nand RTL9300 / RTL9310 that are incompatible with each other in some areas\nof this driver, for example in clock configuration, channel configuration\nand initialization at the end of the probe, introduce new function\nproperties to the driver data struct to handle those differences.\n\nWith these new properties, create configuration functions for RTL9300 and\nRTL9310 and assign them to their respective driver data structs.\n\nSigned-off-by: Rustam Adilov <adilov@disroot.org>\n---\n drivers/i2c/busses/i2c-rtl9300.c | 66 +++++++++++++++++++++-----------\n 1 file changed, 44 insertions(+), 22 deletions(-)", "diff": "diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c\nindex 16af49ccd1dd..b718b74afe0d 100644\n--- a/drivers/i2c/busses/i2c-rtl9300.c\n+++ b/drivers/i2c/busses/i2c-rtl9300.c\n@@ -65,6 +65,9 @@ enum rtl9300_i2c_reg_fields {\n struct rtl9300_i2c_drv_data {\n \tstruct rtl9300_i2c_reg_field field_desc[F_NUM_FIELDS];\n \tint (*select_scl)(struct rtl9300_i2c *i2c, u8 scl);\n+\tint (*config_chan)(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan);\n+\tvoid (*config_clock)(u32 clock_freq, struct rtl9300_i2c_chan *chan);\n+\tint (*misc_init)(struct rtl9300_i2c *i2c);\n \tu32 rd_reg;\n \tu32 wd_reg;\n \tu8 max_nchan;\n@@ -175,6 +178,30 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c\n \treturn 0;\n }\n \n+static void rtl9300_i2c_config_clock(u32 clock_freq, struct rtl9300_i2c_chan *chan)\n+{\n+\tstruct rtl9300_i2c *i2c = chan->i2c;\n+\n+\tswitch (clock_freq) {\n+\tcase I2C_MAX_STANDARD_MODE_FREQ:\n+\t\tchan->bus_freq = RTL9300_I2C_STD_FREQ;\n+\t\tbreak;\n+\tcase I2C_MAX_FAST_MODE_FREQ:\n+\t\tchan->bus_freq = RTL9300_I2C_FAST_FREQ;\n+\t\tbreak;\n+\tcase RTL9300_I2C_MAX_SUPER_FAST_FREQ:\n+\t\tchan->bus_freq = RTL9300_I2C_SUPER_FAST_FREQ;\n+\t\tbreak;\n+\tcase RTL9300_I2C_MAX_SLOW_FREQ:\n+\t\tchan->bus_freq = RTL9300_I2C_SLOW_FREQ;\n+\t\tbreak;\n+\tdefault:\n+\t\tdev_warn(i2c->dev, \"SDA%d clock-frequency %d not supported using default\\n\",\n+\t\t\t chan->sda_num, clock_freq);\n+\t\tbreak;\n+\t}\n+}\n+\n static int rtl9300_i2c_read(struct rtl9300_i2c *i2c, u8 *buf, u8 len)\n {\n \tu32 vals[4] = {};\n@@ -322,7 +349,7 @@ static int rtl9300_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr, unsigned s\n \tguard(rtl9300_i2c)(i2c);\n \n \tdrv_data = device_get_match_data(i2c->dev);\n-\tret = rtl9300_i2c_config_chan(i2c, chan);\n+\tret = drv_data->config_chan(i2c, chan);\n \tif (ret)\n \t\treturn ret;\n \n@@ -389,6 +416,12 @@ static struct i2c_adapter_quirks rtl9300_i2c_quirks = {\n \t.max_write_len\t= 16,\n };\n \n+static int rtl9300_i2c_init(struct rtl9300_i2c *i2c)\n+{\n+\t/* only use standard read format */\n+\treturn regmap_field_write(i2c->fields[F_RD_MODE], 0);\n+}\n+\n static int rtl9300_i2c_probe(struct platform_device *pdev)\n {\n \tstruct device *dev = &pdev->dev;\n@@ -453,27 +486,11 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)\n \t\tif (ret)\n \t\t\tclock_freq = I2C_MAX_STANDARD_MODE_FREQ;\n \n-\t\tswitch (clock_freq) {\n-\t\tcase I2C_MAX_STANDARD_MODE_FREQ:\n-\t\t\tchan->bus_freq = RTL9300_I2C_STD_FREQ;\n-\t\t\tbreak;\n-\t\tcase I2C_MAX_FAST_MODE_FREQ:\n-\t\t\tchan->bus_freq = RTL9300_I2C_FAST_FREQ;\n-\t\t\tbreak;\n-\t\tcase RTL9300_I2C_MAX_SUPER_FAST_FREQ:\n-\t\t\tchan->bus_freq = RTL9300_I2C_SUPER_FAST_FREQ;\n-\t\t\tbreak;\n-\t\tcase RTL9300_I2C_MAX_SLOW_FREQ:\n-\t\t\tchan->bus_freq = RTL9300_I2C_SLOW_FREQ;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\tdev_warn(i2c->dev, \"SDA%d clock-frequency %d not supported using default\\n\",\n-\t\t\t\t sda_num, clock_freq);\n-\t\t\tbreak;\n-\t\t}\n-\n \t\tchan->sda_num = sda_num;\n \t\tchan->i2c = i2c;\n+\n+\t\tdrv_data->config_clock(clock_freq, chan);\n+\n \t\tadap = &i2c->chans[i].adap;\n \t\tadap->owner = THIS_MODULE;\n \t\tadap->algo = &rtl9300_i2c_algo;\n@@ -491,8 +508,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)\n \t}\n \ti2c->sda_num = 0xff;\n \n-\t/* only use standard read format */\n-\tret = regmap_field_write(i2c->fields[F_RD_MODE], 0);\n+\tret = drv_data->misc_init(i2c);\n \tif (ret)\n \t\treturn ret;\n \n@@ -521,6 +537,9 @@ static const struct rtl9300_i2c_drv_data rtl9300_i2c_drv_data = {\n \t\t[F_BUSY]\t\t= MST_REG_FIELD(RTL9300_I2C_MST_CTRL1, 0, 0),\n \t},\n \t.select_scl = rtl9300_i2c_select_scl,\n+\t.config_chan = rtl9300_i2c_config_chan,\n+\t.config_clock = rtl9300_i2c_config_clock,\n+\t.misc_init = rtl9300_i2c_init,\n \t.rd_reg = RTL9300_I2C_MST_DATA_WORD0,\n \t.wd_reg = RTL9300_I2C_MST_DATA_WORD0,\n \t.max_nchan = RTL9300_I2C_MUX_NCHAN,\n@@ -545,6 +564,9 @@ static const struct rtl9300_i2c_drv_data rtl9310_i2c_drv_data = {\n \t\t[F_BUSY]\t\t= MST_REG_FIELD(RTL9310_I2C_MST_CTRL, 0, 0),\n \t},\n \t.select_scl = rtl9310_i2c_select_scl,\n+\t.config_chan = rtl9300_i2c_config_chan,\n+\t.config_clock = rtl9300_i2c_config_clock,\n+\t.misc_init = rtl9300_i2c_init,\n \t.rd_reg = RTL9310_I2C_MST_DATA_CTRL,\n \t.wd_reg = RTL9310_I2C_MST_DATA_CTRL,\n \t.max_nchan = RTL9310_I2C_MUX_NCHAN,\n", "prefixes": [ "v5", "7/8" ] }