diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 2c171af9a9f2..557530aef946 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -43,12 +43,16 @@ static unsigned int gbuffers = 8; | |||
43 | static unsigned int noninterlaced = 1; | 43 | static unsigned int noninterlaced = 1; |
44 | static unsigned int gbufsize = 720*576*4; | 44 | static unsigned int gbufsize = 720*576*4; |
45 | static unsigned int gbufsize_max = 720*576*4; | 45 | static unsigned int gbufsize_max = 720*576*4; |
46 | static char secam[] = "--"; | ||
46 | module_param(video_debug, int, 0644); | 47 | module_param(video_debug, int, 0644); |
47 | MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); | 48 | MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); |
48 | module_param(gbuffers, int, 0444); | 49 | module_param(gbuffers, int, 0444); |
49 | MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); | 50 | MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32"); |
50 | module_param(noninterlaced, int, 0644); | 51 | module_param(noninterlaced, int, 0644); |
51 | MODULE_PARM_DESC(noninterlaced,"capture non interlaced video"); | 52 | MODULE_PARM_DESC(noninterlaced,"capture non interlaced video"); |
53 | module_param_string(secam, secam, sizeof(secam), 0644); | ||
54 | MODULE_PARM_DESC(secam, "force SECAM variant, either DK,L or Lc"); | ||
55 | |||
52 | 56 | ||
53 | #define dprintk(fmt, arg...) if (video_debug) \ | 57 | #define dprintk(fmt, arg...) if (video_debug) \ |
54 | printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) | 58 | printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg) |
@@ -279,7 +283,43 @@ static struct saa7134_tvnorm tvnorms[] = { | |||
279 | .id = V4L2_STD_SECAM, | 283 | .id = V4L2_STD_SECAM, |
280 | NORM_625_50, | 284 | NORM_625_50, |
281 | 285 | ||
282 | .sync_control = 0x18, /* old: 0x58, */ | 286 | .sync_control = 0x18, |
287 | .luma_control = 0x1b, | ||
288 | .chroma_ctrl1 = 0xd1, | ||
289 | .chroma_gain = 0x80, | ||
290 | .chroma_ctrl2 = 0x00, | ||
291 | .vgate_misc = 0x1c, | ||
292 | |||
293 | },{ | ||
294 | .name = "SECAM-DK", | ||
295 | .id = V4L2_STD_SECAM_DK, | ||
296 | NORM_625_50, | ||
297 | |||
298 | .sync_control = 0x18, | ||
299 | .luma_control = 0x1b, | ||
300 | .chroma_ctrl1 = 0xd1, | ||
301 | .chroma_gain = 0x80, | ||
302 | .chroma_ctrl2 = 0x00, | ||
303 | .vgate_misc = 0x1c, | ||
304 | |||
305 | },{ | ||
306 | .name = "SECAM-L", | ||
307 | .id = V4L2_STD_SECAM_L, | ||
308 | NORM_625_50, | ||
309 | |||
310 | .sync_control = 0x18, | ||
311 | .luma_control = 0x1b, | ||
312 | .chroma_ctrl1 = 0xd1, | ||
313 | .chroma_gain = 0x80, | ||
314 | .chroma_ctrl2 = 0x00, | ||
315 | .vgate_misc = 0x1c, | ||
316 | |||
317 | },{ | ||
318 | .name = "SECAM-Lc", | ||
319 | .id = V4L2_STD_SECAM_LC, | ||
320 | NORM_625_50, | ||
321 | |||
322 | .sync_control = 0x18, | ||
283 | .luma_control = 0x1b, | 323 | .luma_control = 0x1b, |
284 | .chroma_ctrl1 = 0xd1, | 324 | .chroma_ctrl1 = 0xd1, |
285 | .chroma_gain = 0x80, | 325 | .chroma_gain = 0x80, |
@@ -1769,6 +1809,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1769 | { | 1809 | { |
1770 | v4l2_std_id *id = arg; | 1810 | v4l2_std_id *id = arg; |
1771 | unsigned int i; | 1811 | unsigned int i; |
1812 | v4l2_std_id fixup; | ||
1772 | 1813 | ||
1773 | for (i = 0; i < TVNORMS; i++) | 1814 | for (i = 0; i < TVNORMS; i++) |
1774 | if (*id == tvnorms[i].id) | 1815 | if (*id == tvnorms[i].id) |
@@ -1779,7 +1820,19 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1779 | break; | 1820 | break; |
1780 | if (i == TVNORMS) | 1821 | if (i == TVNORMS) |
1781 | return -EINVAL; | 1822 | return -EINVAL; |
1782 | 1823 | if (*id & V4L2_STD_SECAM) { | |
1824 | if (secam[0] == 'L' || secam[0] == 'l') | ||
1825 | if (secam[1] == 'C' || secam[1] == 'c') | ||
1826 | fixup = V4L2_STD_SECAM_LC; | ||
1827 | else | ||
1828 | fixup = V4L2_STD_SECAM_L; | ||
1829 | else | ||
1830 | if (secam[0] == 'D' || secam[0] == 'd') | ||
1831 | fixup = V4L2_STD_SECAM_DK; | ||
1832 | for (i = 0; i < TVNORMS; i++) | ||
1833 | if (fixup == tvnorms[i].id) | ||
1834 | break; | ||
1835 | } | ||
1783 | mutex_lock(&dev->lock); | 1836 | mutex_lock(&dev->lock); |
1784 | if (res_check(fh, RESOURCE_OVERLAY)) { | 1837 | if (res_check(fh, RESOURCE_OVERLAY)) { |
1785 | spin_lock_irqsave(&dev->slock,flags); | 1838 | spin_lock_irqsave(&dev->slock,flags); |