From nobody Fri Sep 25 22:18:45 2026 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 443B8381B1C for ; Tue, 8 Sep 2026 06:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788848789; cv=none; b=HcbBo58hi7pgwFzuUPRp9myRYfHZzbQO7dejAEYkqZSWaM6eSQLFmakWZSl3CArap0nxLeBzgEvWRu9BhnRGD83iTifxcMz6Yvkgy0NCYVYK2bJ5/IMTdv6meslTX3q4zciMEFJTSqPVK0kzLP8F6PapTmCzykSkDZD17OucTGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788848789; c=relaxed/simple; bh=k/Ku8LU6ugqloGgzvXwvaI4XL7y3mzzbLgYVblGmuGU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t3lzpdfOVy4BLO9WRDNMJhBkJcJKWjK6Cpm+UQYzkQnutLFvCnezwXJUGvv88CwGaxaRy/R/VKwRaHOvvLeqFofahFEFBbY/1YXzW8oK3AMOhow/7A2WOocGcHPDjHuQMD982rca7EAcqmb48XFL14g+GNMOaqHjCec2fpcUBzw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PeUX4eZX; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PeUX4eZX" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-cc1d57602e8so3701680a12.3 for ; Mon, 07 Sep 2026 23:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788848787; x=1789453587; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=H+8mig4WNfJCkEjs7JPdgjRjkIJBtDmluQCyK6Ikj9E=; b=PeUX4eZXuUqvx7vgB8W54a9Ki94Ckp5L+iLZJZ4+uOI70QHfKX997CU2SXEDRvwWkq YdEn2fP2mkR//rxVUwMghVxVcNUYBJ0cvLe2aRCHrEHaWbC7fMypLkIJ96w+HxeAw2ne hzBvQVaHSTm/7+aT7tMgKMWhGhOzVHIpsb8tupnm9Uh8GmDccarQLA82AcKH+fOylrxx ccbWGfMhW//m8JXJAdihrwk509XDO3djEMrjRW6VCzmk7AtCud5fHZggAyYWsiTkAAuI 7HyzqWuud8v5+P8q/ruJx+AZwTK+JVaS5FhSz4AePg2RMd/G0624pvKG3zoFpaX+uDZA q3XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788848787; x=1789453587; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=H+8mig4WNfJCkEjs7JPdgjRjkIJBtDmluQCyK6Ikj9E=; b=FlJbZNsT/SqUkkZ6M7dxz8QAHOxgU89rx4YQN/bKJsl6qB10xbVCBeePeTRxuIWH0t OiQMQjOJxkWbm8AtgrCVuSFpbgBcuXMxfd885WkDfnrCckIpO40XnCJQ1b9Je6Fq/CRg vmjPkpSZorNdLYfscEHHPeSmrAC/CXsv+L8K8Oky8z9upawK2L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by 2002:a05:6a21:a05:b0:3cc:9620:5816 with SMTP id adf61e73a8af0-3da39cf20c8mr43080673637.8.1788848787479; Mon, 07 Sep 2026 23:26:27 -0700 (PDT) Received: from Mac.localdomain (198-27-228-154.fiber.dynamic.sonic.net. [198.27.228.154]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-143243bfbe3sm30960386c88.11.2026.09.07.23.26.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Sep 2026 23:26:26 -0700 (PDT) From: Ahmad Byagowi To: Andi Shyti Cc: Peter Rosin , Andy Shevchenko , Jakub Kicinski , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v10 1/2] i2c: mux: Factor out channel node lookup Date: Mon, 7 Sep 2026 23:26:22 -0700 Message-ID: X-Mailer: git-send-email 2.50.1 In-Reply-To: References: 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" Move the existing Device Tree channel-node lookup into a helper in preparation for using generic firmware-node operations. This is a pure refactoring with no functional change. Signed-off-by: Ahmad Byagowi Acked-by: Peter Rosin Reviewed-by: Andy Shevchenko --- drivers/i2c/i2c-mux.c | 84 +++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 38 deletions(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 68a4c34b5987..d207f0e81807 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -264,6 +264,51 @@ static const struct i2c_lock_operations i2c_parent_loc= k_ops =3D { .unlock_bus =3D i2c_parent_unlock_bus, }; =20 +static struct device_node * +i2c_mux_get_channel_node(struct i2c_mux_core *muxc, u32 chan_id) +{ + struct device_node *dev_node; + struct device_node *mux_node; + struct device_node *child; + u32 reg; + int ret; + + dev_node =3D dev_of_node(muxc->dev); + if (!dev_node) + return NULL; + + if (muxc->arbitrator) + mux_node =3D of_get_child_by_name(dev_node, "i2c-arb"); + else if (muxc->gate) + mux_node =3D of_get_child_by_name(dev_node, "i2c-gate"); + else + mux_node =3D of_get_child_by_name(dev_node, "i2c-mux"); + + if (mux_node) { + /* A "reg" property indicates an old-style DT entry */ + if (!of_property_read_u32(mux_node, "reg", ®)) { + of_node_put(mux_node); + mux_node =3D NULL; + } + } + + if (!mux_node) + mux_node =3D of_node_get(dev_node); + else if (muxc->arbitrator || muxc->gate) + return mux_node; + + for_each_child_of_node(mux_node, child) { + ret =3D of_property_read_u32(child, "reg", ®); + if (ret) + continue; + if (chan_id =3D=3D reg) + break; + } + + of_node_put(mux_node); + return child; +} + int i2c_mux_add_adapter(struct i2c_mux_core *muxc, u32 force_nr, u32 chan_id) { @@ -327,44 +372,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, * Try to populate the mux adapter's of_node, expands to * nothing if !CONFIG_OF. */ - if (muxc->dev->of_node) { - struct device_node *dev_node =3D muxc->dev->of_node; - struct device_node *mux_node, *child =3D NULL; - u32 reg; - - if (muxc->arbitrator) - mux_node =3D of_get_child_by_name(dev_node, "i2c-arb"); - else if (muxc->gate) - mux_node =3D of_get_child_by_name(dev_node, "i2c-gate"); - else - mux_node =3D of_get_child_by_name(dev_node, "i2c-mux"); - - if (mux_node) { - /* A "reg" property indicates an old-style DT entry */ - if (!of_property_read_u32(mux_node, "reg", ®)) { - of_node_put(mux_node); - mux_node =3D NULL; - } - } - - if (!mux_node) - mux_node =3D of_node_get(dev_node); - else if (muxc->arbitrator || muxc->gate) - child =3D of_node_get(mux_node); - - if (!child) { - for_each_child_of_node(mux_node, child) { - ret =3D of_property_read_u32(child, "reg", ®); - if (ret) - continue; - if (chan_id =3D=3D reg) - break; - } - } - - priv->adap.dev.of_node =3D child; - of_node_put(mux_node); - } + priv->adap.dev.of_node =3D i2c_mux_get_channel_node(muxc, chan_id); =20 /* * Associate the mux channel with an ACPI node. --=20 2.50.1 (Apple Git-155) From nobody Fri Sep 25 22:18:45 2026 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 C3C37382F03 for ; Tue, 8 Sep 2026 06:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788848791; cv=none; b=dEiRqMhp1ciaI/uUyxoRL1SEm9JayUoDa5fzDHhaYoK7Om6HmhisGIKMJZIR52YpkNyRZrN78huxsnrvAM30dJeq5eK19CqduWJBnpIFJsjDWHNRHMnnJxlRKAPQO/wwD8gixF9LYxg3f5yzEGYYeZ/2dr6R1M5L61qfPqXUagY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788848791; c=relaxed/simple; bh=97JdfI+gRP1Pezy2CAC1AmZs6867Bh/GeLRKB1Pid9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gOo96qRbiJkny1MhnWgFWDRn34a2LIuxFDhAd20yEQ2Tb4mH46zBVx1r1MElAG704Rt9uq40sXGxUZSydj8lmZfU6zNg2h1zboMg29Vd+oYb3KWmugdu6Y+ba/iZB5sN1LdWyP1bZEM6qVhGwhpjIxlQk0xpgbU44liWL8ZoxtI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O//bnrcr; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O//bnrcr" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-86265451beeso1984731b3a.0 for ; Mon, 07 Sep 2026 23:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788848789; x=1789453589; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=fOo554LOyHwXNx9s3zqKma38NV/omqaXfwDDRqw2vNo=; b=O//bnrcrzXiW0yAVa9RfTbyWqJubSsATdqVk/uSDCmXQcvnaA5E5pHEfrH4ohVAtNA 8zQRq45G8iXnf7Jwdo/QLM5Z7xdyCAAGpMHhF7kAEaUnVPaQ3pc2GsVO9jLiEHVHzgRD f/0PR2+8ih9x+1BLL8LyLdgi90wZCyDPxvDycAh6pXEOFDZo4ue3DfIcloB/yqiipGab rqnpeYFt4lPAmd0EUp4RtUrEHGzPdvpcc14kvnr1suPeZRZ2JCmz+HBtDeGaZ3C2dhvI vzbOs5QLl/cNgNYiEH2w4FlGuC5U6yxIQnnNcrs7Y2ztIRiXtNoksdPcHPuzzlMFJJDk JmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788848789; x=1789453589; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=fOo554LOyHwXNx9s3zqKma38NV/omqaXfwDDRqw2vNo=; b=YjY4xGkV4ofJxWpq+HgUBfCTDlmO23R/ulmbGgp8sqbkk9dM2HLo04h7rgR6a+3CsV 3VMzrAXDfbZTBY3pPVrrlKHb6mnsLmvi325IIK0LylldRzkvRR1aOyB4e2C/2APzvMHZ ZpuP/jCsU/nueaQ+5NHGGJR0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X-Received: by 2002:a05:6a21:70c5:b0:3d3:b00a:6f03 with SMTP id adf61e73a8af0-3da3a17910bmr41885190637.28.1788848789099; Mon, 07 Sep 2026 23:26:29 -0700 (PDT) Received: from Mac.localdomain (198-27-228-154.fiber.dynamic.sonic.net. [198.27.228.154]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-143243bfbe3sm30960386c88.11.2026.09.07.23.26.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Sep 2026 23:26:28 -0700 (PDT) From: Ahmad Byagowi To: Andi Shyti Cc: Peter Rosin , Andy Shevchenko , Jakub Kicinski , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v10 2/2] i2c: mux: Propagate firmware nodes to channel adapters Date: Mon, 7 Sep 2026 23:26:23 -0700 Message-ID: <00b33b4b352848ff87dd9089190b35d8732676f3.1788623619.git.ahmadexp@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: 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" Device Tree channel nodes are associated with the adapters created by i2c-mux, but equivalent firmware-node descriptions are not. Use generic firmware-node operations for the existing channel lookup and associate the returned node with the adapter. Do not restrict the lookup by firmware-node type, so Device Tree, software nodes, and ACPI descriptions all follow the same property traversal. The existing acpi_preset_companion() call remains in place for the standard ACPI channel association. Keep a separate reference to the node returned by the generic lookup because acpi_preset_companion() may replace the device's primary firmware node. Release the saved reference after adapter deletion. Signed-off-by: Ahmad Byagowi Acked-by: Peter Rosin Reviewed-by: Andy Shevchenko --- drivers/i2c/i2c-mux.c | 46 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index d207f0e81807..53428098ddc7 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include =20 @@ -33,6 +33,7 @@ struct i2c_mux_priv { struct i2c_adapter adap; struct i2c_algorithm algo; struct i2c_mux_core *muxc; + struct fwnode_handle *channel_node; u32 chan_id; }; =20 @@ -264,48 +265,48 @@ static const struct i2c_lock_operations i2c_parent_lo= ck_ops =3D { .unlock_bus =3D i2c_parent_unlock_bus, }; =20 -static struct device_node * +static struct fwnode_handle * i2c_mux_get_channel_node(struct i2c_mux_core *muxc, u32 chan_id) { - struct device_node *dev_node; - struct device_node *mux_node; - struct device_node *child; + struct fwnode_handle *dev_node; + struct fwnode_handle *mux_node; + struct fwnode_handle *child; u32 reg; int ret; =20 - dev_node =3D dev_of_node(muxc->dev); + dev_node =3D dev_fwnode(muxc->dev); if (!dev_node) return NULL; =20 if (muxc->arbitrator) - mux_node =3D of_get_child_by_name(dev_node, "i2c-arb"); + mux_node =3D fwnode_get_named_child_node(dev_node, "i2c-arb"); else if (muxc->gate) - mux_node =3D of_get_child_by_name(dev_node, "i2c-gate"); + mux_node =3D fwnode_get_named_child_node(dev_node, "i2c-gate"); else - mux_node =3D of_get_child_by_name(dev_node, "i2c-mux"); + mux_node =3D fwnode_get_named_child_node(dev_node, "i2c-mux"); =20 if (mux_node) { - /* A "reg" property indicates an old-style DT entry */ - if (!of_property_read_u32(mux_node, "reg", ®)) { - of_node_put(mux_node); + /* A "reg" property indicates an old-style firmware entry. */ + if (!fwnode_property_read_u32(mux_node, "reg", ®)) { + fwnode_handle_put(mux_node); mux_node =3D NULL; } } =20 if (!mux_node) - mux_node =3D of_node_get(dev_node); + mux_node =3D fwnode_handle_get(dev_node); else if (muxc->arbitrator || muxc->gate) return mux_node; =20 - for_each_child_of_node(mux_node, child) { - ret =3D of_property_read_u32(child, "reg", ®); + fwnode_for_each_child_node(mux_node, child) { + ret =3D fwnode_property_read_u32(child, "reg", ®); if (ret) continue; if (chan_id =3D=3D reg) break; } =20 - of_node_put(mux_node); + fwnode_handle_put(mux_node); return child; } =20 @@ -368,11 +369,9 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, else priv->adap.lock_ops =3D &i2c_parent_lock_ops; =20 - /* - * Try to populate the mux adapter's of_node, expands to - * nothing if !CONFIG_OF. - */ - priv->adap.dev.of_node =3D i2c_mux_get_channel_node(muxc, chan_id); + /* Associate the mux adapter with its channel firmware node. */ + priv->channel_node =3D i2c_mux_get_channel_node(muxc, chan_id); + device_set_node(&priv->adap.dev, priv->channel_node); =20 /* * Associate the mux channel with an ACPI node. @@ -416,7 +415,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, return 0; =20 err_free_priv: - of_node_put(priv->adap.dev.of_node); + fwnode_handle_put(priv->channel_node); kfree(priv); return ret; } @@ -429,7 +428,6 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc) while (muxc->num_adapters) { struct i2c_adapter *adap =3D muxc->adapter[--muxc->num_adapters]; struct i2c_mux_priv *priv =3D adap->algo_data; - struct device_node *np =3D adap->dev.of_node; =20 muxc->adapter[muxc->num_adapters] =3D NULL; =20 @@ -439,7 +437,7 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc) =20 sysfs_remove_link(&priv->adap.dev.kobj, "mux_device"); i2c_del_adapter(adap); - of_node_put(np); + fwnode_handle_put(priv->channel_node); kfree(priv); } } --=20 2.50.1 (Apple Git-155)