linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Problem with multiple i2c multiplexers on one bus, and mux bus naming
Date: Sun, 17 Nov 2013 21:41:02 +0100	[thread overview]
Message-ID: <20131117214102.236ae09a@endymion.delvare> (raw)
In-Reply-To: <20131117185624.GA23639-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

Hi Guenter,

On Sun, 17 Nov 2013 10:56:24 -0800, Guenter Roeck wrote:
> I managed to do it without changing the API; see patch below.
> This results in
> 
> i2c-0/name:MPC adapter at 0xfff703000
> i2c-1/name:MPC adapter at 0xfff703100
> i2c-10/name:i2c-2-mux-75 (chan_id 7)
> i2c-11/name:i2c-2-mux-76 (chan_id 0)
> i2c-12/name:i2c-2-mux-76 (chan_id 1)
> i2c-13/name:i2c-2-mux-76 (chan_id 2)
> i2c-14/name:i2c-2-mux-76 (chan_id 3)
> i2c-15/name:i2c-2-mux-76 (chan_id 4)
> i2c-16/name:i2c-2-mux-76 (chan_id 5)
> i2c-17/name:i2c-2-mux-76 (chan_id 6)
> i2c-18/name:i2c-2-mux-76 (chan_id 7)
> i2c-19/name:i2c-0-mux (chan_id 1)
> i2c-2/name:i2c-0-mux (chan_id 0)
> i2c-20/name:i2c-0-mux (chan_id 2)
> i2c-21/name:i2c-0-mux (chan_id 3)
> i2c-22/name:i2c-0-mux (chan_id 4)
> i2c-23/name:i2c-0-mux (chan_id 5)
> i2c-24/name:i2c-0-mux (chan_id 6)
> i2c-25/name:i2c-0-mux (chan_id 7)
> i2c-3/name:i2c-2-mux-75 (chan_id 0)
> i2c-4/name:i2c-2-mux-75 (chan_id 1)
> i2c-5/name:i2c-2-mux-75 (chan_id 2)
> i2c-6/name:i2c-2-mux-75 (chan_id 3)
> i2c-7/name:i2c-2-mux-75 (chan_id 4)
> i2c-8/name:i2c-2-mux-75 (chan_id 5)
> i2c-9/name:i2c-2-mux-75 (chan_id 6)
> 
> This retains the old mux name if the mux is not an i2c device, and adds
> the i2c device address if it is. This solves the problem for me.
> 
> Comments ?

This "for me" worries me a bit. You basically restored the uniqueness
for the multiple I2C-based multiplexer case. But for multiple
GPIO-based multiplexers, for example, the name confusion still exists.
If we are going to address this problem, I believe we should do so in a
way which doesn't need revisiting in a couple months. You are changing
adapter names people or tools may be relying on, we really don't want
to do this too often.

We could use the first GPIO pin number as the unique identifier for the
GPIO case. However I2C addresses and GPIO pin numbers could collide...
So we'd need separate name spaces, too.

I agree this makes things even more complicated than they are right
now, but I can't think of any other way that would be both robust and
durable.

-- 
Jean Delvare

  parent reply	other threads:[~2013-11-17 20:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 18:31 Problem with multiple i2c multiplexers on one bus, and mux bus naming Guenter Roeck
     [not found] ` <5287B9E4.1020107-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-11-16 20:41   ` Jean Delvare
     [not found]     ` <20131116214116.3d035b76-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-11-16 20:43       ` Jean Delvare
     [not found]         ` <20131116214318.1d101d35-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-11-17 18:56           ` Guenter Roeck
     [not found]             ` <20131117185624.GA23639-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-11-17 20:41               ` Jean Delvare [this message]
     [not found]                 ` <20131117214102.236ae09a-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-11-17 21:13                   ` Guenter Roeck
     [not found]                     ` <52893187.3000600-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-11-18 14:14                       ` Jean Delvare
     [not found]                         ` <20131118151441.0ad2b5d8-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2013-11-18 17:14                           ` Guenter Roeck
2013-11-17 17:23       ` Guenter Roeck
     [not found]         ` <5288FB94.6000304-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-11-17 20:31           ` Jean Delvare

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=20131117214102.236ae09a@endymion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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).