media: tvp5150: add g_std callback

This change “media: tvp5150: add g_std callback” in Linux kernel is authored by Marco Felsch <m.felsch [at] pengutronix.de> on Thu Jun 28 12:20:49 2018 -0400.

media: tvp5150: add g_std callback

Add callback to retrieve the current set norm.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 0db87cc.

There are 10 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/media/i2c/tvp5150.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index ad55ee3..28385a1 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -761,6 +761,15 @@ static int tvp5150_set_std(struct v4l2_subdev *sd, v4l2_std_id std)
 	return 0;
 }
 
+static int tvp5150_g_std(struct v4l2_subdev *sd, v4l2_std_id *std)
+{
+	struct tvp5150 *decoder = to_tvp5150(sd);
+
+	*std = decoder->norm;
+
+	return 0;
+}
+
 static int tvp5150_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
 {
 	struct tvp5150 *decoder = to_tvp5150(sd);
@@ -1375,6 +1384,7 @@ static int tvp5150_registered(struct v4l2_subdev *sd)
 
 static const struct v4l2_subdev_video_ops tvp5150_video_ops = {
 	.s_std = tvp5150_s_std,
+	.g_std = tvp5150_g_std,
 	.s_stream = tvp5150_s_stream,
 	.s_routing = tvp5150_s_routing,
 	.g_mbus_config = tvp5150_g_mbus_config,

The commit for this change in Linux stable tree is 0db87cc (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *