Skip to content

Commit

Permalink
media: hevc_dec: Add module parameter for video_nr
Browse files Browse the repository at this point in the history
To avoid user complaints that /dev/video0 isn't their USB
webcam, add downstream patch that allows setting the preferred
video device number.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 committed Jan 16, 2025
1 parent 1ae3a8b commit da6a3bc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/media/platform/raspberrypi/hevc_dec/hevc_d.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
#include "hevc_d_hw.h"
#include "hevc_d_h265.h"

/*
* Default /dev/videoN node number.
* Deliberately avoid the very low numbers as these are often taken by webcams
* etc, and simple apps tend to only go for /dev/video0.
*/
static int video_nr = 19;
module_param(video_nr, int, 0644);
MODULE_PARM_DESC(video_nr, "decoder video device number");

static const struct hevc_d_control hevc_d_ctrls[] = {
{
.cfg = {
Expand Down Expand Up @@ -373,7 +382,7 @@ static int hevc_d_probe(struct platform_device *pdev)
dev->mdev.ops = &hevc_d_m2m_media_ops;
dev->v4l2_dev.mdev = &dev->mdev;

ret = video_register_device(vfd, VFL_TYPE_VIDEO, -1);
ret = video_register_device(vfd, VFL_TYPE_VIDEO, video_nr);
if (ret) {
v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
goto err_m2m;
Expand Down

0 comments on commit da6a3bc

Please sign in to comment.