Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / drivers / media / video / cx88 / cx88-video.c
index 48c450f..0fab65c 100644 (file)
@@ -426,12 +426,13 @@ int cx88_video_mux(struct cx88_core *core, unsigned int input)
                if (core->board.audio_chip &&
                    core->board.audio_chip == V4L2_IDENT_WM8775) {
                        call_all(core, audio, s_routing,
-                                       INPUT(input).audioroute, 0, 0);
+                                INPUT(input).audioroute, 0, 0);
                }
                /* cx2388's C-ADC is connected to the tuner only.
                   When used with S-Video, that ADC is busy dealing with
                   chroma, so an external must be used for baseband audio */
-               if (INPUT(input).type != CX88_VMUX_TELEVISION ) {
+               if (INPUT(input).type != CX88_VMUX_TELEVISION &&
+                   INPUT(input).type != CX88_VMUX_CABLE) {
                        /* "I2S ADC mode" */
                        core->tvaudio = WW_I2SADC;
                        cx88_set_tvaudio(core);
@@ -561,8 +562,8 @@ buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
        *size = fh->fmt->depth*fh->width*fh->height >> 3;
        if (0 == *count)
                *count = 32;
-       while (*size * *count > vid_limit * 1024 * 1024)
-               (*count)--;
+       if (*size * *count > vid_limit * 1024 * 1024)
+               *count = (vid_limit * 1024 * 1024) / *size;
        return 0;
 }
 
@@ -1537,9 +1538,12 @@ static int radio_queryctrl (struct file *file, void *priv,
                c->id >= V4L2_CID_LASTP1)
                return -EINVAL;
        if (c->id == V4L2_CID_AUDIO_MUTE) {
-               for (i = 0; i < CX8800_CTLS; i++)
+               for (i = 0; i < CX8800_CTLS; i++) {
                        if (cx8800_ctls[i].v.id == c->id)
                                break;
+               }
+               if (i == CX8800_CTLS)
+                       return -EINVAL;
                *c = cx8800_ctls[i].v;
        } else
                *c = no_ctl;
@@ -1977,7 +1981,7 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
        }
 
        if (core->ir)
-               cx88_ir_stop(core, core->ir);
+               cx88_ir_stop(core);
 
        cx88_shutdown(core); /* FIXME */
        pci_disable_device(pci_dev);
@@ -2015,7 +2019,7 @@ static int cx8800_suspend(struct pci_dev *pci_dev, pm_message_t state)
        spin_unlock(&dev->slock);
 
        if (core->ir)
-               cx88_ir_stop(core, core->ir);
+               cx88_ir_stop(core);
        /* FIXME -- shutdown device */
        cx88_shutdown(core);
 
@@ -2056,7 +2060,7 @@ static int cx8800_resume(struct pci_dev *pci_dev)
        /* FIXME: re-initialize hardware */
        cx88_reset(core);
        if (core->ir)
-               cx88_ir_start(core, core->ir);
+               cx88_ir_start(core);
 
        cx_set(MO_PCI_INTMSK, core->pci_irqmask);