forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/media/platform/rockchip/isp/isp_mipi_luma.c
....@@ -82,9 +82,12 @@
8282 struct rkisp_luma_vdev *params = video_drvdata(filp);
8383 int ret;
8484
85
+ if (!params->dev->is_probe_end)
86
+ return -EINVAL;
87
+
8588 ret = v4l2_fh_open(filp);
8689 if (!ret) {
87
- ret = v4l2_pipeline_pm_use(&params->vnode.vdev.entity, 1);
90
+ ret = v4l2_pipeline_pm_get(&params->vnode.vdev.entity);
8891 if (ret < 0)
8992 vb2_fop_release(filp);
9093 }
....@@ -98,12 +101,8 @@
98101 int ret;
99102
100103 ret = vb2_fop_release(file);
101
- if (!ret) {
102
- ret = v4l2_pipeline_pm_use(&luma->vnode.vdev.entity, 0);
103
- if (ret < 0)
104
- v4l2_err(&luma->dev->v4l2_dev,
105
- "set pipeline power failed %d\n", ret);
106
- }
104
+ if (!ret)
105
+ v4l2_pipeline_pm_put(&luma->vnode.vdev.entity);
107106 return ret;
108107 }
109108
....@@ -397,7 +396,7 @@
397396
398397 if (send_task) {
399398 luma_vdev->work.readout = RKISP_ISP_READOUT_LUMA;
400
- luma_vdev->work.timestamp = ktime_get_ns();
399
+ luma_vdev->work.timestamp = rkisp_time_get_ns(luma_vdev->dev);
401400 luma_vdev->work.frame_id = cur_frame_id;
402401
403402 if (frm_mode == RKISP_LUMA_THREEFRM)
....@@ -473,7 +472,7 @@
473472 if (ret < 0)
474473 goto err_release_queue;
475474
476
- ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
475
+ ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
477476 if (ret < 0) {
478477 dev_err(&vdev->dev,
479478 "could not register Video for Linux device\n");