All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Rob Herring <robh@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	Mark Rutland <mark.rutland@arm.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: [PATCH v8 07/12] dt-bindings: i2c: i2c-mux-simple: document i2c-mux-simple bindings
Date: Fri, 3 Feb 2017 09:25:53 +0100	[thread overview]
Message-ID: <5dc05e28-45c7-1dfe-3cd2-53e55490b48a@axentia.se> (raw)
In-Reply-To: <CAL_JsqLCdM5s8FYqys-m5wpr4QeeE-rQaRXCt+rjQz3qm+E2qA@mail.gmail.com>

On 2017-02-02 17:08, Rob Herring wrote:
> On Tue, Jan 31, 2017 at 1:36 AM, Peter Rosin <peda@axentia.se> wrote:
>> If you see this new driver as something that is superseding the existing
>> i2c-mux-gpio driver, I'm sad to inform you that the code is not simply
>> not there. i2c-mux-gpio has acpi support and users may provide platform
>> data from code. The existing i2c-mux-gpio driver also has the below
>> mentioned locking heuristic. Adding all those things to the new driver
>> would make it big and unwieldy and having even more unwanted tentacles
>> into other subsystems. And why should it be only i2c-mux-gpio that is
>> merged into this new i2c-mux driver? Why not implement a mux-pinctrl
>> driver for the new mux subsustem and then merge i2c-mux-pinctrl as well?
>> I say no, that way lies madness.
> 
> Sounds like a good idea to me. I'm not saying you need to merge any of
> them right now though (that's Wolfram's call).

If we're pedantic I probably have some stake in it too, being the i2c-mux
maintainer and all. But, agreed, I arrived quite late to the Linux kernel
party and my opinion might perhaps not carry all that much weight...

> None of this has anything to do with the binding though. Compatible
> strings should be specific. That's not up for debate. Whether the

Ok, I'm going to focus on the compatible string for a minute and leave
the implementation details for some other discussion.

> driver bound to a compatible string is common or specific to that
> compatible string is completely up to the OS. That decision can change
> over time, but the binding should not.

So, there's the existing compatible "i2c-mux-gpio" ("i2c-gpio-mux" is
wrong) that you seem to suggest is what I should stick to. I object to
that.

As you say, the bindings and compatible strings should describe hardware,
and you also state they should be specific. I agree. But, why are you
then apparently suggesting (by implication) that for this (hypothetical)
hardware...

    .----.
    |SDA0|-----------.
    |SCL0|---------. |
    |    |         | |
    |    |      .-------.
    |    |      |adg792a|
    |    |      |       |
    |ADC0|------|D1  S1A|---- signal A
    |    |      |    S1B|---- signal B
    |    |      |    S1C|---- signal C
    |    |      |    S1D|---- signal D
    |    |      |       |
    |SDA1|---+--|D2  S2A|---- i2s segment foo A
    |SCL1|-. |  |    S2B|---- i2s segment foo B
    '----' | |  |    S2C|---- i2s segment foo C
           | |  |    S2D|---- i2s segment foo D
           | |  |       |
           | '--|D3  S3A|---- i2s segment bar A
           |    |    S3B|---- i2s segment bar B
           |    |    S3C|---- i2s segment bar C
           |    |    S3D|---- i2s segment bar D
           |    '-------'
           |                  A B C D   A B C D  (feed SCL1 to each of
           |                  | | | |   | | | |   the 8 muxed segments)
           '------------------+-+-+-+---+-+-+-'

...the devicetree should be like below?

&i2c0 {
	mux: mux-controller@50 {
		compatible = "adi,adg792a";
		reg = <0x50>;
		#mux-control-cells = <1>;
	};
};

adc-mux {
	compatible = "io-channel-mux";
	io-channels = <&adc 0>;
	io-channel-names = "parent";

	mux-controls = <&mux 0>;

	...
};

i2c-mux-foo {
	compatible = "i2c-mux-gpio";
	i2c-parent = <&i2c1>;

	mux-controls = <&mux 1>;

	...
};

i2c-mux-bar {
	compatible = "i2c-mux-gpio";
	i2c-parent = <&i2c1>;

	mux-controls = <&mux 2>;

	...
};

There must be some disconnect, because those "i2c-mux-gpio" compatible
strings are just dead wrong. There simply are no gpio pins involved at
all and that "gpio" suffix is just totally out of place.

So, since you are not happy with "i2c-mux-simple", "i2c-mux-generic" or
"i2c-mux" that I have suggested, can you please come up with something
that is good enough for the above?

Or, are you /really/ suggesting "i2c-mux-gpio"?

Cheers,
peda

  reply	other threads:[~2017-02-03  8:26 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18 15:57 [PATCH v8 00/12] mux controller abstraction and iio/i2c muxes Peter Rosin
2017-01-18 15:57 ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 01/12] devres: trivial whitespace fix Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 02/12] dt-bindings: document devicetree bindings for mux-controllers and mux-gpio Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-27 17:49   ` Rob Herring
2017-01-27 17:49     ` Rob Herring
2017-01-27 18:57     ` Peter Rosin
2017-01-27 18:57       ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 03/12] mux: minimal mux subsystem and gpio-based mux controller Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 04/12] iio: inkern: api for manipulating ext_info of iio channels Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 05/12] dt-bindings: iio: io-channel-mux: document io-channel-mux bindings Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-27 19:12   ` Rob Herring
2017-01-18 15:57 ` [PATCH v8 06/12] iio: multiplexer: new iio category and iio-mux driver Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 07/12] dt-bindings: i2c: i2c-mux-simple: document i2c-mux-simple bindings Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-27 19:39   ` Rob Herring
2017-01-28 22:42     ` Peter Rosin
2017-01-28 22:42       ` Peter Rosin
2017-01-30 17:20       ` Rob Herring
2017-01-30 17:20         ` Rob Herring
2017-01-31  7:36         ` Peter Rosin
2017-01-31  7:36           ` Peter Rosin
2017-02-02 16:08           ` Rob Herring
2017-02-03  8:25             ` Peter Rosin [this message]
2017-02-06 21:22               ` Rob Herring
2017-02-06 21:22                 ` Rob Herring
2017-01-18 15:57 ` [PATCH v8 08/12] i2c: i2c-mux-simple: new driver Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 09/12] dt-bindings: mux-adg792a: document devicetree bindings for ADG792A/G mux Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-27 19:50   ` Rob Herring
2017-01-27 22:09     ` Peter Rosin
2017-01-27 22:09       ` Peter Rosin
2017-01-28 10:34       ` Peter Meerwald-Stadler
2017-01-28 10:34         ` Peter Meerwald-Stadler
2017-01-28 11:40       ` Jonathan Cameron
2017-01-18 15:57 ` [PATCH v8 10/12] mux: adg792a: add mux controller driver for ADG792A/G Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 11/12] dt-bindings: simplified bindings for single-user gpio mux Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-18 15:57 ` [PATCH v8 12/12] mux: support " Peter Rosin
2017-01-18 15:57   ` Peter Rosin
2017-01-22 13:30   ` Jonathan Cameron
2017-01-22 13:30     ` Jonathan Cameron
2017-01-23 10:24     ` Peter Rosin
2017-01-27 15:52       ` Rob Herring
2017-01-30  8:02         ` Peter Rosin
2017-01-30  8:02           ` Peter Rosin

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=5dc05e28-45c7-1dfe-3cd2-53e55490b48a@axentia.se \
    --to=peda@axentia.se \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh@kernel.org \
    --cc=wsa@the-dreams.de \
    /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.