summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-29 10:18:55 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:48:25 +0900
commitff50bea726a4bb73e8547043785b43a63c332e47 (patch)
tree5a2d72d22a069085af579d49955fe94b2a684873
parent2f6ce2521a4994be628f884a8b303dafa11057bc (diff)
downloadlinux-3.10-ff50bea726a4bb73e8547043785b43a63c332e47.tar.gz
linux-3.10-ff50bea726a4bb73e8547043785b43a63c332e47.tar.bz2
linux-3.10-ff50bea726a4bb73e8547043785b43a63c332e47.zip
upstream: [media] bt819: fix querystd
Return V4L2_STD_UNKNOWN if no signal is detected. Otherwise AND the standard mask with the detected standards. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/i2c/bt819.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/i2c/bt819.c b/drivers/media/i2c/bt819.c
index ae1eac01bbc..369cf6ff88f 100644
--- a/drivers/media/i2c/bt819.c
+++ b/drivers/media/i2c/bt819.c
@@ -215,15 +215,17 @@ static int bt819_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd)
struct bt819 *decoder = to_bt819(sd);
int status = bt819_read(decoder, 0x00);
int res = V4L2_IN_ST_NO_SIGNAL;
- v4l2_std_id std;
+ v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL;
if ((status & 0x80))
res = 0;
+ else
+ std = V4L2_STD_UNKNOWN;
if ((status & 0x10))
- std = V4L2_STD_PAL;
+ std &= V4L2_STD_PAL;
else
- std = V4L2_STD_NTSC;
+ std &= V4L2_STD_NTSC;
if (pstd)
*pstd = std;
if (pstatus)