Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2218711/?format=api
{ "id": 2218711, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2218711/?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-7-adilov@disroot.org>", "date": "2026-04-01T18:06:46", "name": "[v6,6/8] i2c: rtl9300: introduce clk struct for upcoming rtl9607 support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "8677c43dfa3f43ae54c209a223c3d375aa22ffb4", "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-7-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/2218711/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-i2c+bounces-16911-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=Jzuisael;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=104.64.211.4; helo=sin.lore.kernel.org;\n envelope-from=linux-i2c+bounces-16911-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=\"Jzuisael\"", "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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmCmd4P55z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 05:14:09 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 4A1833064701\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 1 Apr 2026 18:07:56 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D759E31AABF;\n\tWed, 1 Apr 2026 18:07:30 +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 4C9C931A7F6;\n\tWed, 1 Apr 2026 18:07:29 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1])\n\tby disroot.org (Postfix) with ESMTP id E8D9926998;\n\tWed, 1 Apr 2026 20:07:27 +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 7H1EtqIRHM_l; Wed, 1 Apr 2026 20:07:27 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775066850; cv=none;\n b=sURjaqs/enoj9aOyF4MO+p9R83nBPox8dk00SXe4my4bXdSWk4kr5PPcc9FxtJR0FHELWs8pFwA2fC34tt1gwqM6dmRiM3m0yIaLuPmjwoh7hREz5Yhqj5vtVYVNQlCj4hfo06D9/uDeYQQVZFh+tfbDhKSIQ/EZ33O3x5YHXHY=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775066850; c=relaxed/simple;\n\tbh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=WS3UFhVT3DXhSfApGmLcT5oDnRWBcsECrq3Ml6P4XwFLzhy/73ExwdmxC9agKwt7uHdfNESUWFt7nuxTaQNnk3CPNSFCVl/JEA/VE8mXk5dr+R+KbOQ8OqJThG81JoQN61P4jsjqUQLjfULN+SmwMta2xa8XlSijwZj33wXdZbE=", "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=Jzuisael; 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=1775066847; bh=hvgnFd6i8bH5mUG8809MkRlOdbcEZRveaBCGMvPKUaQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=JzuisaelndXusVeeGvqhZNQjEym7Oz+UPCpqNuYkysEYgW1ciF8wGSOmrO8n6SAGm\n\t 2c/vjnfXbSJZ4pbNYtKv56vc8XS+ZIsm5QxPxu10RMaFPb0tDjrQrSDjd4+8ldxX4R\n\t C5rHhAJpGIVBSfK37b8mPTxyYVZKjvlzuPmZkI0VUBzNSWcBw7JfbDJbP/T9fgmu00\n\t UxolhfkcqjrHQ4i+lpIcIzqD7Z0c0h8fF2AhswKrJGvmRmNBnK5dGs1SQcEz2N8+wd\n\t Tu8KBOguHBR/7vXf0kB45g60NM9I82CxZz8az+cpM3MpolX4FqdOwljNuaULa7LSuR\n\t //xO5k63P9tOA==", "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 6/8] i2c: rtl9300: introduce clk struct for upcoming\n rtl9607 support", "Date": "Wed, 1 Apr 2026 23:06:46 +0500", "Message-ID": "<20260401180648.337834-7-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": "In RTL9607C i2c controller, there is 10 bit CLK_DIV field for\nsetting the clock of i2c interface which depends on the rate\nof i2c clk (which seems be fixed to 62.5MHz according to Realtek SDK).\n\nIntroduce the clk struct and the respective F_CLK_DIV and clk_div\nwhich are going to be used in the upcoming patch for rtl9607c i2c\ncontroller support addition.\n\ndevm_clk_get_optional_enabled() function was used for cleaner code\nas it automatically returns NULL if the clk is not present, which is\ngoing to be the case for RTL9300 and RTL9310 i2c controllers.\n\nReviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>\nSigned-off-by: Rustam Adilov <adilov@disroot.org>\n---\n drivers/i2c/busses/i2c-rtl9300.c | 8 ++++++++\n 1 file changed, 8 insertions(+)", "diff": "diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c\nindex ffbc6c52861b..16af49ccd1dd 100644\n--- a/drivers/i2c/busses/i2c-rtl9300.c\n+++ b/drivers/i2c/busses/i2c-rtl9300.c\n@@ -1,6 +1,7 @@\n // SPDX-License-Identifier: GPL-2.0-only\n \n #include <linux/bits.h>\n+#include <linux/clk.h>\n #include <linux/i2c.h>\n #include <linux/i2c-mux.h>\n #include <linux/mod_devicetable.h>\n@@ -28,6 +29,7 @@ struct rtl9300_i2c_chan {\n \tstruct rtl9300_i2c *i2c;\n \tenum rtl9300_bus_freq bus_freq;\n \tu8 sda_num;\n+\tu32 clk_div;\n };\n \n enum rtl9300_i2c_reg_scope {\n@@ -54,6 +56,7 @@ enum rtl9300_i2c_reg_fields {\n \tF_SDA_OUT_SEL,\n \tF_SDA_SEL,\n \tF_BUSY,\n+\tF_CLK_DIV,\n \n \t/* keep last */\n \tF_NUM_FIELDS\n@@ -85,6 +88,7 @@ struct rtl9300_i2c {\n \tu8 scl_num;\n \tu8 sda_num;\n \tstruct mutex lock;\n+\tstruct clk *clk;\n };\n \n DEFINE_GUARD(rtl9300_i2c, struct rtl9300_i2c *, mutex_lock(&_T->lock), mutex_unlock(&_T->lock))\n@@ -432,6 +436,10 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)\n \tif (ret)\n \t\treturn ret;\n \n+\ti2c->clk = devm_clk_get_optional_enabled(dev, NULL);\n+\tif (IS_ERR(i2c->clk))\n+\t\treturn dev_err_probe(dev, PTR_ERR(i2c->clk), \"Failed to enable i2c clock\\n\");\n+\n \ti = 0;\n \tfor_each_child_of_node_scoped(dev->of_node, child) {\n \t\tstruct rtl9300_i2c_chan *chan = &i2c->chans[i];\n", "prefixes": [ "v6", "6/8" ] }