From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>,
Martin Belanger
<martin.belanger-Ir6+u9MVKBtBDgjK7y7TUQ@public.gmane.org>,
Rodolfo Giometti
<giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org>,
Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>,
Jeroen De Wachter
<jeroen.de.wachter-CNXmb7IdZIWZIoH1IeqzKA@public.gmane.org>,
Gerlando Falauto
<gerlando.falauto-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH v3 1/2] i2c: mux: create symlink to actual mux device
Date: Thu, 13 Nov 2014 19:55:45 -0800 [thread overview]
Message-ID: <54657D41.5010006@roeck-us.net> (raw)
In-Reply-To: <1415885996-14770-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
On 11/13/2014 05:39 AM, Wolfram Sang wrote:
> The current implementation creates muxed i2c-<n> busses as immediate
> children of their i2c-<n> parent bus. In case of multiple muxes on one
> bus, it is impossible to determine which muxed bus comes from which mux.
>
> It could be argued that the parent device should be changed from the
> parent adapter to the mux device. This has pros and cons. To improve the
> topology, simply add a "muxed_device" symlink pointing to the actual
> muxing device, so we can distinguish muxed busses. Doing it this way, we
> don't break the ABI.
>
> Signed-off-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
> Cc: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
> Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> Cc: Martin Belanger <martin.belanger-Ir6+u9MVKBtBDgjK7y7TUQ@public.gmane.org>
> Cc: Rodolfo Giometti <giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org>
> Cc: Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>
> Cc: Jeroen De Wachter <jeroen.de.wachter-CNXmb7IdZIWZIoH1IeqzKA@public.gmane.org>
> Cc: Gerlando Falauto <gerlando.falauto-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
This version works for me and passes testing with our application code.
Tested-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> ---
> drivers/i2c/i2c-mux.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
> index 2d0847b6be62..f246a9f7dd22 100644
> --- a/drivers/i2c/i2c-mux.c
> +++ b/drivers/i2c/i2c-mux.c
> @@ -183,6 +183,9 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
> return NULL;
> }
>
> + WARN(sysfs_create_link(&priv->adap.dev.kobj, &mux_dev->kobj, "mux_device"),
> + "can't create symlink to mux device\n");
> +
> dev_info(&parent->dev, "Added multiplexed i2c bus %d\n",
> i2c_adapter_id(&priv->adap));
>
> @@ -194,6 +197,7 @@ void i2c_del_mux_adapter(struct i2c_adapter *adap)
> {
> struct i2c_mux_priv *priv = adap->algo_data;
>
> + sysfs_remove_link(&priv->adap.dev.kobj, "mux_device");
> i2c_del_adapter(adap);
> kfree(priv);
> }
>
next prev parent reply other threads:[~2014-11-14 3:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 13:39 [PATCH v3 1/2] i2c: mux: create symlink to actual mux device Wolfram Sang
[not found] ` <1415885996-14770-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-11-13 13:39 ` [PATCH v3 2/2] i2c: mux: create "channel-n" symlinks for child segments in the " Wolfram Sang
[not found] ` <1415885996-14770-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-11-18 15:12 ` Wolfram Sang
2014-11-29 23:29 ` Danielle Costantino
[not found] ` <CAAVjN7etzqy7tum5yboVErhWZ=VhKy9c6UG5xMMTihgjG9ZDqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-01 17:26 ` Wolfram Sang
2014-11-14 3:55 ` Guenter Roeck [this message]
[not found] ` <54657D41.5010006-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-11-14 10:01 ` [PATCH v3 1/2] i2c: mux: create symlink to actual " Jeroen De Wachter
[not found] ` <468558661.38819776.1415959307717.JavaMail.root-CNXmb7IdZIWZIoH1IeqzKA@public.gmane.org>
2014-11-14 11:32 ` Wolfram Sang
2014-11-18 15:11 ` Wolfram Sang
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=54657D41.5010006@roeck-us.net \
--to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
--cc=gerlando.falauto-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org \
--cc=giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org \
--cc=jdelvare-l3A5Bk7waGM@public.gmane.org \
--cc=jeroen.de.wachter-CNXmb7IdZIWZIoH1IeqzKA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=martin.belanger-Ir6+u9MVKBtBDgjK7y7TUQ@public.gmane.org \
--cc=ml.lawnick-Mmb7MZpHnFY@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).