Re: [PATCH 2/2] gpio: rockchip: get pinctrl node from 'gpio-ranges' property

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

 



On Thu, Mar 3, 2022 at 7:22 AM Jianqun Xu <jay.xu@xxxxxxxxxxxxxx> wrote:

> The dt nodes for rockchip soc designes as
>
>         pinctrl: pinctrl {
>                 gpio {
>                         gpio-ranges = <&pinctrl xxx>;
>                 };
>         };
>
> Currently, we get the pinctrl dt node from parent of gpio, this patch
> try to get pinctrl dt node from 'gpio-ranges' property.
>
> After this patch, the dt nodes possible to be
>
>         gpio {
>                 gpio-ranges = <&pinctrl xxx>;
>         };
>
>         pinctrl: pinctrl {
>
>         };
>
> then the gpio driver could register as platform device itself, but not
> populate from pinctrl driver.
>
> Signed-off-by: Jianqun Xu <jay.xu@xxxxxxxxxxxxxx>
(...)
> -       if (!np || !pctlnp)
> -               return -ENODEV;
> +       pctlnp = of_parse_phandle(np, "gpio-ranges", 0);
> +       if (!pctlnp)
> +               pctlnp = of_get_parent(np);

GPIO ranges can be several and point to several different pin controllers.

I understand it does not in your case, so I guess it is fine if Heiko
is fine with it.

Yours,
Linus Walleij



[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