aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-09-09 16:03:39 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:49 -0400
commit24a70fdce872d70171b1f49dcd1a7c3a4e8396b2 (patch)
treeb640622565ce6a49befd142ca6770d20caafea82 /drivers/media/video/bttv-driver.c
parent793cf9e6a54c698e109a599c8b8e303658fcaae6 (diff)
[PATCH] v4l: BTTV updates and card additions
- Remove $Id CVS logs for V4L files - Added DVICO FusionHDTV 5 Lite card. - Added Acorp Y878F. - CodingStyle fixes. - Added tuner_addr to bttv cards structure. - linux/version.h replaced by linux/utsname.h on bttvp.h - kernel module for acquiring RDS data from a SAA6588. - Allow multiple open() and reading calls to /dev/radio on bttv-driver.c - added i2c address for lgdt330x. Signed-off-by: Hans J. Koch <koch@hjk-az.de> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/bttv-driver.c')
-rw-r--r--drivers/media/video/bttv-driver.c48
1 files changed, 40 insertions, 8 deletions
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 087efb4dea09..53ecdbf46222 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -1,5 +1,4 @@
1/* 1/*
2 $Id: bttv-driver.c,v 1.52 2005/08/04 00:55:16 mchehab Exp $
3 2
4 bttv - Bt848 frame grabber driver 3 bttv - Bt848 frame grabber driver
5 4
@@ -42,6 +41,9 @@
42 41
43#include "bttvp.h" 42#include "bttvp.h"
44 43
44#include "rds.h"
45
46
45unsigned int bttv_num; /* number of Bt848s in use */ 47unsigned int bttv_num; /* number of Bt848s in use */
46struct bttv bttvs[BTTV_MAX]; 48struct bttv bttvs[BTTV_MAX];
47 49
@@ -3128,15 +3130,12 @@ static int radio_open(struct inode *inode, struct file *file)
3128 3130
3129 dprintk("bttv%d: open called (radio)\n",btv->c.nr); 3131 dprintk("bttv%d: open called (radio)\n",btv->c.nr);
3130 down(&btv->lock); 3132 down(&btv->lock);
3131 if (btv->radio_user) { 3133
3132 up(&btv->lock);
3133 return -EBUSY;
3134 }
3135 btv->radio_user++; 3134 btv->radio_user++;
3135
3136 file->private_data = btv; 3136 file->private_data = btv;
3137 3137
3138 i2c_vidiocschan(btv); 3138 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type);
3139 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type);
3140 audio_mux(btv,AUDIO_RADIO); 3139 audio_mux(btv,AUDIO_RADIO);
3141 3140
3142 up(&btv->lock); 3141 up(&btv->lock);
@@ -3145,9 +3144,13 @@ static int radio_open(struct inode *inode, struct file *file)
3145 3144
3146static int radio_release(struct inode *inode, struct file *file) 3145static int radio_release(struct inode *inode, struct file *file)
3147{ 3146{
3148 struct bttv *btv = file->private_data; 3147 struct bttv *btv = file->private_data;
3148 struct rds_command cmd;
3149 3149
3150 btv->radio_user--; 3150 btv->radio_user--;
3151
3152 bttv_call_i2c_clients(btv, RDS_CMD_CLOSE, &cmd);
3153
3151 return 0; 3154 return 0;
3152} 3155}
3153 3156
@@ -3203,13 +3206,42 @@ static int radio_ioctl(struct inode *inode, struct file *file,
3203 return video_usercopy(inode, file, cmd, arg, radio_do_ioctl); 3206 return video_usercopy(inode, file, cmd, arg, radio_do_ioctl);
3204} 3207}
3205 3208
3209static ssize_t radio_read(struct file *file, char __user *data,
3210 size_t count, loff_t *ppos)
3211{
3212 struct bttv *btv = file->private_data;
3213 struct rds_command cmd;
3214 cmd.block_count = count/3;
3215 cmd.buffer = data;
3216 cmd.instance = file;
3217 cmd.result = -ENODEV;
3218
3219 bttv_call_i2c_clients(btv, RDS_CMD_READ, &cmd);
3220
3221 return cmd.result;
3222}
3223
3224static unsigned int radio_poll(struct file *file, poll_table *wait)
3225{
3226 struct bttv *btv = file->private_data;
3227 struct rds_command cmd;
3228 cmd.instance = file;
3229 cmd.event_list = wait;
3230 cmd.result = -ENODEV;
3231 bttv_call_i2c_clients(btv, RDS_CMD_POLL, &cmd);
3232
3233 return cmd.result;
3234}
3235
3206static struct file_operations radio_fops = 3236static struct file_operations radio_fops =
3207{ 3237{
3208 .owner = THIS_MODULE, 3238 .owner = THIS_MODULE,
3209 .open = radio_open, 3239 .open = radio_open,
3240 .read = radio_read,
3210 .release = radio_release, 3241 .release = radio_release,
3211 .ioctl = radio_ioctl, 3242 .ioctl = radio_ioctl,
3212 .llseek = no_llseek, 3243 .llseek = no_llseek,
3244 .poll = radio_poll,
3213}; 3245};
3214 3246
3215static struct video_device radio_template = 3247static struct video_device radio_template =