|
@@ -1364,40 +1364,18 @@ static int v4l_enumstd(const struct v4l2_ioctl_ops *ops,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int v4l_g_std(const struct v4l2_ioctl_ops *ops,
|
|
|
- struct file *file, void *fh, void *arg)
|
|
|
-{
|
|
|
- struct video_device *vfd = video_devdata(file);
|
|
|
- v4l2_std_id *id = arg;
|
|
|
-
|
|
|
- /* Calls the specific handler */
|
|
|
- if (ops->vidioc_g_std)
|
|
|
- return ops->vidioc_g_std(file, fh, arg);
|
|
|
- if (vfd->current_norm) {
|
|
|
- *id = vfd->current_norm;
|
|
|
- return 0;
|
|
|
- }
|
|
|
- return -ENOTTY;
|
|
|
-}
|
|
|
-
|
|
|
static int v4l_s_std(const struct v4l2_ioctl_ops *ops,
|
|
|
struct file *file, void *fh, void *arg)
|
|
|
{
|
|
|
struct video_device *vfd = video_devdata(file);
|
|
|
v4l2_std_id id = *(v4l2_std_id *)arg, norm;
|
|
|
- int ret;
|
|
|
|
|
|
norm = id & vfd->tvnorms;
|
|
|
if (vfd->tvnorms && !norm) /* Check if std is supported */
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* Calls the specific handler */
|
|
|
- ret = ops->vidioc_s_std(file, fh, norm);
|
|
|
-
|
|
|
- /* Updates standard information */
|
|
|
- if (ret >= 0)
|
|
|
- vfd->current_norm = norm;
|
|
|
- return ret;
|
|
|
+ return ops->vidioc_s_std(file, fh, norm);
|
|
|
}
|
|
|
|
|
|
static int v4l_querystd(const struct v4l2_ioctl_ops *ops,
|
|
@@ -1500,7 +1478,6 @@ static int v4l_prepare_buf(const struct v4l2_ioctl_ops *ops,
|
|
|
static int v4l_g_parm(const struct v4l2_ioctl_ops *ops,
|
|
|
struct file *file, void *fh, void *arg)
|
|
|
{
|
|
|
- struct video_device *vfd = video_devdata(file);
|
|
|
struct v4l2_streamparm *p = arg;
|
|
|
v4l2_std_id std;
|
|
|
int ret = check_fmt(file, p->type);
|
|
@@ -1509,16 +1486,13 @@ static int v4l_g_parm(const struct v4l2_ioctl_ops *ops,
|
|
|
return ret;
|
|
|
if (ops->vidioc_g_parm)
|
|
|
return ops->vidioc_g_parm(file, fh, p);
|
|
|
- std = vfd->current_norm;
|
|
|
if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE &&
|
|
|
p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
|
|
|
return -EINVAL;
|
|
|
p->parm.capture.readbuffers = 2;
|
|
|
- if (is_valid_ioctl(vfd, VIDIOC_G_STD) && ops->vidioc_g_std)
|
|
|
- ret = ops->vidioc_g_std(file, fh, &std);
|
|
|
+ ret = ops->vidioc_g_std(file, fh, &std);
|
|
|
if (ret == 0)
|
|
|
- v4l2_video_std_frame_period(std,
|
|
|
- &p->parm.capture.timeperframe);
|
|
|
+ v4l2_video_std_frame_period(std, &p->parm.capture.timeperframe);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -2055,7 +2029,7 @@ static struct v4l2_ioctl_info v4l2_ioctls[] = {
|
|
|
IOCTL_INFO_FNC(VIDIOC_STREAMOFF, v4l_streamoff, v4l_print_buftype, INFO_FL_PRIO | INFO_FL_QUEUE),
|
|
|
IOCTL_INFO_FNC(VIDIOC_G_PARM, v4l_g_parm, v4l_print_streamparm, INFO_FL_CLEAR(v4l2_streamparm, type)),
|
|
|
IOCTL_INFO_FNC(VIDIOC_S_PARM, v4l_s_parm, v4l_print_streamparm, INFO_FL_PRIO),
|
|
|
- IOCTL_INFO_FNC(VIDIOC_G_STD, v4l_g_std, v4l_print_std, 0),
|
|
|
+ IOCTL_INFO_STD(VIDIOC_G_STD, vidioc_g_std, v4l_print_std, 0),
|
|
|
IOCTL_INFO_FNC(VIDIOC_S_STD, v4l_s_std, v4l_print_std, INFO_FL_PRIO),
|
|
|
IOCTL_INFO_FNC(VIDIOC_ENUMSTD, v4l_enumstd, v4l_print_standard, INFO_FL_CLEAR(v4l2_standard, index)),
|
|
|
IOCTL_INFO_FNC(VIDIOC_ENUMINPUT, v4l_enuminput, v4l_print_enuminput, INFO_FL_CLEAR(v4l2_input, index)),
|