Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
32cb3b09 55852cbb

+6 -4
+6 -4
drivers/media/i2c/vpx3220.c
··· 295 295 static int vpx3220_status(struct v4l2_subdev *sd, u32 *pstatus, v4l2_std_id *pstd) 296 296 { 297 297 int res = V4L2_IN_ST_NO_SIGNAL, status; 298 - v4l2_std_id std = 0; 298 + v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL; 299 299 300 300 status = vpx3220_fp_read(sd, 0x0f3); 301 301 ··· 312 312 case 0x10: 313 313 case 0x14: 314 314 case 0x18: 315 - std = V4L2_STD_PAL; 315 + std &= V4L2_STD_PAL; 316 316 break; 317 317 318 318 case 0x08: 319 - std = V4L2_STD_SECAM; 319 + std &= V4L2_STD_SECAM; 320 320 break; 321 321 322 322 case 0x04: 323 323 case 0x0c: 324 324 case 0x1c: 325 - std = V4L2_STD_NTSC; 325 + std &= V4L2_STD_NTSC; 326 326 break; 327 327 } 328 + } else { 329 + std = V4L2_STD_UNKNOWN; 328 330 } 329 331 if (pstd) 330 332 *pstd = std;