Re: Right amount of info in the DT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 26, 2017 at 5:47 PM, Yves Lefloch
<YvesMarie_Lefloch@xxxxxxxxxxxxxxxx> wrote:

> I've put together a first draft, would you mind taking a look at it?
> I haven't documented the DT binding yet, though.

OK

> +       pins {
> +               compatible = "simple-bus";
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               ranges;
> +
> +               pinctrl@10500 {
> +                       reg = <0x10500 0x8>;
> +                       compatible = "sigma,smp8758-pinctrl";
> +                       label = "sys";
> +                       tango,pins = <0 16>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +
> +                       gpio {
> +                               gpio-controller;
> +                               #gpio-cells = <1>;
> +                       };
> +               };
> +
> +               pinctrl@15b8e0 {
> +                       compatible = "sigma,smp8758-pinctrl";
> +                       label = "tdmux";
> +                       reg = <0x15b8e0 0xc>;
> +                       tango,pins = <16 2>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +
> +                       gpio {
> +                               gpio-controller;
> +                               #gpio-cells = <1>;
> +                       };
> +
> +                       alt_function {
> +                               function = "tdmux";
> +                               groups = "tdmux";
> +                       };
> +               };
> +
> +               pinctrl@6c130 {
> +                       compatible = "sigma,smp8758-pinctrl";
> +                       label = "spi";
> +                       reg = <0x6c130 0xc>;
> +                       tango,pins = <18 8>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +
> +                       gpio {
> +                               gpio-controller;
> +                               #gpio-cells = <1>;
> +                       };
> +
> +                       alt_function {
> +                               function = "spi";
> +                               groups = "spi";
> +                       };
> +               };
> +
> +               pinctrl@6c230 {
> +                       compatible = "sigma,smp8758-pinctrl";
> +                       label = "uart1";
> +                       reg = <0x6c230 0xc>;
> +                       tango,pins = <26 7>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +
> +                       gpio {
> +                               gpio-controller;
> +                               #gpio-cells = <1>;
> +                       };
> +
> +                       alt_function {
> +                               function = "uart1";
> +                               groups = "uart1";
> +                       };
> +
> +               };
> +
> +               pinctrl@6c358 {
> +                       compatible = "sigma,smp8758-pinctrl";
> +                       label = "smcard";
> +                       reg = <0x6c368 0xc>;
> +                       tango,pins = <71 8>;
> +                       #address-cells = <1>;
> +                       #size-cells = <1>;
> +
> +                       gpio {
> +                               gpio-controller;
> +                               #gpio-cells = <1>;
> +                       };
> +
> +                       alt_function {
> +                               function = "smcard";
> +                               groups = "smcard";
> +                       };
> +               };
> +       };


Does all of these really have gpio controller functionality?
You do not have to compulsively add that. Just make it
a pin controller.

But I was not meaning you should collect them all under a
"pins" node like this, but inside each peripheral.

So for example:

mmc@80114000 {
        compatible = "mmc-sd-card";
        reg = <0x80114000 0x1000>;
        interrupts = <....>;

        pinctrl {
                compatible = "sigma,smp8758-pinctrl";
                label = "smcard";
                (....)
        };
};

So it lives inside the node of the peripheral. It can then
access the register range by simply looking at the parent,
and maybe when making the Linux driver, the parent simply
calls a library function to set up the pin controller for itself
providing the child node as reference. (Child nodes are not
automatically spawning devices, you have to do that with code.)

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux