public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: swarren@wwwdotorg•org (Stephen Warren)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Date: Wed, 06 Nov 2013 10:00:22 -0700	[thread overview]
Message-ID: <527A75A6.5010904@wwwdotorg.org> (raw)
In-Reply-To: <5279A319.5060701@broadcom.com>

On 11/05/2013 07:02 PM, Sherman Yin wrote:
> On 13-11-04 04:04 PM, Stephen Warren wrote:
>> On 11/04/2013 04:26 PM, Heiko St?bner wrote:
>>
>>> I remember we had a discussion about how things like bias-disable
>>> explicitly
>>> shouldn't have a value, when they are represented in the list-format:
>>>
>>>         pcfg_pull_none: pcfg_pull_none {
>>>             bias-disable;
>>>         };
>>>
>>> so a bias-disable = <1> was explicitly "forbidden" [for a lack of a
>>> better
>>> word]. And it was similar for other options, the parameter not meant
>>> to be
>>> indicating if they are active but really only setting the "strength"
>>> or so.
>>
>> Pure Boolean values should be represented as a valueless property. If
>> the property is present, the value is true, otherwise false.
>>
>> However, pinctrl bindings often don't represent Boolean values, but
>> rather tri-states, with the following values:
>>
>> * Don't touch this configuration option at all (missing)
>> * Enable the option (<1>)
>> * Disable the option (<0>)
>>
>> The reason for using tri-states being that you might want to write:
>>
>> xxx1 {
>>      pins = <PINA>, <PINB>, <PINC>;
>>      function = <...>;
>>      // this node doesn't affect pullup
>> }
>> xxx2 {
>>      pins = <PINA>, <PINB>;
>>      // this node doesn't affect function
>>      pull-up = <1>; // change, and enable
>> }
>> xxx3 {
>>      pins = <PINAC>;
>>      // this node doesn't affect function
>>      pull-up = <0>; // change, and disable
>> }
> 
> If I understand correctly, in Stephen's example, if a certain driver
> wants to configure PINA PINB and PINC, the pin configuration nodes
> "xxx1", "xxx2", and "xxx3" will all have to be selected for the
> particular pin state.

You probably don't want to reference the individual xxx1/2/3 nodes in
the client pinctrl properties, but instead wrap them in a higher-level
node that represents the whole pinctrl state. Then, the client pinctrl
properties can reference just that single parent node, instead of many
small nodes. In other words:

pinctrl at ... {
	...
	sx: state_xxx {
		xxx1 { ... };
		xxx2 { ... };
		xxx3 { ... };
	};
	sy: state_yyy {
		yyy1 { ... };
		yyy2 { ... };
	};
}

some_client at ... {
	...
	pinctrl-names = "default";
	pinctrl-0 = <&sx>;
};

other_client at ... {
	...
	pinctrl-names = "default";
	pinctrl-0 = <&sy>;
};

rather than:

pinctrl at ... {
	...
	sx1: xxx1 { ... };
	sx2: xxx2 { ... };
	sx3: xxx3 { ... };
	sy1: yyy1 { ... };
	sy2: yyy2 { ... };
}

some_client at ... {
	...
	pinctrl-names = "default";
	pinctrl-0 = <&sx1 &sx2 &sx3>;
};

other_client at ... {
	...
	pinctrl-names = "default";
	pinctrl-0 = <&sy1 &sy2>;
};

This is exactly how the Tegra pinctrl bindings work for example.


> This works fine.  However, I'm just thinking that
> it would have been easier if we could specify just one node:
> 
> xxx {
>     pins = <PINA>, <PINB>, <PINC>;
>     function = <...>;
>     pull-up = <1 1 0>;
> }
> 
> This "feature" seems a bit more concise to me and is what I did for my
> original pinctrl driver.  The only downside is that with this method,
> one cannot specify "don't touch this option for this pin" if the same
> property must provide values for other pins.

The other downside is that if the lists get even slightly long, it get
really hard to match up the entries in the t properties.

  parent reply	other threads:[~2013-11-06 17:00 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04  0:23 [PATCH 0/4] Add Broadcom Capri pinctrl driver Sherman Yin
2013-10-04  0:23 ` [PATCH 1/4] pinctrl: Add void * to pinctrl_pin_desc Sherman Yin
2013-10-09  8:55   ` Linus Walleij
2013-10-09 22:57     ` Sherman Yin
2013-10-04  0:23 ` [PATCH 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs Sherman Yin
2013-10-04 12:51   ` Matt Porter
2013-10-09  8:53   ` Linus Walleij
2013-10-10 17:57     ` Sherman Yin
2013-10-04  0:23 ` [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver Sherman Yin
2013-10-09  9:10   ` Linus Walleij
2013-10-10 23:48     ` Sherman Yin
2013-10-11  8:14       ` Linus Walleij
2013-10-11 18:25         ` Sherman Yin
2013-10-22 23:29           ` Sherman Yin
2013-10-25 22:48             ` Sherman Yin
2013-11-04 12:24               ` Linus Walleij
2013-11-04 23:26                 ` Heiko Stübner
2013-11-05  0:04                   ` Stephen Warren
2013-11-06  2:02                     ` Sherman Yin
2013-11-06  9:40                       ` Linus Walleij
2013-11-08  0:29                         ` Sherman Yin
2013-11-11 10:01                           ` Linus Walleij
2013-11-13 23:43                             ` Sherman Yin
2013-11-19 20:39                               ` Linus Walleij
2013-11-06 17:00                       ` Stephen Warren [this message]
2013-11-07 22:01                         ` Sherman Yin
2013-11-06  9:29                     ` Linus Walleij
2013-10-17  6:03   ` Christian Daudt
2013-10-17 14:54     ` Stephen Warren
2013-10-17 15:31       ` Christian Daudt
2013-12-11  0:05         ` Sherman Yin
2013-12-12 20:43           ` Linus Walleij
2013-10-04  0:23 ` [PATCH 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs Sherman Yin
2013-10-09  9:11   ` Linus Walleij
2013-10-07 19:28 ` [PATCH v2 0/4] Add Broadcom Capri pinctrl driver Sherman Yin
2013-10-07 19:28   ` [PATCH v2 1/4] pinctrl: Add void * to pinctrl_pin_desc Sherman Yin
2013-10-07 19:28   ` [PATCH v2 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs Sherman Yin
2013-10-07 19:28   ` [PATCH v2 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver Sherman Yin
2013-10-07 19:28   ` [PATCH v2 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs Sherman Yin
2013-12-11 18:37   ` [PATCH v3 0/6] Add Broadcom Capri pinctrl driver Sherman Yin
2013-12-11 18:37     ` [PATCH v3 1/6] pinctrl: Add void * to pinctrl_pin_desc Sherman Yin
2013-12-11 18:37     ` [PATCH v3 2/6] pinctrl: Adds slew-rate, input-enable/disable Sherman Yin
2013-12-12 20:41       ` Linus Walleij
2013-12-16  9:55       ` Linus Walleij
2013-12-11 18:37     ` [PATCH v3 3/6] pinctrl: Make PINCTRL selectable by defconfig/menuconfig Sherman Yin
2013-12-12 20:39       ` Linus Walleij
2013-12-12 21:35         ` Christian Daudt
2013-12-16 10:01           ` Linus Walleij
2013-12-17  0:18             ` Bjorn Andersson
2013-12-20  9:37               ` Linus Walleij
2013-12-20 20:58                 ` Arnd Bergmann
2013-12-21  2:15                   ` Sherman Yin
2013-12-11 18:37     ` [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs Sherman Yin
2013-12-12 20:37       ` Linus Walleij
2013-12-14  1:16         ` Sherman Yin
2013-12-16 13:17           ` Linus Walleij
2013-12-18  2:02             ` Sherman Yin
2013-12-11 18:37     ` [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver Sherman Yin
2013-12-12 20:54       ` Linus Walleij
2013-12-13 10:22         ` Mark Brown
2013-12-19  0:12           ` Sherman Yin
2013-12-18 23:56         ` Sherman Yin
2013-12-21  2:31           ` Sherman Yin
2013-12-11 18:37     ` [PATCH v3 6/6] pinctrl: Enable pinctrl for Broadcom Capri SoCs Sherman Yin
2013-12-21  2:13     ` [PATCH v4 0/6] Add Broadcom Capri pinctrl driver Sherman Yin
2013-12-21  2:13       ` [PATCH v4 1/4] pinctrl: Add void * to pinctrl_pin_desc Sherman Yin
2014-01-16 13:26         ` Linus Walleij
2013-12-21  2:13       ` [PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs Sherman Yin
2014-01-07 17:15         ` Linus Walleij
2014-01-07 20:45           ` Sherman Yin
2014-01-14 10:16             ` Linus Walleij
2014-01-14 19:00               ` Sherman Yin
2014-01-15  9:40                 ` Linus Walleij
2014-01-15 16:39                   ` Mark Rutland
2014-01-16 13:24         ` Linus Walleij
2013-12-21  2:13       ` [PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver Sherman Yin
2014-01-16 13:19         ` Linus Walleij
2014-01-17 19:59           ` Sherman Yin
2014-01-18  2:56             ` Matt Porter
2014-01-20  8:16               ` Linus Walleij
2014-01-20 19:14                 ` Sherman Yin
2014-01-21 12:35                   ` Linus Walleij
2014-01-21 13:49                 ` Matt Porter
2013-12-21  2:13       ` [PATCH v4 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs Sherman Yin
2014-01-16 13:28         ` Linus Walleij

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=527A75A6.5010904@wwwdotorg.org \
    --to=swarren@wwwdotorg$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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