[PATCH PoC 7/7] gpiodev: Add gpiobackend over GUSE

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Add GUSE (FUSE based kernel module similiar to CUSE) based backend. This allows transparent usage of Linux GPIO UAPI based tools like in kernel tools/gpio or libgpiod. libgpiod requires some modification to allow "/sys/class/guse" in gpiod_check_gpiochip_device(). It requir

[PATCH PoC 0/7] Interact with QEMU GPIO models via gpiodev

2025-03-19 Thread Nikita Shubin via B4 Relay
While vhost-user-gpio-pci is a good solution to pass gpios inside guest it still doesn't cover the following cases: - AFAIK the board needs to have a PCI bus; - we add new hot-plugged gpios instead of re-using the existing ones; - we can't connect it to existing gpio models; This functionality is

[PATCH PoC 2/7] Add gpiodev dummy

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Add gpiodev stub with single help option. Signed-off-by: Nikita Shubin --- gpiodev/gpio.c | 145 + gpiodev/meson.build| 5 ++ include/gpiodev/gpio.h | 34 meson.build| 11 +++- qemu-opt

[PATCH PoC 6/7] hw/arm: ast2600: set id for gpio

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Set device id for gpios to allow gpiodev binding. Signed-off-by: Nikita Shubin --- hw/arm/aspeed_ast2600.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 07210483bb29a50824c8312021bebf1ca32cac95..09ce944d6263d8

[PATCH PoC 5/7] hw/gpio/aspeed: Add gpiodev support

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Add gpiodev support for: - getting line info - getting/setting lines - monitoring line events - monitoting config events Binding is done via id, i.e.: ... -gpiodev chardev,id=aspeed-gpio0 Signed-off-by: Nikita Shubin --- hw/gpio/aspeed_gpio.c | 127 ++

[PATCH PoC 4/7] gpiodev: Add GPIO backend over chardev

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Currently based on passing linux GPIO UAPI structs over UNIX socket. This is more a PoC than a real application, still this is something to start with. Signed-off-by: Nikita Shubin --- gpiodev/gpio-chardev.c | 479 + gpiodev/

[PATCH PoC 1/7] QAPI: gpio JSON

2025-03-19 Thread Nikita Shubin via B4 Relay
From: Nikita Shubin Signed-off-by: Nikita Shubin --- qapi/gpio.json| 68 +++ qapi/meson.build | 1 + qapi/qapi-schema.json | 1 + 3 files changed, 70 insertions(+) diff --git a/qapi/gpio.json b/qapi/gpio.json new file mode 100644 i