Thread (138 messages) 138 messages, 6 authors, 2013-10-25

Re: [PATCH 2/2] Make non-linear GPIO ranges accesible from gpiolib

From: Christian Ruppert <hidden>
Date: 2013-06-17 16:04:01
Also in: lkml

On Thu, Jun 13, 2013 at 03:38:09PM -0600, Stephen Warren wrote:
On 06/13/2013 06:55 AM, Christian Ruppert wrote:
[...]
quoted
diff --git a/Documentation/devicetree/bindings/gpio/gpio.txt b/Documentation/devicetree/bindings/gpio/gpio.txt
quoted
+In addition, named groups of pins can be mapped to pin groups of a given
+pin controller:
+
+	gpio_pio_g: gpio-controller@1480 {
+		#gpio-cells = <2>;
+		compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
+		reg = <0x1480 0x18>;
+		gpio-controller;
+		gpio-pingrps = <&pinctrl1 0>, <&pinctrl2 3>;
+		gpio-pingrp-names = "pctl1_gpio_g", "pctl2_gpio_g";
A few thoughts here:

"gpio-pingrps" doesn't sound very similar to the existing "gpio-ranges".
Can we make their equivalent purpose more obvious by renaming this
"gpio-group-ranges"?

I'm not actually even sure we need a new property for this, except for
the string group names. We could fold the new gpio-pingrps into the
existing gpio-ranges, whose entries have the format:

<gpio-base> <pinctrl-base> <count>

... by saying that if count==0, it means to use a group name instead of
a pinctrl-base value. We can insist that pinctrl-base==0 in this case
too. If we go made, count==0 could mean "special" and pinctrl-base==0
could mean "by pinctrl group name", and other values of pinctrl-base
could be added later to mean other things!

gpio-ranges =
	<&pinctrl1 0 20 10>, /* Existing numeric style */
	<&pinctrl2 10 0 0>,  /* Count==0, so group name style */
	<&pinctrl1 0 20 10>, /* Existing numeric style */
gpio-ranges-group-names =
	"",    /* No group name required for entry 0 */
	"gr1", /* Group name for entry 1 */
	"";    /* No group name required for entry 2 */

Does this seem better?
[...]
In the follow-up a patch set based on this proposal. I have also
included our drivers (and device tree updates) with this to see how this
looks in a real (working) system. To me it does actually look quite nice
and logical but take a look at it yourselves and tell me what you think.

Greetings,
  Christian

-- 
  Christian Ruppert              ,          [off-list ref]
                                /|
  Tel: +41/(0)22 816 19-42     //|                 3, Chemin du Pré-Fleuri
                             _// | bilis Systems   CH-1228 Plan-les-Ouates
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help