Commit 7dd8fbbe authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] adv7183: fix querystd

If no signal is detected, return V4L2_STD_UNKNOWN. Otherwise AND the standard
with the detected standards.
Note that the v4l2 core initializes the std with tvnorms before calling the
querystd ioctl.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Cc: Scott Jiang <scott.jiang.linux@gmail.com>
Acked-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ca371575
...@@ -374,28 +374,28 @@ static int adv7183_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) ...@@ -374,28 +374,28 @@ static int adv7183_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
reg = adv7183_read(sd, ADV7183_STATUS_1); reg = adv7183_read(sd, ADV7183_STATUS_1);
switch ((reg >> 0x4) & 0x7) { switch ((reg >> 0x4) & 0x7) {
case 0: case 0:
*std = V4L2_STD_NTSC; *std &= V4L2_STD_NTSC;
break; break;
case 1: case 1:
*std = V4L2_STD_NTSC_443; *std &= V4L2_STD_NTSC_443;
break; break;
case 2: case 2:
*std = V4L2_STD_PAL_M; *std &= V4L2_STD_PAL_M;
break; break;
case 3: case 3:
*std = V4L2_STD_PAL_60; *std &= V4L2_STD_PAL_60;
break; break;
case 4: case 4:
*std = V4L2_STD_PAL; *std &= V4L2_STD_PAL;
break; break;
case 5: case 5:
*std = V4L2_STD_SECAM; *std &= V4L2_STD_SECAM;
break; break;
case 6: case 6:
*std = V4L2_STD_PAL_Nc; *std &= V4L2_STD_PAL_Nc;
break; break;
case 7: case 7:
*std = V4L2_STD_SECAM; *std &= V4L2_STD_SECAM;
break; break;
default: default:
*std = V4L2_STD_UNKNOWN; *std = V4L2_STD_UNKNOWN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment