Commit 32cb3b09 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vpx3220: fix querystd

Return V4L2_STD_UNKNOWN if no signal is detected.
Otherwise AND the standard mask with the detected standards.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 55852cbb
...@@ -295,7 +295,7 @@ static int vpx3220_init(struct v4l2_subdev *sd, u32 val) ...@@ -295,7 +295,7 @@ static int vpx3220_init(struct v4l2_subdev *sd, u32 val)
static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd) static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd)
{ {
int res = V4L2_IN_ST_NO_SIGNAL, status; int res = V4L2_IN_ST_NO_SIGNAL, status;
v4l2_std_id std = 0; v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL;
status = vpx3220_fp_read(sd, 0x0f3); status = vpx3220_fp_read(sd, 0x0f3);
...@@ -312,19 +312,21 @@ static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pst ...@@ -312,19 +312,21 @@ static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pst
case 0x10: case 0x10:
case 0x14: case 0x14:
case 0x18: case 0x18:
std = V4L2_STD_PAL; std &= V4L2_STD_PAL;
break; break;
case 0x08: case 0x08:
std = V4L2_STD_SECAM; std &= V4L2_STD_SECAM;
break; break;
case 0x04: case 0x04:
case 0x0c: case 0x0c:
case 0x1c: case 0x1c:
std = V4L2_STD_NTSC; std &= V4L2_STD_NTSC;
break; break;
} }
} else {
std = V4L2_STD_UNKNOWN;
} }
if (pstd) if (pstd)
*pstd = std; *pstd = std;
......
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