drivers: char: add generic gpiomem driver
authorJonathan Bell <jonathan@raspberrypi.com>
Tue, 25 Apr 2023 14:52:13 +0000 (15:52 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:40 +0000 (11:33 +0000)
commit030b6df36ae4ac760a6720886669d714bca49d98
tree27ec3e372fb7d532e130f520976b89a05ee07930
parent61a1e7a471b0fa517b2c3b2636200b9128416263
drivers: char: add generic gpiomem driver

Based on bcm2835-gpiomem.

We allow export of the "GPIO registers" to userspace via a chardev as
this allows for finer access control (e.g. users must be group gpio, root
not required).

This driver allows access to either rp1-gpiomem or gpiomem, depending on
which nodes are populated in devicetree.

RP1 has a different look-and-feel to BCM283x SoCs as it has split ranges
for IO controls and the parallel registered OE/IN/OUT access. To handle
this, the driver concatenates the ranges for an IO bank and the
corresponding RIO instance into a contiguous buffer.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/char/Kconfig
drivers/char/Makefile
drivers/char/raspberrypi-gpiomem.c [new file with mode: 0644]