All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-sh@vger.kernel.org
Subject: Re: [RFC V2 4/4] i2c: mux: demux-pinctrl: add driver
Date: Thu, 19 Mar 2015 15:53:18 +0000	[thread overview]
Message-ID: <20150319155318.GE7657@katana> (raw)
In-Reply-To: <1426576524-22315-5-git-send-email-wsa@the-dreams.de>

[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]


> > + * Switching a master currently needs some access to either i2c-2 or i2c-3.
> > + * Switching could also be done via sysfs or any other config mechanism.
> > + * For this proof-of-concept, extra busses have been used since it
> > simplifies
> > + * locking a little.
> 
> I have mixed feelings to be honest. When using n internal masters muxed on the 
> same pins, with pin muxing used as a selector, I could agree that we are 
> dealing with n+1 busses, with n busses between the masters and the demux, and 
> one external bus. The two extra virtual busses in your example above bother 
> me.

That was chosen so the access to the "virtual" bus would automatically
do the pinctrl change. As I said somewhere, this could be handled
differently.

> This being said, I see this as an attempt to keep the traditional model of I2C 
> slaves being children of an I2C master while still departing from it at the 
> hardware level. Wouldn't it be better to depart from it from a software point 
> of view as well ? This would allow supporting real multi-master 
> configurations, but would come with a high refactoring cost in kernel code.

You mean the slaves belong to an i2c-bus and this bus can be connected
to masters? Yeah, that would be quite a change. And I am still not
convinced if that would solve the issue that the driver model does not
support re-parenting but rather suggests to delete and recreate the
device. From device_add():

 * Do not call this routine or device_register() more than once for
 * any device structure.  The driver model core is not designed to work
 * with devices that get unregistered and then spring back to life.
 * (Among other things, it's very hard to guarantee that all references
 * to the previous incarnation of @dev have been dropped.)  Allocate
 * and register a fresh new struct device instead.

> I'm also worried about power management, how do you envision its 
> implementation ?

Haven't thought about it so far. That is another reason not to break the
driver model, I guess.

Thanks for your input!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2015-03-19 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17  7:15 [RFC V2 4/4] i2c: mux: demux-pinctrl: add driver Wolfram Sang
2015-03-18 13:18 ` Laurent Pinchart
2015-03-19 15:53 ` Wolfram Sang [this message]
2015-04-21 17:55 ` Laurent Pinchart
2015-04-21 18:47 ` 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=20150319155318.GE7657@katana \
    --to=wsa@the-dreams.de \
    --cc=linux-sh@vger.kernel.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.