From dd9e74cfc0a13fa0630ef09fc62e2fad2c88219c Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Sun, 24 Jul 2011 17:07:07 -0300 Subject: [PATCH] --- yaml --- r: 261577 b: refs/heads/master c: de99d5328c6d54694471da28711a05adec708c3b h: refs/heads/master i: 261575: 75df15c7c4377467b6ca24fa08332e33da6dcc90 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx231xx/cx231xx-video.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 68a30e953dde..e101e7895f92 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44ecf1df9493e6684cd1bb34abb107a0ffe1078a +refs/heads/master: de99d5328c6d54694471da28711a05adec708c3b diff --git a/trunk/drivers/media/video/cx231xx/cx231xx-video.c b/trunk/drivers/media/video/cx231xx/cx231xx-video.c index 21fa54762be7..6e81f970dc7d 100644 --- a/trunk/drivers/media/video/cx231xx/cx231xx-video.c +++ b/trunk/drivers/media/video/cx231xx/cx231xx-video.c @@ -1179,7 +1179,8 @@ static int vidioc_enum_input(struct file *file, void *priv, { struct cx231xx_fh *fh = priv; struct cx231xx *dev = fh->dev; - unsigned int n; + u32 gen_stat; + unsigned int ret, n; n = i->index; if (n >= MAX_CX231XX_INPUT) @@ -1198,6 +1199,18 @@ static int vidioc_enum_input(struct file *file, void *priv, i->std = dev->vdev->tvnorms; + /* If they are asking about the active input, read signal status */ + if (n == dev->video_input) { + ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS, + GEN_STAT, 2, &gen_stat, 4); + if (ret > 0) { + if ((gen_stat & FLD_VPRES) == 0x00) + i->status |= V4L2_IN_ST_NO_SIGNAL; + if ((gen_stat & FLD_HLOCK) == 0x00) + i->status |= V4L2_IN_ST_NO_H_LOCK; + } + } + return 0; }