[PATCH v12 3/5] gpio: rpmsg: add generic rpmsg GPIO driver
Shenwei Wang
shenwei.wang at nxp.com
Tue Mar 17 08:59:50 PDT 2026
> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Tuesday, March 17, 2026 9:22 AM
> To: Arnaud POULIQUEN <arnaud.pouliquen at foss.st.com>
> Cc: Shenwei Wang <shenwei.wang at nxp.com>; Linus Walleij
> <linusw at kernel.org>; Bartosz Golaszewski <brgl at kernel.org>; Jonathan Corbet
> <corbet at lwn.net>; Rob Herring <robh at kernel.org>; Krzysztof Kozlowski
> <krzk+dt at kernel.org>; Conor Dooley <conor+dt at kernel.org>; Bjorn Andersson
> <andersson at kernel.org>; Mathieu Poirier <mathieu.poirier at linaro.org>; Frank Li
> <frank.li at nxp.com>; Sascha Hauer <s.hauer at pengutronix.de>; Shuah Khan
> <skhan at linuxfoundation.org>; linux-gpio at vger.kernel.org; linux-
> doc at vger.kernel.org; linux-kernel at vger.kernel.org; Pengutronix Kernel Team
> <kernel at pengutronix.de>; Fabio Estevam <festevam at gmail.com>; Peng Fan
> <peng.fan at nxp.com>; devicetree at vger.kernel.org; linux-
> remoteproc at vger.kernel.org; imx at lists.linux.dev; linux-arm-
> kernel at lists.infradead.org; dl-linux-imx <linux-imx at nxp.com>; Bartosz
> Golaszewski <brgl at bgdev.pl>
> Subject: [EXT] Re: [PATCH v12 3/5] gpio: rpmsg: add generic rpmsg GPIO driver
>
> > > +static int rpmsg_gpio_send_message(struct rpmsg_gpio_port *port,
> > > + struct rpmsg_gpio_packet *msg,
> > > + bool sync) {
> > > + struct rpmsg_gpio_info *info = &port->info;
> > > + struct rpdev_drvdata *drvdata;
> > > + int ret;
> > > +
> > > + drvdata = dev_get_drvdata(&info->rpdev->dev);
> > > + reinit_completion(&info->cmd_complete);
> > > +
> > > + if (drvdata->protocol_fixed_up)
> > > + ret = drvdata->protocol_fixed_up->send_fixed_up(info,
> > > + msg);
> >
> > Seems not part of a generic implementation
>
> Agreed. Lets have a clean generic implementation first, and then patches on top
> for legacy stuff.
>
Adding fixed_up hooks doesn't make the implementation non-generic-this pattern is
widely used in Linux drivers.
Shenwei
> > > + ret = of_property_read_u32(np, "ngpios", &port->ngpios);
> >
> > The number of GPIOs should be obtained from the remote side, as done
> > in virtio_gpio. In virtio_gpio, this is retrieved via a get_config operation.
> > Here, you could implement a specific RPMsg to retrieve the remote topology.
>
> The DT property ngpios is pretty standard, so i think it makes a lot of sense to
> have. But i also agree that asking the other side makes sense. What is being
> implemented here with rpmsg is not that different to greybus, and the greybus
> GPIO driver also ask the other side how many GPIO lines it has. So yes, it should
> be part of the protocol, but maybe optional?
>
> Andrew
More information about the linux-arm-kernel
mailing list