diff options
author | Hartmut Hackmann <devnull@localhost> | 2005-06-14 22:49:20 +0000 |
---|---|---|
committer | Hartmut Hackmann <devnull@localhost> | 2005-06-14 22:49:20 +0000 |
commit | c80dcdfa33625ec46035063101a1cd7d6bbb3ef1 (patch) | |
tree | c920739be562b370a98ee5eece51e0dfe77c68fb | |
parent | 5c8c87911e0e75e94aa09bcc71494ec6e1d9144e (diff) | |
download | mediapointer-dvb-s2-c80dcdfa33625ec46035063101a1cd7d6bbb3ef1.tar.gz mediapointer-dvb-s2-c80dcdfa33625ec46035063101a1cd7d6bbb3ef1.tar.bz2 |
- turn off planar mode at video release (would break DVB)
- put tda8290 and tda8275 to sleep at video release to save power
- special FM stereo configuration for FMD1216 tuner
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-video.c | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-video.c b/linux/drivers/media/video/saa7134/saa7134-video.c index d43b848bb..e03f80fa9 100644 --- a/linux/drivers/media/video/saa7134/saa7134-video.c +++ b/linux/drivers/media/video/saa7134/saa7134-video.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-video.c,v 1.30 2005/06/07 19:00:38 nsh Exp $ + * $Id: saa7134-video.c,v 1.31 2005/06/14 22:49:20 hhackmann Exp $ * * device driver for philips saa7134 based TV cards * video4linux video interface @@ -1205,7 +1205,6 @@ static int video_open(struct inode *inode, struct file *file) struct list_head *list; enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; int radio = 0; - list_for_each(list,&saa7134_devlist) { h = list_entry(list, struct saa7134_dev, devlist); if (h->video_dev && (h->video_dev->minor == minor)) @@ -1221,7 +1220,7 @@ static int video_open(struct inode *inode, struct file *file) } if (NULL == dev) return -ENODEV; - + dprintk("open minor=%d radio=%d type=%s\n",minor,radio, v4l2_type_names[type]); @@ -1257,12 +1256,14 @@ static int video_open(struct inode *inode, struct file *file) if (fh->radio) { /* switch to radio mode */ saa7134_tvaudio_setinput(dev,&card(dev).radio); - saa7134_i2c_call_clients(dev,AUDC_SET_RADIO,NULL); + if(dev->board == SAA7134_BOARD_MD7134) + saa7134_i2c_call_clients(dev,AUDC_CONFIG_PHILIPS_FMD, NULL); + saa7134_i2c_call_clients(dev,AUDC_SET_RADIO, NULL); } else { /* switch to video/vbi mode */ video_mux(dev,dev->ctl_input); } - return 0; + return 0; } static ssize_t @@ -1305,10 +1306,10 @@ video_poll(struct file *file, struct poll_table_struct *wait) } else { down(&fh->cap.lock); if (UNSET == fh->cap.read_off) { - /* need to capture a new frame */ + /* need to capture a new frame */ if (res_locked(fh->dev,RESOURCE_VIDEO)) { - up(&fh->cap.lock); - return POLLERR; + up(&fh->cap.lock); + return POLLERR; } if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,fh->cap.field)) { up(&fh->cap.lock); @@ -1364,6 +1365,36 @@ static int video_release(struct inode *inode, struct file *file) res_free(dev,fh,RESOURCE_VBI); } + /* ts-capture will not work in planar mode, so turn it off Hac: 04.05*/ + saa_andorb(SAA7134_OFMT_VIDEO_A, 0x1f, 0); + saa_andorb(SAA7134_OFMT_VIDEO_B, 0x1f, 0); + saa_andorb(SAA7134_OFMT_DATA_A, 0x1f, 0); + saa_andorb(SAA7134_OFMT_DATA_B, 0x1f, 0); + + if (dev->tuner_type == TUNER_PHILIPS_TDA8290) { + u8 data[2]; + int ret; + struct i2c_msg msg = {.addr=I2C_ADDR_TDA8290, .flags=0, .buf=data, .len = 2}; + data[0] = 0x21; + data[1] = 0xc0; + ret = i2c_transfer(&dev->i2c_adap, &msg, 1); + if (ret != 1) + printk(KERN_ERR "TDA8290 access failure\n"); + msg.addr = I2C_ADDR_TDA8275; + data[0] = 0x30; + data[1] = 0xc0; + ret = i2c_transfer(&dev->i2c_adap, &msg, 1); + if (ret != 1) + printk(KERN_ERR "TDA8274 access failure\n"); + msg.addr = I2C_ADDR_TDA8290; + data[0] = 0x21; + data[1] = 0x80; + i2c_transfer(&dev->i2c_adap, &msg, 1); + data[0] = 0x00; + data[1] = 0x02; + i2c_transfer(&dev->i2c_adap, &msg, 1); + } + /* free stuff */ videobuf_mmap_free(&fh->cap); videobuf_mmap_free(&fh->vbi); |