Linus Walleij wrote,
> I think what Mark is saying is that you should not define a new node
> for exports, but instead use the node for the gpiochip and extend
> those existing gpiochip bindings, if you want to do this.
>
What might this look like? Should each exported pin have a node under
the gpio-controller? If we want to allow for pins to be exported to
userspace, a name alone is not sufficient; we also need to provide the
allowed directions. I think this precludes the use of a plain /aliases
node.

Perhaps something like this (please excuse my ignorance of devicetree
norms)?

        gpio1: gpio-controller@1400 {
                #gpio-cells = <2>;
                compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
                reg = <0x1400 0x18>;
                gpio-controller;

                pin_a: gpio {
                          gpio-name = "pin-a";
                          gpio = <&gpio1 2 0>;
                          output;
                          init-high;
                };
        };

One issue with this is the redundancy of specifying both the
gpio-controller in the `gpio` attribute and by virtue of it being a
child of the controller. Other suggestions?

Cheers,

- Ben

Attachment: pgpONCBRnJrzK.pgp
Description: PGP signature

Reply via email to