Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver
From: Shenwei Wang <shenwei.wang@nxp.com>
Date: 2026-02-25 15:18:57
Also in:
imx, linux-devicetree, linux-doc, linux-gpio, linux-remoteproc, lkml
-----Original Message----- From: Mathieu Poirier <mathieu.poirier@linaro.org> Sent: Tuesday, February 24, 2026 4:47 PM To: Shenwei Wang <shenwei.wang@nxp.com> Cc: Andrew Lunn <andrew@lunn.ch>; Arnaud POULIQUEN [off-list ref]; Linus Walleij [off-list ref]; Bartosz Golaszewski [off-list ref]; Jonathan Corbet [off-list ref]; Rob Herring [off-list ref]; Krzysztof Kozlowski [off-list ref]; Conor Dooley [off-list ref]; Bjorn Andersson [off-list ref]; Frank Li [off-list ref]; Sascha Hauer [off-list ref]; Shuah Khan [off-list ref]; linux-gpio@vger.kernel.org; linux- doc@vger.kernel.org; linux-kernel@vger.kernel.org; Pengutronix Kernel Team [off-list ref]; Fabio Estevam [off-list ref]; Peng Fan [off-list ref]; devicetree@vger.kernel.org; linux- remoteproc@vger.kernel.org; imx@lists.linux.dev; linux-arm- kernel@lists.infradead.org; dl-linux-imx [off-list ref]; Bartosz Golaszewski [off-list ref] Subject: [EXT] Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driverquoted
quoted
-----Original Message----- From: Andrew Lunn <andrew@lunn.ch> Sent: Tuesday, February 24, 2026 4:23 PM To: Shenwei Wang <shenwei.wang@nxp.com> Cc: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>; Linus Walleij [off-list ref]; Bartosz Golaszewski [off-list ref]; Jonathan Corbet [off-list ref]; Rob Herring [off-list ref]; Krzysztof Kozlowski [off-list ref]; Conor Dooley [off-list ref]; Bjorn Andersson [off-list ref]; Mathieu Poirier [off-list ref]; Frank Li [off-list ref]; Sascha Hauer [off-list ref]; Shuah Khan [off-list ref]; linux-gpio@vger.kernel.org; linux- doc@vger.kernel.org; linux-kernel@vger.kernel.org; Pengutronix Kernel Team [off-list ref]; Fabio Estevam [off-list ref]; Peng Fan [off-list ref]; devicetree@vger.kernel.org; linux- remoteproc@vger.kernel.org; imx@lists.linux.dev; linux-arm- kernel@lists.infradead.org; dl-linux-imx [off-list ref]; Bartosz Golaszewski [off-list ref] Subject: Re: [EXT] Re: [PATCH v8 3/4] gpio: rpmsg: add generic rpmsg GPIO driver Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the'Report this email'quoted
quoted
buttonquoted
quoted
quoted
+ remote_cm33{ + rpmsg { + rpmsg-io-channel { + #address-cells = <1>; + #size-cells = <0>; + + gpio@0 { + compatible = "rpmsg-gpio"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + #interrupt-cells = <2>; + interrupt-controller; + }; + gpio@1 { + compatible = "rpmsg-gpio"; + reg = <1>; + gpio-controller; + #gpio-cells = <2>; + #interrupt-cells = <2>; + interrupt-controller; + };quoted
Then how would you distinguish gpio@0 from gpio@1 on the CM33 RPMSG busin the example above?quoted
They are running on the same transport.Doesn't reg indicate the channel number? gpio@0 is on rpmsg channel 0. gpio@1 is on channel 1? The reg value gets filled into struct rpmsg_channel_info when the endpoints are created?There is only a single RPMSG channel for the CM33 remoteproc in this example-its name is "rpmsg-io-channel". As I mentioned above, both gpio@0and gpio@1 run over this same transport.quoted
The transport here is the RPMSG channel, so multiple GPIO controllers sharethat channel.quoted
That is one of my main problem with this proposal - multiplexing several GPIO controllers over the same RPMSG channel adds complexity.
Multiplexing multiple GPIO controllers over a single RPMSG channel does not inherently
add complexity. Even if we implement a “one GPIO controller per RPMSG channel” model,
the core logic in the driver remains essentially the same.
In fact, the current implementation already supports your preferred “one RPMSG channel
per GPIO controller” approach through simple DTS configuration. For example:
+ remote_cm33{
+ rpmsg {
+ channel0 {
+ gpio@0 {
+ compatible = "rpmsg-gpio";
+ reg = <0>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ };
+ };
+
+ channel1 {
+ gpio@1 {
+ compatible = "rpmsg-gpio";
+ reg = <1>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ };
+ };
+ };
+};
+
RPMSG can already handle multiplexing via channels, use one RPMSG channel per GPIO controller.quoted
Thanks, Shenweiquoted
Andrew