]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cx88/cx88-video.c
V4L/DVB (5975): cx88: Wrong values used for HD-3000 radio mode
[linux-2.6-omap-h63xx.git] / drivers / media / video / cx88 / cx88-video.c
index a97be1bdc31d97d7acfd812eb2ef7db883a24ad5..41b5cb63fd2d66658b2974a97359d0f057da1d7d 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  *
  * device driver for Conexant 2388x based TV cards
@@ -34,6 +33,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <asm/div64.h>
@@ -1389,7 +1389,7 @@ static int vidioc_g_register (struct file *file, void *fh,
 {
        struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
 
-       if (reg->i2c_id != 0)
+       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
                return -EINVAL;
        /* cx2388x has a 24-bit register space */
        reg->val = cx_read(reg->reg&0xffffff);
@@ -1401,7 +1401,7 @@ static int vidioc_s_register (struct file *file, void *fh,
 {
        struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
 
-       if (reg->i2c_id != 0)
+       if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
                return -EINVAL;
        cx_write(reg->reg&0xffffff, reg->val);
        return 0;
@@ -1555,7 +1555,8 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
        cx_write(MO_VID_INTSTAT, status);
        if (irq_debug  ||  (status & mask & ~0xff))
                cx88_print_irqbits(core->name, "irq vid",
-                                  cx88_vid_irqs, status, mask);
+                                  cx88_vid_irqs, ARRAY_SIZE(cx88_vid_irqs),
+                                  status, mask);
 
        /* risc op code error */
        if (status & (1 << 16)) {
@@ -1778,7 +1779,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
               dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
 
        pci_set_master(pci_dev);
-       if (!pci_dma_supported(pci_dev,0xffffffff)) {
+       if (!pci_dma_supported(pci_dev,DMA_32BIT_MASK)) {
                printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
                err = -EIO;
                goto fail_core;
@@ -1879,8 +1880,14 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
        mutex_unlock(&core->lock);
 
        /* start tvaudio thread */
-       if (core->tuner_type != TUNER_ABSENT)
+       if (core->tuner_type != TUNER_ABSENT) {
                core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");
+               if (IS_ERR(core->kthread)) {
+                       err = PTR_ERR(core->kthread);
+                       printk(KERN_ERR "Failed to create cx88 audio thread, err=%d\n",
+                              err);
+               }
+       }
        return 0;
 
 fail_unreg: