]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: tegra-video: Add support for V4L2_EVENT_SOURCE_CHANGE
authorSowjanya Komatineni <skomatineni@nvidia.com>
Fri, 11 Dec 2020 17:02:37 +0000 (18:02 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 4 Jan 2021 12:01:23 +0000 (13:01 +0100)
Current implementation uses v4l2_ctrl_subscribe_event() and this
does not handle V4L2_EVENT_SOURCE_CHANGE.

So, update driver to handle V4L2_EVENT_SOURCE_CHANGE.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/tegra-video/vi.c

index c280117a523ca7e7b1a376a0f7a5c8317a6bf7b7..0a85e527ec40dac8047f21bf06d294696a69e082 100644 (file)
@@ -642,6 +642,18 @@ static int tegra_channel_set_subdev_active_fmt(struct tegra_vi_channel *chan)
        return 0;
 }
 
+static int
+tegra_channel_subscribe_event(struct v4l2_fh *fh,
+                             const struct v4l2_event_subscription *sub)
+{
+       switch (sub->type) {
+       case V4L2_EVENT_SOURCE_CHANGE:
+               return v4l2_event_subscribe(fh, sub, 4, NULL);
+       }
+
+       return v4l2_ctrl_subscribe_event(fh, sub);
+}
+
 static int tegra_channel_g_selection(struct file *file, void *priv,
                                     struct v4l2_selection *sel)
 {
@@ -904,7 +916,7 @@ static const struct v4l2_ioctl_ops tegra_channel_ioctl_ops = {
        .vidioc_expbuf                  = vb2_ioctl_expbuf,
        .vidioc_streamon                = vb2_ioctl_streamon,
        .vidioc_streamoff               = vb2_ioctl_streamoff,
-       .vidioc_subscribe_event         = v4l2_ctrl_subscribe_event,
+       .vidioc_subscribe_event         = tegra_channel_subscribe_event,
        .vidioc_unsubscribe_event       = v4l2_event_unsubscribe,
        .vidioc_g_selection             = tegra_channel_g_selection,
        .vidioc_s_selection             = tegra_channel_s_selection,