Commit f6cc51a9 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] soc_camera: disable STD ioctls if no tvnorms are set

If the sub-device did not report any tvnorms, then disable the STD
ioctls.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent dc5730f5
......@@ -1277,6 +1277,8 @@ static int soc_camera_probe_finish(struct soc_camera_device *icd)
sd->grp_id = soc_camera_grp_id(icd);
v4l2_set_subdev_hostdata(sd, icd);
v4l2_subdev_call(sd, video, g_tvnorms, &icd->vdev->tvnorms);
ret = v4l2_ctrl_add_handler(&icd->ctrl_handler, sd->ctrl_handler, NULL);
if (ret < 0)
return ret;
......@@ -1997,6 +1999,12 @@ static int soc_camera_video_start(struct soc_camera_device *icd)
return -ENODEV;
video_set_drvdata(icd->vdev, icd);
if (icd->vdev->tvnorms == 0) {
/* disable the STD API if there are no tvnorms defined */
v4l2_disable_ioctl(icd->vdev, VIDIOC_G_STD);
v4l2_disable_ioctl(icd->vdev, VIDIOC_S_STD);
v4l2_disable_ioctl(icd->vdev, VIDIOC_ENUMSTD);
}
ret = video_register_device(icd->vdev, VFL_TYPE_GRABBER, -1);
if (ret < 0) {
dev_err(icd->pdev, "video_register_device failed: %d\n", ret);
......
Markdown is supported
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