浏览代码

msm: camera: common: Add device caps for full devices during probe

The v4l2 registration requires all devices that are not subdevs
to have device caps field to be non zero. Add device caps for
CRM and SYNC devices during probe.

CRs-Fixed: 2582994
Change-Id: I804e7bc00d597debc39d1f71259cf607c60ed069
Signed-off-by: Mukund Madhusudan Atre <[email protected]>
Mukund Madhusudan Atre 5 年之前
父节点
当前提交
42021c8b76
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 6 1
      drivers/cam_req_mgr/cam_req_mgr_dev.c
  2. 6 1
      drivers/cam_sync/cam_sync.c

+ 6 - 1
drivers/cam_req_mgr/cam_req_mgr_dev.c

@@ -555,9 +555,14 @@ static int cam_video_device_setup(void)
 	g_dev.video->ioctl_ops = &g_cam_ioctl_ops;
 	g_dev.video->ioctl_ops = &g_cam_ioctl_ops;
 	g_dev.video->minor = -1;
 	g_dev.video->minor = -1;
 	g_dev.video->vfl_type = VFL_TYPE_GRABBER;
 	g_dev.video->vfl_type = VFL_TYPE_GRABBER;
+	g_dev.video->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
 	rc = video_register_device(g_dev.video, VFL_TYPE_GRABBER, -1);
 	rc = video_register_device(g_dev.video, VFL_TYPE_GRABBER, -1);
-	if (rc)
+	if (rc) {
+		CAM_ERR(CAM_CRM,
+			"video device registration failure rc = %d, name = %s, device_caps = %d",
+			rc, g_dev.video->name, g_dev.video->device_caps);
 		goto v4l2_fail;
 		goto v4l2_fail;
+	}
 
 
 	rc = media_entity_pads_init(&g_dev.video->entity, 0, NULL);
 	rc = media_entity_pads_init(&g_dev.video->entity, 0, NULL);
 	if (rc)
 	if (rc)

+ 6 - 1
drivers/cam_sync/cam_sync.c

@@ -1053,11 +1053,16 @@ static int cam_sync_probe(struct platform_device *pdev)
 	sync_dev->vdev->fops     = &cam_sync_v4l2_fops;
 	sync_dev->vdev->fops     = &cam_sync_v4l2_fops;
 	sync_dev->vdev->ioctl_ops = &g_cam_sync_ioctl_ops;
 	sync_dev->vdev->ioctl_ops = &g_cam_sync_ioctl_ops;
 	sync_dev->vdev->minor     = -1;
 	sync_dev->vdev->minor     = -1;
+	sync_dev->vdev->device_caps |= V4L2_CAP_VIDEO_CAPTURE;
 	sync_dev->vdev->vfl_type  = VFL_TYPE_GRABBER;
 	sync_dev->vdev->vfl_type  = VFL_TYPE_GRABBER;
 	rc = video_register_device(sync_dev->vdev,
 	rc = video_register_device(sync_dev->vdev,
 		VFL_TYPE_GRABBER, -1);
 		VFL_TYPE_GRABBER, -1);
-	if (rc < 0)
+	if (rc < 0) {
+		CAM_ERR(CAM_SYNC,
+			"video device registration failure rc = %d, name = %s, device_caps = %d",
+			rc, sync_dev->vdev->name, sync_dev->vdev->device_caps);
 		goto v4l2_fail;
 		goto v4l2_fail;
+	}
 
 
 	cam_sync_init_entity(sync_dev);
 	cam_sync_init_entity(sync_dev);
 	video_set_drvdata(sync_dev->vdev, sync_dev);
 	video_set_drvdata(sync_dev->vdev, sync_dev);