diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 3dbc074fb515..24a48f8a48c1 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -34,6 +34,9 @@ | |||
34 | 34 | ||
35 | #include "cx88.h" | 35 | #include "cx88.h" |
36 | 36 | ||
37 | /* Include V4L1 specific functions. Should be removed soon */ | ||
38 | #include <linux/videodev.h> | ||
39 | |||
37 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 40 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
38 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 41 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
39 | MODULE_LICENSE("GPL"); | 42 | MODULE_LICENSE("GPL"); |
@@ -100,7 +103,7 @@ static struct cx88_tvnorm tvnorms[] = { | |||
100 | .id = V4L2_STD_PAL_I, | 103 | .id = V4L2_STD_PAL_I, |
101 | .cxiformat = VideoFormatPAL, | 104 | .cxiformat = VideoFormatPAL, |
102 | .cxoformat = 0x181f0008, | 105 | .cxoformat = 0x181f0008, |
103 | },{ | 106 | },{ |
104 | .name = "PAL-M", | 107 | .name = "PAL-M", |
105 | .id = V4L2_STD_PAL_M, | 108 | .id = V4L2_STD_PAL_M, |
106 | .cxiformat = VideoFormatPALM, | 109 | .cxiformat = VideoFormatPALM, |
@@ -470,7 +473,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
470 | struct list_head *item; | 473 | struct list_head *item; |
471 | 474 | ||
472 | if (!list_empty(&q->active)) { | 475 | if (!list_empty(&q->active)) { |
473 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); | 476 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); |
474 | dprintk(2,"restart_queue [%p/%d]: restart dma\n", | 477 | dprintk(2,"restart_queue [%p/%d]: restart dma\n", |
475 | buf, buf->vb.i); | 478 | buf, buf->vb.i); |
476 | start_video_dma(dev, q, buf); | 479 | start_video_dma(dev, q, buf); |
@@ -486,7 +489,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
486 | for (;;) { | 489 | for (;;) { |
487 | if (list_empty(&q->queued)) | 490 | if (list_empty(&q->queued)) |
488 | return 0; | 491 | return 0; |
489 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); | 492 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); |
490 | if (NULL == prev) { | 493 | if (NULL == prev) { |
491 | list_del(&buf->vb.queue); | 494 | list_del(&buf->vb.queue); |
492 | list_add_tail(&buf->vb.queue,&q->active); | 495 | list_add_tail(&buf->vb.queue,&q->active); |
@@ -783,11 +786,11 @@ static int video_open(struct inode *inode, struct file *file) | |||
783 | cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); | 786 | cx88_call_i2c_clients(core,AUDC_SET_RADIO,NULL); |
784 | } | 787 | } |
785 | 788 | ||
786 | return 0; | 789 | return 0; |
787 | } | 790 | } |
788 | 791 | ||
789 | static ssize_t | 792 | static ssize_t |
790 | video_read(struct file *file, char *data, size_t count, loff_t *ppos) | 793 | video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) |
791 | { | 794 | { |
792 | struct cx8800_fh *fh = file->private_data; | 795 | struct cx8800_fh *fh = file->private_data; |
793 | 796 | ||
@@ -922,7 +925,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
922 | { | 925 | { |
923 | /* struct cx88_core *core = dev->core; */ | 926 | /* struct cx88_core *core = dev->core; */ |
924 | struct cx88_ctrl *c = NULL; | 927 | struct cx88_ctrl *c = NULL; |
925 | u32 v_sat_value; | 928 | u32 v_sat_value; |
926 | u32 value; | 929 | u32 value; |
927 | int i; | 930 | int i; |
928 | 931 | ||
@@ -1187,7 +1190,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1187 | struct v4l2_format *f = arg; | 1190 | struct v4l2_format *f = arg; |
1188 | return cx8800_try_fmt(dev,fh,f); | 1191 | return cx8800_try_fmt(dev,fh,f); |
1189 | } | 1192 | } |
1190 | 1193 | #ifdef HAVE_V4L1 | |
1191 | /* --- streaming capture ------------------------------------- */ | 1194 | /* --- streaming capture ------------------------------------- */ |
1192 | case VIDIOCGMBUF: | 1195 | case VIDIOCGMBUF: |
1193 | { | 1196 | { |
@@ -1213,6 +1216,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1213 | } | 1216 | } |
1214 | return 0; | 1217 | return 0; |
1215 | } | 1218 | } |
1219 | #endif | ||
1216 | case VIDIOC_REQBUFS: | 1220 | case VIDIOC_REQBUFS: |
1217 | return videobuf_reqbufs(get_queue(fh), arg); | 1221 | return videobuf_reqbufs(get_queue(fh), arg); |
1218 | 1222 | ||
@@ -1244,7 +1248,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1244 | res_free(dev,fh,res); | 1248 | res_free(dev,fh,res); |
1245 | return 0; | 1249 | return 0; |
1246 | } | 1250 | } |
1247 | |||
1248 | default: | 1251 | default: |
1249 | return cx88_do_ioctl( inode, file, fh->radio, core, cmd, arg, video_do_ioctl ); | 1252 | return cx88_do_ioctl( inode, file, fh->radio, core, cmd, arg, video_do_ioctl ); |
1250 | } | 1253 | } |
@@ -1252,15 +1255,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file, | |||
1252 | } | 1255 | } |
1253 | 1256 | ||
1254 | int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, | 1257 | int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, |
1255 | struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl) | 1258 | struct cx88_core *core, unsigned int cmd, void *arg, v4l2_kioctl driver_ioctl) |
1256 | { | 1259 | { |
1257 | int err; | 1260 | int err; |
1258 | 1261 | ||
1262 | dprintk( 1, "CORE IOCTL: 0x%x\n", cmd ); | ||
1259 | if (video_debug > 1) | 1263 | if (video_debug > 1) |
1260 | cx88_print_ioctl(core->name,cmd); | 1264 | cx88_print_ioctl(core->name,cmd); |
1261 | printk( KERN_INFO "CORE IOCTL: 0x%x\n", cmd ); | ||
1262 | cx88_print_ioctl(core->name,cmd); | ||
1263 | dprintk( 1, "CORE IOCTL: 0x%x\n", cmd ); | ||
1264 | 1265 | ||
1265 | switch (cmd) { | 1266 | switch (cmd) { |
1266 | /* ---------- tv norms ---------- */ | 1267 | /* ---------- tv norms ---------- */ |
@@ -1401,7 +1402,7 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio, | |||
1401 | 1402 | ||
1402 | cx88_get_stereo(core ,t); | 1403 | cx88_get_stereo(core ,t); |
1403 | reg = cx_read(MO_DEVICE_STATUS); | 1404 | reg = cx_read(MO_DEVICE_STATUS); |
1404 | t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; | 1405 | t->signal = (reg & (1<<5)) ? 0xffff : 0x0000; |
1405 | return 0; | 1406 | return 0; |
1406 | } | 1407 | } |
1407 | case VIDIOC_S_TUNER: | 1408 | case VIDIOC_S_TUNER: |
@@ -1488,7 +1489,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1488 | struct v4l2_capability *cap = arg; | 1489 | struct v4l2_capability *cap = arg; |
1489 | 1490 | ||
1490 | memset(cap,0,sizeof(*cap)); | 1491 | memset(cap,0,sizeof(*cap)); |
1491 | strcpy(cap->driver, "cx8800"); | 1492 | strcpy(cap->driver, "cx8800"); |
1492 | strlcpy(cap->card, cx88_boards[core->board].name, | 1493 | strlcpy(cap->card, cx88_boards[core->board].name, |
1493 | sizeof(cap->card)); | 1494 | sizeof(cap->card)); |
1494 | sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); | 1495 | sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); |
@@ -1505,6 +1506,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1505 | 1506 | ||
1506 | memset(t,0,sizeof(*t)); | 1507 | memset(t,0,sizeof(*t)); |
1507 | strcpy(t->name, "Radio"); | 1508 | strcpy(t->name, "Radio"); |
1509 | t->type = V4L2_TUNER_RADIO; | ||
1508 | 1510 | ||
1509 | cx88_call_i2c_clients(core,VIDIOC_G_TUNER,t); | 1511 | cx88_call_i2c_clients(core,VIDIOC_G_TUNER,t); |
1510 | return 0; | 1512 | return 0; |
@@ -1539,6 +1541,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1539 | *id = 0; | 1541 | *id = 0; |
1540 | return 0; | 1542 | return 0; |
1541 | } | 1543 | } |
1544 | #ifdef HAVE_V4L1 | ||
1542 | case VIDIOCSTUNER: | 1545 | case VIDIOCSTUNER: |
1543 | { | 1546 | { |
1544 | struct video_tuner *v = arg; | 1547 | struct video_tuner *v = arg; |
@@ -1549,6 +1552,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file, | |||
1549 | cx88_call_i2c_clients(core,VIDIOCSTUNER,v); | 1552 | cx88_call_i2c_clients(core,VIDIOCSTUNER,v); |
1550 | return 0; | 1553 | return 0; |
1551 | } | 1554 | } |
1555 | #endif | ||
1552 | case VIDIOC_S_TUNER: | 1556 | case VIDIOC_S_TUNER: |
1553 | { | 1557 | { |
1554 | struct v4l2_tuner *t = arg; | 1558 | struct v4l2_tuner *t = arg; |
@@ -1829,8 +1833,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
1829 | 1833 | ||
1830 | /* print pci info */ | 1834 | /* print pci info */ |
1831 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); | 1835 | pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); |
1832 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); | 1836 | pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); |
1833 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " | 1837 | printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " |
1834 | "latency: %d, mmio: 0x%lx\n", core->name, | 1838 | "latency: %d, mmio: 0x%lx\n", core->name, |
1835 | pci_name(pci_dev), dev->pci_rev, pci_dev->irq, | 1839 | pci_name(pci_dev), dev->pci_rev, pci_dev->irq, |
1836 | dev->pci_lat,pci_resource_start(pci_dev,0)); | 1840 | dev->pci_lat,pci_resource_start(pci_dev,0)); |
@@ -1946,7 +1950,7 @@ fail_free: | |||
1946 | 1950 | ||
1947 | static void __devexit cx8800_finidev(struct pci_dev *pci_dev) | 1951 | static void __devexit cx8800_finidev(struct pci_dev *pci_dev) |
1948 | { | 1952 | { |
1949 | struct cx8800_dev *dev = pci_get_drvdata(pci_dev); | 1953 | struct cx8800_dev *dev = pci_get_drvdata(pci_dev); |
1950 | struct cx88_core *core = dev->core; | 1954 | struct cx88_core *core = dev->core; |
1951 | 1955 | ||
1952 | /* stop thread */ | 1956 | /* stop thread */ |