[media] pvrusb2: implement VIDIOC_QUERYSTD

Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Mauro Carvalho Chehab 2011-10-03 12:22:28 -03:00
parent b728666ba5
commit 7383a47395
3 changed files with 17 additions and 0 deletions

View File

@ -2993,6 +2993,13 @@ static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id,
pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \
} }
int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std)
{
v4l2_device_call_all(&hdw->v4l2_dev, 0,
video, querystd, std);
return 0;
}
/* Execute whatever commands are required to update the state of all the /* Execute whatever commands are required to update the state of all the
sub-devices so that they match our current control values. */ sub-devices so that they match our current control values. */
static void pvr2_subdev_update(struct pvr2_hdw *hdw) static void pvr2_subdev_update(struct pvr2_hdw *hdw)

View File

@ -214,6 +214,9 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *);
int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std,
unsigned int idx); unsigned int idx);
/* Get the detected video standard */
int pvr2_hdw_get_detected_std(struct pvr2_hdw *hdw, v4l2_std_id *std);
/* Enable / disable retrieval of CPU firmware or prom contents. This must /* Enable / disable retrieval of CPU firmware or prom contents. This must
be enabled before pvr2_hdw_cpufw_get() will function. Note that doing be enabled before pvr2_hdw_cpufw_get() will function. Note that doing
this may prevent the device from running (and leaving this mode may this may prevent the device from running (and leaving this mode may

View File

@ -227,6 +227,13 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
break; break;
} }
case VIDIOC_QUERYSTD:
{
v4l2_std_id *std = arg;
ret = pvr2_hdw_get_detected_std(hdw, std);
break;
}
case VIDIOC_G_STD: case VIDIOC_G_STD:
{ {
int val = 0; int val = 0;