aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-07-12 16:59:01 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-12 19:01:06 -0400
commit330a115ae46e7d7b5fe2d4e506ba8ae2e0027143 (patch)
tree0dbeceba9967097a3a38a5df97c37112b897b906 /drivers/media/video/saa7134/saa7134-video.c
parent85369df350b138f26eac779da33de0960635ca4d (diff)
[PATCH] v4l: SAA7134 Update
- Corrected all cards marked as 7135 cards to 7133. - Add new card support for Compro VideoMate TV Gold+II. - Add new card support for Kworld Xpert TV PVR7134 - Add new card support for Typhoon DVB-T Cardbus. - Changes to comply with CodingStyle: // comments converted to /* */ - Remove irq2_mask field from saa7134_dev structure. - Collect all the bits needed in saa7134_hwinit2() instead. - Distinguish the different variants of the Medion MD7134 modules via eeprom - moved Philips FMD1216 radio specific setup to saa7134-core.c - Fix kernel compile error with CONFIG_MODULES=n - Cleanup tuner private calls. - Some Indent fixes. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Hannibal <hannibal@megapolis.pl> Signed-off-by: Elshin Roman <roxmail@list.ru> Signed-off-by: Hermann Pitton <hermann.pitton@onlinehome.de> Signed-off-by: Juergen Orschiedt <jorschiedt@web.de> Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.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.c54
1 files changed, 37 insertions, 17 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index c0a2ee520531..a4c2f751d097 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.30 2005/06/07 19:00:38 nsh Exp $ 2 * $Id: saa7134-video.c,v 1.36 2005/06/28 23:41:47 mkrufky 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
@@ -274,7 +274,7 @@ static struct saa7134_tvnorm tvnorms[] = {
274 274
275 .h_start = 0, 275 .h_start = 0,
276 .h_stop = 719, 276 .h_stop = 719,
277 .video_v_start = 23, 277 .video_v_start = 23,
278 .video_v_stop = 262, 278 .video_v_stop = 262,
279 .vbi_v_start_0 = 10, 279 .vbi_v_start_0 = 10,
280 .vbi_v_stop_0 = 21, 280 .vbi_v_stop_0 = 21,
@@ -1204,7 +1204,6 @@ static int video_open(struct inode *inode, struct file *file)
1204 struct list_head *list; 1204 struct list_head *list;
1205 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1205 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1206 int radio = 0; 1206 int radio = 0;
1207
1208 list_for_each(list,&saa7134_devlist) { 1207 list_for_each(list,&saa7134_devlist) {
1209 h = list_entry(list, struct saa7134_dev, devlist); 1208 h = list_entry(list, struct saa7134_dev, devlist);
1210 if (h->video_dev && (h->video_dev->minor == minor)) 1209 if (h->video_dev && (h->video_dev->minor == minor))
@@ -1256,12 +1255,12 @@ static int video_open(struct inode *inode, struct file *file)
1256 if (fh->radio) { 1255 if (fh->radio) {
1257 /* switch to radio mode */ 1256 /* switch to radio mode */
1258 saa7134_tvaudio_setinput(dev,&card(dev).radio); 1257 saa7134_tvaudio_setinput(dev,&card(dev).radio);
1259 saa7134_i2c_call_clients(dev,AUDC_SET_RADIO,NULL); 1258 saa7134_i2c_call_clients(dev,AUDC_SET_RADIO, NULL);
1260 } else { 1259 } else {
1261 /* switch to video/vbi mode */ 1260 /* switch to video/vbi mode */
1262 video_mux(dev,dev->ctl_input); 1261 video_mux(dev,dev->ctl_input);
1263 } 1262 }
1264 return 0; 1263 return 0;
1265} 1264}
1266 1265
1267static ssize_t 1266static ssize_t
@@ -1304,10 +1303,10 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1304 } else { 1303 } else {
1305 down(&fh->cap.lock); 1304 down(&fh->cap.lock);
1306 if (UNSET == fh->cap.read_off) { 1305 if (UNSET == fh->cap.read_off) {
1307 /* need to capture a new frame */ 1306 /* need to capture a new frame */
1308 if (res_locked(fh->dev,RESOURCE_VIDEO)) { 1307 if (res_locked(fh->dev,RESOURCE_VIDEO)) {
1309 up(&fh->cap.lock); 1308 up(&fh->cap.lock);
1310 return POLLERR; 1309 return POLLERR;
1311 } 1310 }
1312 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { 1311 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) {
1313 up(&fh->cap.lock); 1312 up(&fh->cap.lock);
@@ -1363,6 +1362,36 @@ static int video_release(struct inode *inode, struct file *file)
1363 res_free(dev,fh,RESOURCE_VBI); 1362 res_free(dev,fh,RESOURCE_VBI);
1364 } 1363 }
1365 1364
1365 /* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/
1366 saa_andorb(SAA7134_OFMT_VIDEO_A, 0x1f, 0);
1367 saa_andorb(SAA7134_OFMT_VIDEO_B, 0x1f, 0);
1368 saa_andorb(SAA7134_OFMT_DATA_A, 0x1f, 0);
1369 saa_andorb(SAA7134_OFMT_DATA_B, 0x1f, 0);
1370
1371 if (dev->tuner_type == TUNER_PHILIPS_TDA8290) {
1372 u8 data[2];
1373 int ret;
1374 struct i2c_msg msg = {.addr=I2C_ADDR_TDA8290, .flags=0, .buf=data, .len = 2};
1375 data[0] = 0x21;
1376 data[1] = 0xc0;
1377 ret = i2c_transfer(&dev->i2c_adap, &msg, 1);
1378 if (ret != 1)
1379 printk(KERN_ERR "TDA8290 access failure\n");
1380 msg.addr = I2C_ADDR_TDA8275;
1381 data[0] = 0x30;
1382 data[1] = 0xd0;
1383 ret = i2c_transfer(&dev->i2c_adap, &msg, 1);
1384 if (ret != 1)
1385 printk(KERN_ERR "TDA8275 access failure\n");
1386 msg.addr = I2C_ADDR_TDA8290;
1387 data[0] = 0x21;
1388 data[1] = 0x80;
1389 i2c_transfer(&dev->i2c_adap, &msg, 1);
1390 data[0] = 0x00;
1391 data[1] = 0x02;
1392 i2c_transfer(&dev->i2c_adap, &msg, 1);
1393 }
1394
1366 /* free stuff */ 1395 /* free stuff */
1367 videobuf_mmap_free(&fh->cap); 1396 videobuf_mmap_free(&fh->cap);
1368 videobuf_mmap_free(&fh->vbi); 1397 videobuf_mmap_free(&fh->vbi);
@@ -1399,13 +1428,6 @@ static void saa7134_vbi_fmt(struct saa7134_dev *dev, struct v4l2_format *f)
1399 f->fmt.vbi.count[1] = f->fmt.vbi.count[0]; 1428 f->fmt.vbi.count[1] = f->fmt.vbi.count[0];
1400 f->fmt.vbi.flags = 0; /* VBI_UNSYNC VBI_INTERLACED */ 1429 f->fmt.vbi.flags = 0; /* VBI_UNSYNC VBI_INTERLACED */
1401 1430
1402#if 0
1403 if (V4L2_STD_PAL == norm->id) {
1404 /* FIXME */
1405 f->fmt.vbi.start[0] += 3;
1406 f->fmt.vbi.start[1] += 3*2;
1407 }
1408#endif
1409} 1431}
1410 1432
1411static int saa7134_g_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh, 1433static int saa7134_g_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh,
@@ -2120,8 +2142,6 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
2120 2142
2121 memset(t,0,sizeof(*t)); 2143 memset(t,0,sizeof(*t));
2122 strcpy(t->name, "Radio"); 2144 strcpy(t->name, "Radio");
2123 t->rangelow = (int)(65*16);
2124 t->rangehigh = (int)(108*16);
2125 2145
2126 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t); 2146 saa7134_i2c_call_clients(dev, VIDIOC_G_TUNER, t);
2127 2147