From: Sebastian Hesselbarth <sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
Gregory Clement
<gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Gabriel Dobato <dobatog-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/4] i2c: mux-pinctrl: Rework to honor disabled child nodes
Date: Wed, 04 Mar 2015 10:10:50 +0100 [thread overview]
Message-ID: <54F6CC1A.3030102@gmail.com> (raw)
In-Reply-To: <54F4C185.9080808-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On 02.03.2015 21:01, Stephen Warren wrote:
> On 02/27/2015 05:24 AM, Sebastian Hesselbarth wrote:
>> I2C mux pinctrl driver currently determines the number of sub-busses by
>> counting available pinctrl-names. Unfortunately, this requires each
>> incarnation of the devicetree node with different available sub-busses
>> to be rewritten.
>>
>> This patch reworks i2c-mux-pinctrl driver to count the number of
>> available sub-nodes instead. The rework should be compatible to the old
>> way of probing for sub-busses and additionally allows to disable unused
>> sub-busses with standard DT property status = "disabled".
>>
>> This also amends the corresponding devicetree binding documentation to
>> reflect the new functionality to disable unused sub-nodes. While at it,
>> also fix two references to binding documentation files that miss an
>> "i2c-"
>> prefix.
>
>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
>> b/Documentation/devicetree/bindings/i2c/i2c-mux-pinctrl.txt
>
>> -For each named state defined in the pinctrl-names property, an I2C
>> child bus
>> -will be created. I2C child bus numbers are assigned based on the
>> index into
>> -the pinctrl-names property.
>> +For each enabled child node an I2C child bus will be created. I2C
>> child bus
>> +numbers are assigned based on the order of child nodes.
>
> I think that I2C bus numbers are an internal concept for the OS. As
> such, we should probably remove any mention re: the bus numbers from the
> binding.
Stephen,
yeah as you can see I am struggling to find a good documentation. I
agree that we should get rid of the bus number thing above.
>> -The only exception is that no bus will be created for a state named
>> "idle". If
>> -such a state is defined, it must be the last entry in pinctrl-names. For
>> -example:
>> +There must be a corresponding pinctrl-names entry for each enabled child
>> +node at the position of the child node's "reg" property. Also, there
>> can be
>> +an idle pinctrl state defined at the end of possible pinctrl states.
>> If such
>> +a state is defined, it must be the last entry in pinctrl-names. For
>> example:
>
> What about gaps in the numbering sequence? IIRC, in a situation with 5
> nodes with reg 0, 1, 2, 3, 4 but where only the nodes with reg of 1, 3
> enabled, we only want 2 entries in pinctrl-names? If so, "at the
> position of the child node's "reg" property" isn't correct, since "at
> the position" implies there must be gaps in pinctrl-names. "In the same
> order as the reg property values for enabled subnodes" might be a better
> description.
Good point. The idea was to _have_ gaps in pinctrl-names to allow to
configure the current mux layout by status properties only. The existing
implementation (and docu) suggested you have to amend pinctrl-names to
achieve a specific setup.
> Perhaps I'm misremembering and you explicitly didn't want to remove
> entries from pinctrl-names if child nodes were disabled? If so, then
> surely then in the text above, "for each enabled child" should be
> replaced with "for each child"?
True.
>> @@ -68,6 +68,7 @@ Example:
>> pinctrl-1 = <&state_i2cmux_pta>;
>> pinctrl-2 = <&state_i2cmux_idle>;
>>
>> + /* Enabled child bus 0 */
>> i2c@0 {
>> reg = <0>;
>> #address-cells = <1>;
>> @@ -79,10 +80,12 @@ Example:
>> };
>> };
>>
>> + /* Disabled child bus 1 */
>> i2c@1 {
>> reg = <1>;
>> #address-cells = <1>;
>> #size-cells = <0>;
>> + status = "disabled";
>
> To make the example cover more cases, perhaps make child node i2c@0
> disabled and i2c@1 enabled. Then, the example would show what happens to
> pinctrl-names when there are gaps in the reg property numbering space of
> enabled children?
The idea was to make nothing happen to pinctrl-names if you enable/
disable any of the children. But I can move the disabled status to
i2c@0 to make it more clear that there should still be a pinctrl-names
cell for it.
Sebastian
next prev parent reply other threads:[~2015-03-04 9:10 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 18:52 [PATCH 0/8] Add proper support for Compulab CM-A510/SBC-A510 Sebastian Hesselbarth
2015-02-17 18:52 ` [PATCH 1/8] i2c: mux-pinctrl: Rework to honor disabled child nodes Sebastian Hesselbarth
[not found] ` <1424199129-22099-2-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-17 20:46 ` Stephen Warren
[not found] ` <54E3A8A7.8080703-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-02-17 21:08 ` Sebastian Hesselbarth
2015-02-17 21:15 ` Stephen Warren
2015-02-17 21:19 ` Sebastian Hesselbarth
2015-02-26 21:46 ` Stephen Warren
2015-02-17 18:52 ` [PATCH 2/8] devicetree: vendor-prefixes: Add CompuLab to known vendors Sebastian Hesselbarth
2015-02-17 19:37 ` Rob Herring
2015-02-17 18:52 ` [PATCH 7/8] ARM: dts: dove: Add internal i2c multiplexer node Sebastian Hesselbarth
[not found] ` <1424199129-22099-8-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-23 15:07 ` Gregory CLEMENT
[not found] ` <1424199129-22099-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-26 17:55 ` [PATCH 0/8] Add proper support for Compulab CM-A510/SBC-A510 Gregory CLEMENT
2015-02-26 19:39 ` Sebastian Hesselbarth
2015-02-26 20:01 ` Stephen Warren
2015-02-26 20:35 ` Sebastian Hesselbarth
2015-02-27 12:24 ` [PATCH v2 0/4] " Sebastian Hesselbarth
[not found] ` <1425039885-5137-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-02-27 12:24 ` [PATCH v2 1/4] i2c: mux-pinctrl: Rework to honor disabled child nodes Sebastian Hesselbarth
[not found] ` <1425039885-5137-2-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-02 20:01 ` Stephen Warren
[not found] ` <54F4C185.9080808-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-04 9:10 ` Sebastian Hesselbarth [this message]
2015-03-09 12:21 ` [PATCH v3 " Sebastian Hesselbarth
[not found] ` <1425903665-19343-1-git-send-email-sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-10 16:28 ` Stephen Warren
[not found] ` <54FF1BAA.3060409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-16 20:15 ` Sebastian Hesselbarth
2015-03-18 12:30 ` Wolfram Sang
2015-03-18 13:23 ` Sebastian Hesselbarth
2015-03-18 14:00 ` Wolfram Sang
2015-03-18 23:10 ` Sebastian Hesselbarth
[not found] ` <550A05E5.3050100-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-19 10:09 ` Wolfram Sang
2015-03-19 10:48 ` Wolfram Sang
2015-03-19 15:47 ` Stephen Warren
[not found] ` <550AEF9D.6090307-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2015-03-19 16:02 ` Wolfram Sang
2015-03-19 16:49 ` Stephen Warren
2015-03-19 20:52 ` Sebastian Hesselbarth
2015-03-20 10:19 ` Wolfram Sang
2015-03-21 21:00 ` Wolfram Sang
2015-03-22 13:03 ` Sebastian Hesselbarth
[not found] ` <550EBDBC.9000903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-23 18:32 ` Wolfram Sang
2015-03-27 21:08 ` Sebastian Hesselbarth
[not found] ` <5515C6B6.7080903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-03 18:17 ` Wolfram Sang
2015-02-27 12:24 ` [PATCH v2 2/4] devicetree: vendor-prefixes: Add CompuLab to known vendors Sebastian Hesselbarth
2015-02-27 12:24 ` [PATCH v2 3/4] ARM: dts: dove: Add internal i2c multiplexer node Sebastian Hesselbarth
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=54F6CC1A.3030102@gmail.com \
--to=sebastian.hesselbarth-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dobatog-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@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).