Re: [PATCH V3 1/3] gpio: Add virtio-gpio driver

From: Arnd Bergmann
Date: Thu Jun 10 2021 - 09:24:09 EST


On Thu, Jun 10, 2021 at 2:18 PM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> From: "Enrico Weigelt, metux IT consult" <info@xxxxxxxxx>
>
> This patch adds a new driver for Virtio based GPIO devices.
>
> This allows a guest VM running Linux to access GPIO device provided by
> the host. It supports all basic operations for now, except interrupts
> for the GPIO lines.
>
> Signed-off-by: "Enrico Weigelt, metux IT consult" <info@xxxxxxxxx>
> Co-developed-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Can you give an example of how this would be hooked up to other drivers
using those gpios. Can you give an example of how using the "gpio-keys" or
"gpio-leds" drivers in combination with virtio-gpio looks like in the DT?

Would qemu simply add the required DT properties to the device node that
corresponds to the virtio device in this case?

>From what I can tell, both the mmio and pci variants of virtio can have their
dev->of_node populated, but I don't see the logic in register_virtio_device()
that looks up the of_node of the virtio_device that the of_gpio code then
tries to refer to.

Arnd