Skip to content

Commit fddc714

Browse files
author
Desnes Nunes
committed
media: pvrusb2: Convert queryctrl to query_ext_ctrl
JIRA: https://issues.redhat.com/browse/RHEL-78934 commit 8b5ebc6 Author: Ricardo Ribalda <ribalda@chromium.org> Date: Sun, 23 Feb 2025 18:58:05 +0000 The driver was missing support for query_ext_ctrl. Instead of adding a new callback for it, replace the current implementation of queryctrl and let the ioctl framework emulate the old function. Most of the fields are identical, so the change is pretty simple. Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent b194ef2 commit fddc714

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/media/usb/pvrusb2/pvrusb2-v4l2.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ static int pvr2_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
497497
return pvr2_hdw_set_streaming(hdw, 0);
498498
}
499499

500-
static int pvr2_queryctrl(struct file *file, void *priv,
501-
struct v4l2_queryctrl *vc)
500+
static int pvr2_query_ext_ctrl(struct file *file, void *priv,
501+
struct v4l2_query_ext_ctrl *vc)
502502
{
503503
struct pvr2_v4l2_fh *fh = file->private_data;
504504
struct pvr2_hdw *hdw = fh->channel.mc_head->hdw;
@@ -521,13 +521,16 @@ static int pvr2_queryctrl(struct file *file, void *priv,
521521
}
522522

523523
pvr2_trace(PVR2_TRACE_V4LIOCTL,
524-
"QUERYCTRL id=0x%x mapping name=%s (%s)",
524+
"QUERYEXTCTRL id=0x%x mapping name=%s (%s)",
525525
vc->id, pvr2_ctrl_get_name(cptr),
526526
pvr2_ctrl_get_desc(cptr));
527527
strscpy(vc->name, pvr2_ctrl_get_desc(cptr), sizeof(vc->name));
528528
vc->flags = pvr2_ctrl_get_v4lflags(cptr);
529529
pvr2_ctrl_get_def(cptr, &val);
530530
vc->default_value = val;
531+
vc->nr_of_dims = 0;
532+
vc->elems = 1;
533+
vc->elem_size = 4;
531534
switch (pvr2_ctrl_get_type(cptr)) {
532535
case pvr2_ctl_enum:
533536
vc->type = V4L2_CTRL_TYPE_MENU;
@@ -549,7 +552,7 @@ static int pvr2_queryctrl(struct file *file, void *priv,
549552
break;
550553
default:
551554
pvr2_trace(PVR2_TRACE_V4LIOCTL,
552-
"QUERYCTRL id=0x%x name=%s not mappable",
555+
"QUERYEXTCTRL id=0x%x name=%s not mappable",
553556
vc->id, pvr2_ctrl_get_name(cptr));
554557
return -EINVAL;
555558
}
@@ -812,7 +815,7 @@ static const struct v4l2_ioctl_ops pvr2_ioctl_ops = {
812815
.vidioc_try_fmt_vid_cap = pvr2_try_fmt_vid_cap,
813816
.vidioc_streamon = pvr2_streamon,
814817
.vidioc_streamoff = pvr2_streamoff,
815-
.vidioc_queryctrl = pvr2_queryctrl,
818+
.vidioc_query_ext_ctrl = pvr2_query_ext_ctrl,
816819
.vidioc_querymenu = pvr2_querymenu,
817820
.vidioc_g_ctrl = pvr2_g_ctrl,
818821
.vidioc_s_ctrl = pvr2_s_ctrl,

0 commit comments

Comments
 (0)