diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-06-24 01:05:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:39 -0400 |
commit | ac19ecc6fa57b0ea320f01831175ff163f47d6a2 (patch) | |
tree | e57248fd223eddb98a43eed6abbac704863a0abd /drivers/media/video/saa7134/saa7134-video.c | |
parent | 56fc08ca375491b965cb76fad65bfb98973e80d8 (diff) |
[PATCH] v4l: update for SAA7134 cards
This patch adds support for various SAA7134 cards and brings some fixes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Fabrice Aeschbacher <fabrice.aeschbacher@laposte.net>
Signed-off-by: Hermann Pitton <hermann.pitton@onlinehome.de>.
Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 61 |
1 files changed, 22 insertions, 39 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 72f86736a795..c0a2ee520531 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: saa7134-video.c,v 1.28 2005/02/15 15:59:35 kraxel Exp $ | 2 | * $Id: saa7134-video.c,v 1.30 2005/06/07 19:00:38 nsh Exp $ |
3 | * | 3 | * |
4 | * device driver for philips saa7134 based TV cards | 4 | * device driver for philips saa7134 based TV cards |
5 | * video4linux video interface | 5 | * video4linux video interface |
@@ -31,8 +31,6 @@ | |||
31 | #include "saa7134-reg.h" | 31 | #include "saa7134-reg.h" |
32 | #include "saa7134.h" | 32 | #include "saa7134.h" |
33 | 33 | ||
34 | #define V4L2_I2C_CLIENTS 1 | ||
35 | |||
36 | /* ------------------------------------------------------------------ */ | 34 | /* ------------------------------------------------------------------ */ |
37 | 35 | ||
38 | static unsigned int video_debug = 0; | 36 | static unsigned int video_debug = 0; |
@@ -276,12 +274,12 @@ static struct saa7134_tvnorm tvnorms[] = { | |||
276 | 274 | ||
277 | .h_start = 0, | 275 | .h_start = 0, |
278 | .h_stop = 719, | 276 | .h_stop = 719, |
279 | .video_v_start = 23, | 277 | .video_v_start = 23, |
280 | .video_v_stop = 262, | 278 | .video_v_stop = 262, |
281 | .vbi_v_start_0 = 10, | 279 | .vbi_v_start_0 = 10, |
282 | .vbi_v_stop_0 = 21, | 280 | .vbi_v_stop_0 = 21, |
283 | .vbi_v_start_1 = 273, | 281 | .vbi_v_start_1 = 273, |
284 | .src_timing = 7, | 282 | .src_timing = 7, |
285 | 283 | ||
286 | .sync_control = 0x18, | 284 | .sync_control = 0x18, |
287 | .luma_control = 0x40, | 285 | .luma_control = 0x40, |
@@ -524,22 +522,7 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) | |||
524 | saa_writeb(SAA7134_RAW_DATA_GAIN, 0x40); | 522 | saa_writeb(SAA7134_RAW_DATA_GAIN, 0x40); |
525 | saa_writeb(SAA7134_RAW_DATA_OFFSET, 0x80); | 523 | saa_writeb(SAA7134_RAW_DATA_OFFSET, 0x80); |
526 | 524 | ||
527 | #ifdef V4L2_I2C_CLIENTS | ||
528 | saa7134_i2c_call_clients(dev,VIDIOC_S_STD,&norm->id); | 525 | saa7134_i2c_call_clients(dev,VIDIOC_S_STD,&norm->id); |
529 | #else | ||
530 | { | ||
531 | /* pass down info to the i2c chips (v4l1) */ | ||
532 | struct video_channel c; | ||
533 | memset(&c,0,sizeof(c)); | ||
534 | c.channel = dev->ctl_input; | ||
535 | c.norm = VIDEO_MODE_PAL; | ||
536 | if (norm->id & V4L2_STD_NTSC) | ||
537 | c.norm = VIDEO_MODE_NTSC; | ||
538 | if (norm->id & V4L2_STD_SECAM) | ||
539 | c.norm = VIDEO_MODE_SECAM; | ||
540 | saa7134_i2c_call_clients(dev,VIDIOCSCHAN,&c); | ||
541 | } | ||
542 | #endif | ||
543 | } | 526 | } |
544 | 527 | ||
545 | static void video_mux(struct saa7134_dev *dev, int input) | 528 | static void video_mux(struct saa7134_dev *dev, int input) |
@@ -1883,11 +1866,9 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1883 | return -EINVAL; | 1866 | return -EINVAL; |
1884 | down(&dev->lock); | 1867 | down(&dev->lock); |
1885 | dev->ctl_freq = f->frequency; | 1868 | dev->ctl_freq = f->frequency; |
1886 | #ifdef V4L2_I2C_CLIENTS | 1869 | |
1887 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,f); | 1870 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,f); |
1888 | #else | 1871 | |
1889 | saa7134_i2c_call_clients(dev,VIDIOCSFREQ,&dev->ctl_freq); | ||
1890 | #endif | ||
1891 | saa7134_tvaudio_do_scan(dev); | 1872 | saa7134_tvaudio_do_scan(dev); |
1892 | up(&dev->lock); | 1873 | up(&dev->lock); |
1893 | return 0; | 1874 | return 0; |
@@ -2142,16 +2123,19 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
2142 | t->rangelow = (int)(65*16); | 2123 | t->rangelow = (int)(65*16); |
2143 | t->rangehigh = (int)(108*16); | 2124 | t->rangehigh = (int)(108*16); |
2144 | 2125 | ||
2145 | #ifdef V4L2_I2C_CLIENTS | 2126 | saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t); |
2146 | saa7134_i2c_call_clients(dev,VIDIOC_G_TUNER,t); | 2127 | |
2147 | #else | 2128 | return 0; |
2148 | { | 2129 | } |
2149 | struct video_tuner vt; | 2130 | case VIDIOC_S_TUNER: |
2150 | memset(&vt,0,sizeof(vt)); | 2131 | { |
2151 | saa7134_i2c_call_clients(dev,VIDIOCGTUNER,&vt); | 2132 | struct v4l2_tuner *t = arg; |
2152 | t->signal = vt.signal; | 2133 | |
2153 | } | 2134 | if (0 != t->index) |
2154 | #endif | 2135 | return -EINVAL; |
2136 | |||
2137 | saa7134_i2c_call_clients(dev,VIDIOC_S_TUNER,t); | ||
2138 | |||
2155 | return 0; | 2139 | return 0; |
2156 | } | 2140 | } |
2157 | case VIDIOC_ENUMINPUT: | 2141 | case VIDIOC_ENUMINPUT: |
@@ -2185,7 +2169,6 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
2185 | return 0; | 2169 | return 0; |
2186 | } | 2170 | } |
2187 | case VIDIOC_S_AUDIO: | 2171 | case VIDIOC_S_AUDIO: |
2188 | case VIDIOC_S_TUNER: | ||
2189 | case VIDIOC_S_INPUT: | 2172 | case VIDIOC_S_INPUT: |
2190 | case VIDIOC_S_STD: | 2173 | case VIDIOC_S_STD: |
2191 | return 0; | 2174 | return 0; |