devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sowjanya Komatineni <skomatineni@nvidia.com>
To: <skomatineni@nvidia.com>, <thierry.reding@gmail.com>,
	<jonathanh@nvidia.com>, <hverkuil@xs4all.nl>,
	<sakari.ailus@iki.fi>, <robh+dt@kernel.org>
Cc: <bparrot@ti.com>, <mchehab@kernel.org>,
	<linux-media@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 08/13] media: tegra-video: Add support for V4L2_EVENT_SOURCE_CHANGE
Date: Thu, 3 Dec 2020 10:59:57 -0800	[thread overview]
Message-ID: <1607022002-26575-9-git-send-email-skomatineni@nvidia.com> (raw)
In-Reply-To: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com>

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>
---
 drivers/staging/media/tegra-video/vi.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index c280117..0a85e52 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -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,
-- 
2.7.4


  parent reply	other threads:[~2020-12-03 19:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 18:59 [PATCH v3 00/13] tegra-video: Add support for capturing from HDMI-to-CSI bridge Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 01/13] media: tegra-video: Use zero crop settings if subdev has no get_selection Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 02/13] media: tegra-video: Enable VI pixel transform for YUV and RGB formats Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 03/13] media: tegra-video: Fix V4L2 pixel format RGB and YUV Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 04/13] media: tegra-video: Add support for V4L2_PIX_FMT_NV16 Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 05/13] media: tegra-video: Add DV timing support Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 06/13] media: tegra-video: Add support for EDID ioctl ops Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 07/13] media: tegra-video: Add support for VIDIOC_LOG_STATUS ioctl Sowjanya Komatineni
2020-12-03 18:59 ` Sowjanya Komatineni [this message]
2020-12-03 18:59 ` [PATCH v3 09/13] media: tegra-video: Implement V4L2 device notify callback Sowjanya Komatineni
2020-12-03 18:59 ` [PATCH v3 10/13] media: v4l2-fwnode: Update V4L2_FWNODE_CSI2_MAX_DATA_LANES to 8 Sowjanya Komatineni
2020-12-04 12:48   ` Sakari Ailus
2020-12-07 10:47   ` Hans Verkuil
2020-12-08 19:59     ` Sakari Ailus
2020-12-08 20:27       ` Sowjanya Komatineni
2020-12-03 19:00 ` [PATCH v3 11/13] dt-bindings: tegra: Update csi data-lanes to maximum 8 lanes Sowjanya Komatineni
2020-12-04 12:49   ` Sakari Ailus
2020-12-09 20:16   ` Rob Herring
2020-12-03 19:00 ` [PATCH v3 12/13] media: tegra-video: Add support for x8 captures with gang ports Sowjanya Komatineni
2020-12-03 19:00 ` [PATCH v3 13/13] media: tegra-video: Add custom V4L2 control V4L2_CID_TEGRA_SYNCPT_TIMEOUT_RETRY Sowjanya Komatineni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1607022002-26575-9-git-send-email-skomatineni@nvidia.com \
    --to=skomatineni@nvidia.com \
    --cc=bparrot@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).