You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
gpio: Add GPIO Aggregator
GPIO controllers are exported to userspace using /dev/gpiochip*
character devices. Access control to these devices is provided by
standard UNIX file system permissions, on an all-or-nothing basis:
either a GPIO controller is accessible for a user, or it is not.
Currently no mechanism exists to control access to individual GPIOs.
Hence add a GPIO driver to aggregate existing GPIOs, and expose them as
a new gpiochip.
This supports the following use cases:
- Aggregating GPIOs using Sysfs
This is useful for implementing access control, and assigning a set
of GPIOs to a specific user or virtual machine.
- Generic GPIO Driver
This is useful for industrial control, where it can provide
userspace access to a simple GPIO-operated device described in DT,
cfr. e.g. spidev for SPI-operated devices.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Link: https://lore.kernel.org/r/20200511145257.22970-5-geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
4c033b5499
commit
828546e242
@@ -1541,6 +1541,18 @@ config GPIO_VIPERBOARD
|
||||
|
||||
endmenu
|
||||
|
||||
config GPIO_AGGREGATOR
|
||||
tristate "GPIO Aggregator"
|
||||
help
|
||||
Say yes here to enable the GPIO Aggregator, which provides a way to
|
||||
aggregate existing GPIO lines into a new virtual GPIO chip.
|
||||
This can serve the following purposes:
|
||||
- Assign permissions for a collection of GPIO lines to a user,
|
||||
- Export a collection of GPIO lines to a virtual machine,
|
||||
- Provide a generic driver for a GPIO-operated device in an
|
||||
industrial control context, to be operated from userspace using
|
||||
the GPIO chardev interface.
|
||||
|
||||
config GPIO_MOCKUP
|
||||
tristate "GPIO Testing Driver"
|
||||
select IRQ_SIM
|
||||
|
||||
@@ -25,6 +25,7 @@ obj-$(CONFIG_GPIO_74XX_MMIO) += gpio-74xx-mmio.o
|
||||
obj-$(CONFIG_GPIO_ADNP) += gpio-adnp.o
|
||||
obj-$(CONFIG_GPIO_ADP5520) += gpio-adp5520.o
|
||||
obj-$(CONFIG_GPIO_ADP5588) += gpio-adp5588.o
|
||||
obj-$(CONFIG_GPIO_AGGREGATOR) += gpio-aggregator.o
|
||||
obj-$(CONFIG_GPIO_ALTERA_A10SR) += gpio-altera-a10sr.o
|
||||
obj-$(CONFIG_GPIO_ALTERA) += gpio-altera.o
|
||||
obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o
|
||||
|
||||
568
drivers/gpio/gpio-aggregator.c
Normal file
568
drivers/gpio/gpio-aggregator.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user