Skip to content
Commit 6e205d7b authored by Jonathan Bell's avatar Jonathan Bell Committed by popcornmix
Browse files

drivers: char: add chardev for mmap'ing the RPiVid control registers



Based on the gpiomem driver, allow mapping of the decoder register
spaces such that userspace can access control/status registers.
This driver is intended for use with a custom ffmpeg backend accelerator
prior to a v4l2 driver being written.

Signed-off-by: default avatarJonathan Bell <jonathan@raspberrypi.org>

driver: char: rpivid: Destroy the legacy device on remove

The legacy name support created a new device that was never destroyed.
If the driver was unloaded and reloaded, it failed due to the
device already existing.

Fixes: "75f1d14c driver: char: rpivid - also support legacy name"
Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>

driver: char: rpivid: Clean up error handling use of ERR_PTR/IS_ERR

The driver used an unnecessary intermediate void* variable so it
only called ERR_PTR once to convert to the error value.

Switch to converting as the error arises to remove these intermediate
variables.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>

driver: char: rpivid: Add error handling to the legacy device load

The return value from device_create for the legacy device was never
checked or handled. Add the required error handling.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>

driver: char: rpivid: Fix coding style whitespace issues.

Makes checkpatch happier.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>

driver: char: rpimem: Add SPDX licence header.

Stops checkpatch complaining.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>

driver: char: rpivid: Fix access to freed memory

The error path during probe frees the private memory block, and
then promptly dereferences it to log an error message.

Use the base device instead of the pointer to it in the private
structure.

Signed-off-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>
parent 849ebc07
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment