From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
sudeep.holla@arm.com, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, Oleksii_Moisieiev@epam.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [RFC v2 5/5] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
Date: Tue, 10 Oct 2023 14:14:37 +0900 [thread overview]
Message-ID: <ZSTdvROVzJU5FRAZ@octopus> (raw)
In-Reply-To: <ZSQXXW1NRiCpsENu@e120937-lin>
On Mon, Oct 09, 2023 at 04:08:13PM +0100, Cristian Marussi wrote:
> On Mon, Oct 09, 2023 at 03:13:24PM +0200, Linus Walleij wrote:
> > On Mon, Oct 9, 2023 at 11:08???AM Cristian Marussi
> > <cristian.marussi@arm.com> wrote:
> >
> > > > > + gpio0: gpio@0 {
> > > > > + compatible = "pin-control-gpio";
> > > > > + gpio-controller;
> > > > > + #gpio-cells = <2>;
> > > > > + gpio-ranges = <&scmi_pinctrl 0 10 5>,
> > > > > + <&scmi_pinctrl 5 0 0>;
> > > > > + gpio-ranges-group-names = "",
> > > > > + "pinmux_gpio";
> > > > > + };
> > > >
> > >
> > > Assuming the above &scmi_pinctrl refers to the protocol node as we
> > > usually do,
> >
> > No it does not, it is a three-layer cake.
> >
> > scmi <-> scmi_pinctrl <-> scmi_gpio
> >
> > it refers to the scmi_pinctrl node.
> >
>
> Thanks, this explains a lot.
> Cristian
Just in case,
gpio-ranges = <&scmi_pinctrl 0 10 5>;
means that SCMI *pin* range [10..(10+5-1)] are mapped to this driver's
gpio range [0..(5-1)]. So any consumer driver can access a gpio pin
as:
foo-gpios = <&gpio0 3>;
will refer to gpio pin#3 that is actually SCMI's 13.
gpio-ranges = <&scmi_pinctrl 5 0 0>;
gpio-ranges-group-names = "pinmux_gpio";
means that SCMI *group*, "pinmux_gpio", are mapped to this driver's
gpio range which starts with 5. If "pinmux_gpio" indicates SCMI *pin*
range [20..24],
baa-gpios = <&gpio0 7>;
will refer to gpio pin#7 that is actually SCMI's 22 (=20 + (7-5)).
This way, we (consumer drivers) don't care what is the underlying pin
controller.
-Takahiro Akashi
>
> > There is no SCMI GPIO protocol, instead SCMI is using the
> > operations already available in the pin controller to exercise
> > GPIO. Generic pin control has operations to drive lines for
> > example, and Takahiro is adding the ability for a generic pin
> > controller to also read a line.
>
>
> >
> > Yours,
> > Linus Walleij
WARNING: multiple messages have this Message-ID (diff)
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>,
sudeep.holla@arm.com, krzysztof.kozlowski+dt@linaro.org,
conor+dt@kernel.org, Oleksii_Moisieiev@epam.com,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [RFC v2 5/5] dt-bindings: gpio: Add bindings for pinctrl based generic gpio driver
Date: Tue, 10 Oct 2023 14:14:37 +0900 [thread overview]
Message-ID: <ZSTdvROVzJU5FRAZ@octopus> (raw)
In-Reply-To: <ZSQXXW1NRiCpsENu@e120937-lin>
On Mon, Oct 09, 2023 at 04:08:13PM +0100, Cristian Marussi wrote:
> On Mon, Oct 09, 2023 at 03:13:24PM +0200, Linus Walleij wrote:
> > On Mon, Oct 9, 2023 at 11:08???AM Cristian Marussi
> > <cristian.marussi@arm.com> wrote:
> >
> > > > > + gpio0: gpio@0 {
> > > > > + compatible = "pin-control-gpio";
> > > > > + gpio-controller;
> > > > > + #gpio-cells = <2>;
> > > > > + gpio-ranges = <&scmi_pinctrl 0 10 5>,
> > > > > + <&scmi_pinctrl 5 0 0>;
> > > > > + gpio-ranges-group-names = "",
> > > > > + "pinmux_gpio";
> > > > > + };
> > > >
> > >
> > > Assuming the above &scmi_pinctrl refers to the protocol node as we
> > > usually do,
> >
> > No it does not, it is a three-layer cake.
> >
> > scmi <-> scmi_pinctrl <-> scmi_gpio
> >
> > it refers to the scmi_pinctrl node.
> >
>
> Thanks, this explains a lot.
> Cristian
Just in case,
gpio-ranges = <&scmi_pinctrl 0 10 5>;
means that SCMI *pin* range [10..(10+5-1)] are mapped to this driver's
gpio range [0..(5-1)]. So any consumer driver can access a gpio pin
as:
foo-gpios = <&gpio0 3>;
will refer to gpio pin#3 that is actually SCMI's 13.
gpio-ranges = <&scmi_pinctrl 5 0 0>;
gpio-ranges-group-names = "pinmux_gpio";
means that SCMI *group*, "pinmux_gpio", are mapped to this driver's
gpio range which starts with 5. If "pinmux_gpio" indicates SCMI *pin*
range [20..24],
baa-gpios = <&gpio0 7>;
will refer to gpio pin#7 that is actually SCMI's 22 (=20 + (7-5)).
This way, we (consumer drivers) don't care what is the underlying pin
controller.
-Takahiro Akashi
>
> > There is no SCMI GPIO protocol, instead SCMI is using the
> > operations already available in the pin controller to exercise
> > GPIO. Generic pin control has operations to drive lines for
> > example, and Takahiro is adding the ability for a generic pin
> > controller to also read a line.
>
>
> >
> > Yours,
> > Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-10 5:14 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 2:58 [RFC v2 0/5] gpio: add pinctrl based generic gpio driver AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-05 2:58 ` [RFC v2 1/5] pinctrl: define PIN_CONFIG_INPUT AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-10 11:53 ` Linus Walleij
2023-10-10 11:53 ` Linus Walleij
2023-10-05 2:58 ` [RFC v2 2/5] pinctrl: always export pin_config_get_for_pin() AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-10 11:54 ` Linus Walleij
2023-10-10 11:54 ` Linus Walleij
2023-10-05 2:58 ` [RFC v2 3/5] pinctrl: add pinctrl_gpio_get_config() AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-05 2:58 ` [RFC v2 4/5] gpio: add pinctrl based generic gpio driver AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-10 12:00 ` Linus Walleij
2023-10-10 12:00 ` Linus Walleij
2023-10-12 1:08 ` AKASHI Takahiro
2023-10-12 1:08 ` AKASHI Takahiro
2023-10-05 2:58 ` [RFC v2 5/5] dt-bindings: gpio: Add bindings for " AKASHI Takahiro
2023-10-05 2:58 ` AKASHI Takahiro
2023-10-05 19:48 ` Krzysztof Kozlowski
2023-10-05 19:48 ` Krzysztof Kozlowski
2023-10-12 1:15 ` AKASHI Takahiro
2023-10-12 1:15 ` AKASHI Takahiro
2023-10-12 7:27 ` Krzysztof Kozlowski
2023-10-12 7:27 ` Krzysztof Kozlowski
2023-10-06 13:18 ` Rob Herring
2023-10-06 13:18 ` Rob Herring
2023-10-06 13:23 ` Rob Herring
2023-10-06 13:23 ` Rob Herring
2023-10-09 7:49 ` Linus Walleij
2023-10-09 7:49 ` Linus Walleij
2023-10-09 9:08 ` Cristian Marussi
2023-10-09 9:08 ` Cristian Marussi
2023-10-09 13:13 ` Linus Walleij
2023-10-09 13:13 ` Linus Walleij
2023-10-09 15:08 ` Cristian Marussi
2023-10-09 15:08 ` Cristian Marussi
2023-10-10 5:14 ` AKASHI Takahiro [this message]
2023-10-10 5:14 ` AKASHI Takahiro
2023-10-10 5:25 ` AKASHI Takahiro
2023-10-10 5:25 ` AKASHI Takahiro
2023-10-12 7:25 ` Linus Walleij
2023-10-12 7:25 ` Linus Walleij
2023-10-17 2:32 ` AKASHI Takahiro
2023-10-17 2:32 ` AKASHI Takahiro
2023-10-23 8:12 ` Linus Walleij
2023-10-23 8:12 ` Linus Walleij
2023-10-24 7:12 ` AKASHI Takahiro
2023-10-24 7:12 ` AKASHI Takahiro
2023-10-24 9:40 ` Linus Walleij
2023-10-24 9:40 ` Linus Walleij
2023-10-24 10:55 ` Cristian Marussi
2023-10-24 10:55 ` Cristian Marussi
2023-10-24 13:01 ` Linus Walleij
2023-10-24 13:01 ` Linus Walleij
2023-10-24 11:09 ` AKASHI Takahiro
2023-10-24 11:09 ` AKASHI Takahiro
2023-10-24 13:12 ` Linus Walleij
2023-10-24 13:12 ` Linus Walleij
2023-10-24 13:42 ` AKASHI Takahiro
2023-10-24 13:42 ` AKASHI Takahiro
2023-11-05 22:15 ` Linus Walleij
2023-11-05 22:15 ` Linus Walleij
2023-10-19 21:27 ` [RFC v2 0/5] gpio: add " andy.shevchenko
2023-10-19 21:27 ` andy.shevchenko
2023-10-20 0:21 ` AKASHI Takahiro
2023-10-20 0:21 ` AKASHI Takahiro
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=ZSTdvROVzJU5FRAZ@octopus \
--to=takahiro.akashi@linaro.org \
--cc=Oleksii_Moisieiev@epam.com \
--cc=conor+dt@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sudeep.holla@arm.com \
/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.