]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blobdiff - drivers/media/platform/tegra/camera/vi/vi2_fops.c
drivers: media: camera: Add sync op support
[hercules2020/nv-tegra/linux-4.4.git] / drivers / media / platform / tegra / camera / vi / vi2_fops.c
index 271209a06018eca35445ed4b7df1dbdfb9c007ca..8008c1991e9a745447cb6ae08a05f66c4f0812c4 100644 (file)
@@ -718,6 +718,28 @@ void vi2_channel_stop_streaming(struct vb2_queue *vq)
        vi_channel_syncpt_free(chan);
 }
 
+int vi2_mfi_work(struct tegra_mc_vi *vi, int csiport)
+{
+       struct tegra_channel *it;
+       int ret = 0;
+
+       /* for vi2, the input argument is the actual CSI port itself */
+       /* search the list and match the port */
+       list_for_each_entry(it, &vi->vi_chans, list) {
+               if (csiport == it->port[0]) {
+                       ret = v4l2_subdev_call(it->subdev_on_csi, core,
+                                       sync, V4L2_SYNC_EVENT_FOCUS_POS);
+                       if (ret < 0 && ret != -ENOIOCTLCMD) {
+                               dev_err(vi->dev,
+                                       "%s:channel failed\n", __func__);
+                               return ret;
+                       }
+               }
+       }
+
+       return ret;
+}
+
 int tegra_vi2_power_on(struct tegra_mc_vi *vi)
 {
        int ret;