mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ramzi BEN MEFTAH <rbmeftah@de.adit-jv.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Janusz Krzysztofik <jmkrzyszt@gmail.com>,
	Jacopo Mondi <jacopo@jmondi.org>,
	Steve Longerbeam <steve_longerbeam@mentor.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Arnd Bergmann <arnd@arndb.de>, <linux-media@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Michael Rodin <mrodin@de.adit-jv.com>,
	<efriedrich@de.adit-jv.com>, <erosca@de.adit-jv.com>,
	Ramzi BEN MEFTAH <rbmeftah@de.adit-jv.com>
Subject: [PATCH 3/3] media: i2c: adv748x: add enuminput control to adv748x hdmi subdev
Date: Tue, 16 Jun 2020 12:00:17 +0200	[thread overview]
Message-ID: <1592301619-17631-3-git-send-email-rbmeftah@de.adit-jv.com> (raw)
In-Reply-To: <1592301619-17631-1-git-send-email-rbmeftah@de.adit-jv.com>

This patch adds support for enuminput control to the adv748x hdmi subdev.
This will allow userspace for example to query input hdmi signal status.

Signed-off-by: Ramzi BEN MEFTAH <rbmeftah@de.adit-jv.com>
---
 drivers/media/i2c/adv748x/adv748x-hdmi.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c
index c557f8f..2d748b2 100644
--- a/drivers/media/i2c/adv748x/adv748x-hdmi.c
+++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c
@@ -350,6 +350,22 @@ static int adv748x_hdmi_g_input_status(struct v4l2_subdev *sd, u32 *status)
 	return 0;
 }
 
+static int adv748x_hdmi_enuminput(struct v4l2_subdev *sd,
+				 struct v4l2_input *input)
+{
+	if (input->index != 0)
+		return -EINVAL;
+
+	input->type = V4L2_INPUT_TYPE_CAMERA;
+	input->capabilities = V4L2_IN_CAP_DV_TIMINGS;
+	input->status = V4L2_IN_ST_NO_SIGNAL;
+	input->std = V4L2_STD_UNKNOWN;
+
+	snprintf(input->name, sizeof(input->name), "%s", sd->name);
+
+	return adv748x_hdmi_g_input_status(sd, &input->status);
+}
+
 static int adv748x_hdmi_s_stream(struct v4l2_subdev *sd, int enable)
 {
 	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
@@ -386,6 +402,7 @@ static const struct v4l2_subdev_video_ops adv748x_video_ops_hdmi = {
 	.g_dv_timings = adv748x_hdmi_g_dv_timings,
 	.query_dv_timings = adv748x_hdmi_query_dv_timings,
 	.g_input_status = adv748x_hdmi_g_input_status,
+	.enuminput = adv748x_hdmi_enuminput,
 	.s_stream = adv748x_hdmi_s_stream,
 	.g_pixelaspect = adv748x_hdmi_g_pixelaspect,
 };
-- 
2.7.4


  parent reply	other threads:[~2020-06-16 10:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 10:00 [PATCH 1/3] v4l2-subdev: Add subdev ioctl support for ENUM/GET/SET INPUT Ramzi BEN MEFTAH
2020-06-16 10:00 ` [PATCH 2/3] media: i2c: adv748x-afe: Implement enum/get/set input Ramzi BEN MEFTAH
2020-06-16 10:00 ` Ramzi BEN MEFTAH [this message]
2020-06-24  7:53 ` [PATCH 1/3] v4l2-subdev: Add subdev ioctl support for ENUM/GET/SET INPUT Jacopo Mondi
2020-06-25  2:01   ` Laurent Pinchart
2020-06-25  9:30     ` Ramzi Ben Meftah
2020-06-25  9:47       ` Laurent Pinchart
2020-06-25 10:18         ` Ramzi Ben Meftah
2020-06-25 10:29           ` Laurent Pinchart
2020-06-25 10:35             ` Hans Verkuil
2020-06-26  9:09               ` Ramzi Ben Meftah
2020-06-26  9:15                 ` Ramzi Ben Meftah
2020-06-26  9:25                 ` Hans Verkuil
2020-06-26 10:28                   ` Ramzi Ben Meftah
2020-06-25 17:41     ` Steve Longerbeam
2020-06-26  1:12       ` Laurent Pinchart
2020-06-29  9:24         ` Ramzi Ben Meftah
2020-06-29  9:34           ` Laurent Pinchart
2020-06-24 10:08 ` Hans Verkuil
2020-06-24 10:16   ` Hans Verkuil

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=1592301619-17631-3-git-send-email-rbmeftah@de.adit-jv.com \
    --to=rbmeftah@de.adit-jv.com \
    --cc=arnd@arndb.de \
    --cc=efriedrich@de.adit-jv.com \
    --cc=erosca@de.adit-jv.com \
    --cc=ezequiel@collabora.com \
    --cc=hans.verkuil@cisco.com \
    --cc=jacopo@jmondi.org \
    --cc=jmkrzyszt@gmail.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mrodin@de.adit-jv.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=steve_longerbeam@mentor.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

all inboxes | Powered by JetHome®