From: Herve Codina <herve.codina@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Andi Shyti <andi.shyti@kernel.org>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Peter Rosin <peda@lysator.liu.se>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Allan Nielsen <allan.nielsen@microchip.com>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
Daniel Machon <daniel.machon@microchip.com>,
Steen Hegelund <steen.hegelund@microchip.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Herve Codina <herve.codina@bootlin.com>
Subject: [PATCH v9 2/3] i2c: {mux,atr}: Set adapter physical device
Date: Wed, 4 Nov 2026 14:53:05 +0100 [thread overview]
Message-ID: <20261104135324.492692-3-herve.codina@bootlin.com> (raw)
In-Reply-To: <20261104135324.492692-1-herve.codina@bootlin.com>
For i2c muxes and atrs (address translators), the parent of the mux/atr
adapter device is the adapter device the mux/atr is connected to.
This parent is not the physical device related to the mux/atr adapter.
Indeed, the physical device of the mux/atr adapter is the mux/atr device
itself.
Fill the adap.physdev with the mux/atr device.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
---
drivers/i2c/i2c-atr.c | 1 +
drivers/i2c/i2c-mux.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/i2c/i2c-atr.c b/drivers/i2c/i2c-atr.c
index b98442ffff94..a591d39050e7 100644
--- a/drivers/i2c/i2c-atr.c
+++ b/drivers/i2c/i2c-atr.c
@@ -824,6 +824,7 @@ int i2c_atr_add_adapter(struct i2c_atr *atr, struct i2c_atr_adap_desc *desc)
chan->adap.algo = &atr->algo;
chan->adap.algo_data = chan;
chan->adap.dev.parent = desc->parent;
+ chan->adap.physdev = dev;
chan->adap.retries = parent->retries;
chan->adap.timeout = parent->timeout;
chan->adap.quirks = parent->quirks;
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 53428098ddc7..c1836114ef56 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -361,6 +361,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
priv->adap.algo = &priv->algo;
priv->adap.algo_data = priv;
priv->adap.dev.parent = &parent->dev;
+ priv->adap.physdev = muxc->dev;
priv->adap.retries = parent->retries;
priv->adap.timeout = parent->timeout;
priv->adap.quirks = parent->quirks;
--
2.56.0
next prev parent reply other threads:[~2026-11-04 13:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 13:53 [PATCH v9 0/3] lan966x pci device: Add support for SFPs, i2c part Herve Codina
2026-11-04 13:53 ` [PATCH v9 1/3] i2c: core: Introduce i2c_get_adapter_physdev() Herve Codina
2026-11-04 13:53 ` Herve Codina [this message]
2026-11-04 13:53 ` [PATCH v9 3/3] i2c: {mux,atr}: Create missing devlink between mux/atr and adapter physical device Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104135324.492692-3-herve.codina@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=allan.nielsen@microchip.com \
--cc=andi.shyti@kernel.org \
--cc=andrew@lunn.ch \
--cc=daniel.machon@microchip.com \
--cc=horatiu.vultur@microchip.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=peda@lysator.liu.se \
--cc=robh@kernel.org \
--cc=saravanak@kernel.org \
--cc=steen.hegelund@microchip.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®