aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-07-17 17:29:42 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-30 15:26:23 -0400
commitc812b67ca4ed13fa5ec60f06c4ed8f648722a186 (patch)
treef01921a78e2f0a46d2a154430b8e7afc42ef277b /drivers/media
parent9c837fb692b005203765d8a569a2fe43fdff9df1 (diff)
V4L/DVB (5886): zr36067: Fix problem setting norms
The zr36067 driver doesn't make a distinction between the different sub-types of NTSC, PAL, or SECAM norms. For example, when the enum std ioctl returns the PAL standard it returns PAL_BG|PAL_DK|PAL_H|PAL_I. When setting the norm, it required the bitmask to match exactly the set of norms used during the enumeration. If just one norm was specified, for example PAL_BG or NTSC_M, it would fail. This violates the V4L2 spec, "VIDIOC_S_STD accepts *one* or more flags..." The key thing to realize is that V4L2_STD_PAL is not one bit, it is multiple bits. It's ok to call S_STD with any *one* of those bits, but the driver was requiring *all* of them. This fixes the S_STD function so that it will accept any set of one or more PAL norms as PAL, and the same for NTSC and SECAM. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/zoran_driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index 17118a490f81..fac97cb5a828 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -3704,11 +3704,11 @@ zoran_do_ioctl (struct inode *inode,
3704 dprintk(3, KERN_DEBUG "%s: VIDIOC_S_STD - norm=0x%llx\n", 3704 dprintk(3, KERN_DEBUG "%s: VIDIOC_S_STD - norm=0x%llx\n",
3705 ZR_DEVNAME(zr), (unsigned long long)*std); 3705 ZR_DEVNAME(zr), (unsigned long long)*std);
3706 3706
3707 if (*std == V4L2_STD_PAL) 3707 if ((*std & V4L2_STD_PAL) && !(*std & ~V4L2_STD_PAL))
3708 norm = VIDEO_MODE_PAL; 3708 norm = VIDEO_MODE_PAL;
3709 else if (*std == V4L2_STD_NTSC) 3709 else if ((*std & V4L2_STD_NTSC) && !(*std & ~V4L2_STD_NTSC))
3710 norm = VIDEO_MODE_NTSC; 3710 norm = VIDEO_MODE_NTSC;
3711 else if (*std == V4L2_STD_SECAM) 3711 else if ((*std & V4L2_STD_SECAM) && !(*std & ~V4L2_STD_SECAM))
3712 norm = VIDEO_MODE_SECAM; 3712 norm = VIDEO_MODE_SECAM;
3713 else if (*std == V4L2_STD_ALL) 3713 else if (*std == V4L2_STD_ALL)
3714 norm = VIDEO_MODE_AUTO; 3714 norm = VIDEO_MODE_AUTO;