All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: heiko@sntech.de, linux-rockchip@lists.infradead.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/2] gpio: rockchip: get pinctrl node from 'gpio-ranges' property
Date: Tue, 15 Mar 2022 02:15:32 +0100	[thread overview]
Message-ID: <CACRpkdb1366vp6nK3K20kenLkwiy_1ebT8Wt+S93vdQ_Gjd_-g@mail.gmail.com> (raw)
In-Reply-To: <20220303062211.1378883-3-jay.xu@rock-chips.com>

On Thu, Mar 3, 2022 at 7:22 AM Jianqun Xu <jay.xu@rock-chips.com> 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@rock-chips.com>
(...)
> -       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

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: heiko@sntech.de, linux-rockchip@lists.infradead.org,
	 linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/2] gpio: rockchip: get pinctrl node from 'gpio-ranges' property
Date: Tue, 15 Mar 2022 02:15:32 +0100	[thread overview]
Message-ID: <CACRpkdb1366vp6nK3K20kenLkwiy_1ebT8Wt+S93vdQ_Gjd_-g@mail.gmail.com> (raw)
In-Reply-To: <20220303062211.1378883-3-jay.xu@rock-chips.com>

On Thu, Mar 3, 2022 at 7:22 AM Jianqun Xu <jay.xu@rock-chips.com> 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@rock-chips.com>
(...)
> -       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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  parent reply	other threads:[~2022-03-15  1:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03  6:22 [PATCH 0/2] gpio-rochchip Jianqun Xu
2022-03-03  6:22 ` Jianqun Xu
2022-03-03  6:22 ` [PATCH 1/2] gpio: rockchip: make gpio work without cru module Jianqun Xu
2022-03-03  6:22   ` Jianqun Xu
2022-03-03 11:28   ` Heiko Stübner
2022-03-03 11:28     ` Heiko Stübner
2022-03-04  3:00     ` jay.xu
2022-03-03  6:22 ` [PATCH 2/2] gpio: rockchip: get pinctrl node from 'gpio-ranges' property Jianqun Xu
2022-03-03  6:22   ` Jianqun Xu
2022-03-03 11:40   ` Heiko Stübner
2022-03-03 11:40     ` Heiko Stübner
2022-03-04  3:02     ` jay.xu
2022-03-07  8:08     ` jay.xu
2022-03-15  1:15   ` Linus Walleij [this message]
2022-03-15  1:15     ` 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=CACRpkdb1366vp6nK3K20kenLkwiy_1ebT8Wt+S93vdQ_Gjd_-g@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=heiko@sntech.de \
    --cc=jay.xu@rock-chips.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.