Skip to content

Commit 3a29355

Browse files
vireshkbrgl
authored andcommitted
gpio: Add virtio-gpio driver
This patch adds a new driver for Virtio based GPIO devices. This allows a guest VM running Linux to access GPIO lines provided by the host. It supports all basic operations, except interrupts for the GPIO lines. Based on the initial work posted by: "Enrico Weigelt, metux IT consult" <lkml@metux.net>. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
1 parent d0ef631 commit 3a29355

File tree

6 files changed

+440
-0
lines changed

6 files changed

+440
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19647,6 +19647,13 @@ F: Documentation/filesystems/virtiofs.rst
1964719647
F: fs/fuse/virtio_fs.c
1964819648
F: include/uapi/linux/virtio_fs.h
1964919649

19650+
VIRTIO GPIO DRIVER
19651+
M: Enrico Weigelt, metux IT consult <info@metux.net>
19652+
M: Viresh Kumar <vireshk@kernel.org>
19653+
S: Maintained
19654+
F: drivers/gpio/gpio-virtio.c
19655+
F: include/uapi/linux/virtio_gpio.h
19656+
1965019657
VIRTIO GPU DRIVER
1965119658
M: David Airlie <airlied@linux.ie>
1965219659
M: Gerd Hoffmann <kraxel@redhat.com>

drivers/gpio/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,15 @@ config GPIO_MOCKUP
16691669
tools/testing/selftests/gpio/gpio-mockup.sh. Reference the usage in
16701670
it.
16711671

1672+
config GPIO_VIRTIO
1673+
tristate "VirtIO GPIO support"
1674+
depends on VIRTIO
1675+
help
1676+
Say Y here to enable guest support for virtio-based GPIO controllers.
1677+
1678+
These virtual GPIOs can be routed to real GPIOs or attached to
1679+
simulators on the host (like QEMU).
1680+
16721681
endmenu
16731682

16741683
endif

drivers/gpio/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ obj-$(CONFIG_GPIO_UCB1400) += gpio-ucb1400.o
165165
obj-$(CONFIG_GPIO_UNIPHIER) += gpio-uniphier.o
166166
obj-$(CONFIG_GPIO_VF610) += gpio-vf610.o
167167
obj-$(CONFIG_GPIO_VIPERBOARD) += gpio-viperboard.o
168+
obj-$(CONFIG_GPIO_VIRTIO) += gpio-virtio.o
168169
obj-$(CONFIG_GPIO_VISCONTI) += gpio-visconti.o
169170
obj-$(CONFIG_GPIO_VR41XX) += gpio-vr41xx.o
170171
obj-$(CONFIG_GPIO_VX855) += gpio-vx855.o

0 commit comments

Comments
 (0)