All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Michael Lawnick <ml.lawnick-Mmb7MZpHnFY@public.gmane.org>
Cc: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Rodolfo Giometti
	<giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH v2 1/2] i2c: Multiplexed I2C bus core support
Date: Fri, 11 Jun 2010 11:40:03 +0200	[thread overview]
Message-ID: <20100611114003.01c15f62@hyperion.delvare> (raw)
In-Reply-To: <4C11D85F.7010604-Mmb7MZpHnFY@public.gmane.org>

Hi Michael,

On Fri, 11 Jun 2010 08:31:59 +0200, Michael Lawnick wrote:
> Jean Delvare said the following:
> > Hi Michael,
> > 
> >> +	list_add_tail(&priv->adap.mux_list, &parent->mux_list_head);
> > 
> > The driver core maintains a device tree already, do you really need to
> > keep your own? We've tried hard to remove all redundancy between
> > i2c-core and the driver core in the last couple years, so I really would
> > like us to not add such redundancy back now.
> > 
> > If you have a good reason to have your own list, please explain. If
> > not, please get rid of it.
> > 
> this is a core part of mux management. You need it for checking whether
> the current client that is to be added is already present.
> The problem is to efficiently parse down a mux tree towards the leaves.
> Sub-muxes are registered as i2c clients to their upper bus.

This is correct, but irrelevant, as far as I can see. When walking an
I2C segment tree towards the leaves, you care about the segments
themselves (struct i2c_adapter), not the mux chips. In your
architecture, muxed segments are direct children of the root segment
from the device tree perspective, not children of the mux chip.

> I found no way to separate muxes from normal clients.

If you have to, it is easy, the driver core has support for this
already. Search for i2c_client_type and i2c_adapter_type in i2c-core.c.
We could add i2c_mux_type easily. But as I wrote above, I don't think
we need this.

> So there were two ideas:
> invent a client-type field in i2c-client or to hold a separate list.
> The first one e.g. would have the possibility to provide basic info in sysFs
> but I feared a general debate. So I decided to go the other way which is
> hidden to the outer world.
> 
> If you don't like this way, I'd need some ideas how to do it.

I would walk the device tree maintained by the driver core (using
device_for_each_child) and filtering out irrelevant devices. Basically
filtering on dev->type == &i2c_adapter_type should do the trick,
methinks. Is there anything I am missing?

Thanks,
-- 
Jean Delvare

  parent reply	other threads:[~2010-06-11  9:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 12:46 [PATCH v2 1/2] i2c: Multiplexed I2C bus core support Michael Lawnick
     [not found] ` <4BE01741.1010909-Mmb7MZpHnFY@public.gmane.org>
2010-05-04 12:48   ` [PATCH v2 2/2] i2c: Multiplexed I2C bus multiplexer driver pca954x Michael Lawnick
     [not found]     ` <4BE01795.1090605-Mmb7MZpHnFY@public.gmane.org>
2010-05-04 12:52       ` Rodolfo Giometti
2010-06-09 16:41       ` Jean Delvare
     [not found]         ` <20100609184143.06488f2f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-06-10 10:15           ` Michael Lawnick
2010-06-13 12:11       ` Jean Delvare
     [not found]         ` <20100613141122.1d5b1423-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-06-14  9:09           ` Michael Lawnick
2010-05-04 12:52   ` [PATCH v2 1/2] i2c: Multiplexed I2C bus core support Rodolfo Giometti
2010-05-17  7:36   ` Michael Lawnick
     [not found]     ` <4BF0F200.5090604-Mmb7MZpHnFY@public.gmane.org>
2010-05-17  8:15       ` Jean Delvare
2010-06-10 13:24   ` Jean Delvare
     [not found]     ` <20100610152411.5497461c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-06-11  6:31       ` Michael Lawnick
     [not found]         ` <4C11D85F.7010604-Mmb7MZpHnFY@public.gmane.org>
2010-06-11  9:40           ` Jean Delvare [this message]
     [not found]             ` <20100611114003.01c15f62-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-06-15  8:53               ` Michael Lawnick
2010-06-15  8:52       ` Michael Lawnick
     [not found]         ` <4C173F61.8000007-Mmb7MZpHnFY@public.gmane.org>
2010-06-15  9:00           ` Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2010-05-04 12:29 Michael Lawnick
     [not found] ` <4BE01321.3060704-Mmb7MZpHnFY@public.gmane.org>
2010-05-04 12:33   ` Rodolfo Giometti
2010-05-04 12:37   ` Michael Lawnick
     [not found]     ` <4BE014ED.9070907-Mmb7MZpHnFY@public.gmane.org>
2010-05-04 15:19       ` Yegor Yefremov

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=20100611114003.01c15f62@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=giometti-AVVDYK/kqiJWk0Htik3J/w@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ml.lawnick-Mmb7MZpHnFY@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.