Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2218707/?format=api
{ "id": 2218707, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2218707/?format=api", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/1.0/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": "" }, "msgid": "<20260401180648.337834-8-adilov@disroot.org>", "date": "2026-04-01T18:06:47", "name": "[v6,7/8] i2c: rtl9300: introduce new function properties to driver data", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "f4df71749ba20a966ebeecffb7f8105b3c3d575f", "submitter": { "id": 92795, "url": "http://patchwork.ozlabs.org/api/1.0/people/92795/?format=api", "name": "Rustam Adilov", "email": "adilov@disroot.org" }, "delegate": { "id": 149066, "url": "http://patchwork.ozlabs.org/api/1.0/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/20260401180648.337834-8-adilov@disroot.org/mbox/", "series": [ { "id": 498375, "url": "http://patchwork.ozlabs.org/api/1.0/series/498375/?format=api", "date": "2026-04-01T18:06:41", "name": "i2c: rtl9300: support for RTL9607C I2C controller", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/498375/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218707/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-i2c+bounces-16912-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=fqTo0jso;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16912-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=\"fqTo0jso\"", "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 [172.105.105.114])\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 4fmCh30sMyz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 05:10:11 +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 4B46C30A295D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 18:08:01 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 78D2C31C56D;\n\tWed, 1 Apr 2026 18:07:33 +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 A8D7B31B10B;\n\tWed, 1 Apr 2026 18:07:31 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1])\n\tby disroot.org (Postfix) with ESMTP id 46ADF266FA;\n\tWed, 1 Apr 2026 20:07:30 +0200 (CEST)", "from layka.disroot.org ([127.0.0.1])\n by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id EOm9lDE-4uNI; Wed, 1 Apr 2026 20:07:29 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775066853; cv=none;\n b=Ji1RPuutKBNfGN9CPEV1wVFz3QEqxy8PQ2utmBWTgcVTqyBNYBM5NTX8imW3wqBJvyUw0AewrXxVpgrE0ZO1ArTQgjMNiF3EikqdBALIug5/EtAeSJt5EJPwBWaq4DK79UvP9/PSHBNjkFgEQxHWwHcVqtd+jMtvHczEUb1+8OE=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775066853; 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=bbEzGt/AUD2yrI8OkA3V383rlRXV4+JGV3yiq5v99IDZRhvJfzCDRu2PDI+Wf5IUmegKMQKADr2rp02ylB7sJgIawLI95G1H0WA+luKdO7/5cNa3cT5cKX6vrd02Qds7QI13ki3YIF4sxqqPx1HCRpefFQ9j+Y3/0xk1Qoo/7DM=", "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=fqTo0jso; 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=1775066849; bh=ov7gAUZ+HttR2UyoVExn+ZrfViQk6IyIflOA57OqFPw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=fqTo0jsog6Olfp9mYFU8Ix7CnMVWB1IA6R8OLZKO4/Fip+5AEX2s75Hj3czXqldih\n\t GMAmCVU1eDeLdGJYjs8eal4RpZ8zz0wsTlF9YK6nCYVxlJn4Btf1aiI36fgjuXuoGx\n\t a7A3UgQXg/NO7jd6GMxRcXYqr2q3YTe0FL2/kTR+o0c/adyY3Pyq4Ve5wI6rty2sII\n\t /bzzrr4HxvBbGwqejYNgt+XY2GE4Df9xQsZK0+TYy0lU7Huovw7mm4dQTIRJSJ8sUh\n\t 2pEtTVzTfDn6sSuVUo/h/jtUVd6KcimRGkEW0cMT7p6Zg2UmgKw9b+p1UgX5uPmUkw\n\t vWqHIFTqgiVEA==", "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 v6 7/8] i2c: rtl9300: introduce new function properties to\n driver data", "Date": "Wed, 1 Apr 2026 23:06:47 +0500", "Message-ID": "<20260401180648.337834-8-adilov@disroot.org>", "In-Reply-To": "<20260401180648.337834-1-adilov@disroot.org>", "References": "<20260401180648.337834-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": [ "v6", "7/8" ] }