char: broadcom: Add vcio module
authorNoralf Trønnes <noralf@tronnes.org>
Fri, 26 Jun 2015 12:27:06 +0000 (14:27 +0200)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:31:35 +0000 (11:31 +0000)
commit3fb9629722d5349f117f0aa49aa48afc47d83610
treed4caa975d9f439daf56ff8866a2fdfc2b8e56f13
parent7998047f32342055f0ddf6ab9abf2e955815d8bf
char: broadcom: Add vcio module

Add module for accessing the mailbox property channel through
/dev/vcio. Was previously in bcm2708-vcio.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
char: vcio: Add compat ioctl handling

There was no compat ioctl handler, so 32 bit userspace on a
64 bit kernel failed as IOCTL_MBOX_PROPERTY used the size
of char*.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
char: vcio: Fail probe if rpi_firmware is not found.

Device Tree is now the only supported config mechanism, therefore
uncomment the block of code that fails the probe if the
firmware node can't be found.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers: char: vcio: Use common compat header

The definition of compat_ptr is now common for most platforms, but
requires the inclusion of <linux/compat.h>.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
char: vcio: Rewrite as a firmware node child

The old vcio driver is a simple character device that manually locates
the firmware driver. Initialising it before the firmware driver causes
a failure, and no retries are attempted.

Rewrite vcio as a platform driver that depends on a DT node for its
instantiation and the location of the firmware driver, making use of
the miscdevice framework to reduce the code size.

N.B. Using miscdevice changes the udev SUBSYSTEM string, so a change
to the companion udev rule is required in order to continue to set
the correct device permissions, e.g.:

    KERNEL="vcio", GROUP="video", MODE="0660"

See: https://github.com/raspberrypi/linux/issues/4620

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/char/broadcom/Kconfig
drivers/char/broadcom/Makefile
drivers/char/broadcom/vcio.c [new file with mode: 0644]