]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cx88/cx88-mpeg.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[linux-2.6] / drivers / media / video / cx88 / cx88-mpeg.c
index 5da47e251e663f26762728f2051e77070ea31190..a652f294d23d8dd8e6a135eab458395ddb8928f6 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
@@ -148,7 +147,7 @@ static int cx8802_start_dma(struct cx8802_dev    *dev,
 
        /* enable irqs */
        dprintk( 1, "setting the interrupt mask\n" );
-       cx_set(MO_PCI_INTMSK, core->pci_irqmask | 0x04);
+       cx_set(MO_PCI_INTMSK, core->pci_irqmask | PCI_INT_TSINT);
        cx_set(MO_TS_INTMSK,  0x1f0011);
 
        /* start dma */
@@ -166,7 +165,7 @@ static int cx8802_stop_dma(struct cx8802_dev *dev)
        cx_clear(MO_TS_DMACNTRL, 0x11);
 
        /* disable irqs */
-       cx_clear(MO_PCI_INTMSK, 0x000004);
+       cx_clear(MO_PCI_INTMSK, PCI_INT_TSINT);
        cx_clear(MO_TS_INTMSK, 0x1f0011);
 
        /* Reset the controller */
@@ -180,43 +179,43 @@ static int cx8802_restart_queue(struct cx8802_dev    *dev,
        struct cx88_buffer *buf;
        struct list_head *item;
 
-       dprintk( 1, "cx8802_restart_queue\n" );
+       dprintk( 1, "cx8802_restart_queue\n" );
        if (list_empty(&q->active))
        {
-              struct cx88_buffer *prev;
-              prev = NULL;
-
-              dprintk(1, "cx8802_restart_queue: queue is empty\n" );
-
-              for (;;) {
-                      if (list_empty(&q->queued))
-                              return 0;
-                      buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
-                      if (NULL == prev) {
-                              list_del(&buf->vb.queue);
-                              list_add_tail(&buf->vb.queue,&q->active);
-                              cx8802_start_dma(dev, q, buf);
-                              buf->vb.state = STATE_ACTIVE;
-                              buf->count    = q->count++;
-                              mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
-                              dprintk(1,"[%p/%d] restart_queue - first active\n",
-                                      buf,buf->vb.i);
-
-                      } else if (prev->vb.width  == buf->vb.width  &&
-                                 prev->vb.height == buf->vb.height &&
-                                 prev->fmt       == buf->fmt) {
-                              list_del(&buf->vb.queue);
-                              list_add_tail(&buf->vb.queue,&q->active);
-                              buf->vb.state = STATE_ACTIVE;
-                              buf->count    = q->count++;
-                              prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
-                              dprintk(1,"[%p/%d] restart_queue - move to active\n",
-                                      buf,buf->vb.i);
-                      } else {
-                              return 0;
-                      }
-                      prev = buf;
-              }
+               struct cx88_buffer *prev;
+               prev = NULL;
+
+               dprintk(1, "cx8802_restart_queue: queue is empty\n" );
+
+               for (;;) {
+                       if (list_empty(&q->queued))
+                               return 0;
+                       buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
+                       if (NULL == prev) {
+                               list_del(&buf->vb.queue);
+                               list_add_tail(&buf->vb.queue,&q->active);
+                               cx8802_start_dma(dev, q, buf);
+                               buf->vb.state = STATE_ACTIVE;
+                               buf->count    = q->count++;
+                               mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
+                               dprintk(1,"[%p/%d] restart_queue - first active\n",
+                                       buf,buf->vb.i);
+
+                       } else if (prev->vb.width  == buf->vb.width  &&
+                                  prev->vb.height == buf->vb.height &&
+                                  prev->fmt       == buf->fmt) {
+                               list_del(&buf->vb.queue);
+                               list_add_tail(&buf->vb.queue,&q->active);
+                               buf->vb.state = STATE_ACTIVE;
+                               buf->count    = q->count++;
+                               prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
+                               dprintk(1,"[%p/%d] restart_queue - move to active\n",
+                                       buf,buf->vb.i);
+                       } else {
+                               return 0;
+                       }
+                       prev = buf;
+               }
                return 0;
        }
 
@@ -238,6 +237,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
                        struct cx88_buffer *buf, enum v4l2_field field)
 {
        int size = dev->ts_packet_size * dev->ts_packet_count;
+       struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
        int rc;
 
        dprintk(1, "%s: %p\n", __FUNCTION__, buf);
@@ -253,8 +253,8 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
                if (0 != (rc = videobuf_iolock(q,&buf->vb,NULL)))
                        goto fail;
                cx88_risc_databuffer(dev->pci, &buf->risc,
-                                    buf->vb.dma.sglist,
-                                    buf->vb.width, buf->vb.height);
+                                    dma->sglist,
+                                    buf->vb.width, buf->vb.height, 0);
        }
        buf->vb.state = STATE_PREPARED;
        return 0;
@@ -413,7 +413,8 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id)
        int loop, handled = 0;
 
        for (loop = 0; loop < MAX_IRQ_LOOP; loop++) {
-               status = cx_read(MO_PCI_INTSTAT) & (core->pci_irqmask | 0x04);
+               status = cx_read(MO_PCI_INTSTAT) &
+                       (core->pci_irqmask | PCI_INT_TSINT);
                if (0 == status)
                        goto out;
                dprintk( 1, "cx8802_irq\n" );
@@ -424,7 +425,7 @@ static irqreturn_t cx8802_irq(int irq, void *dev_id)
 
                if (status & core->pci_irqmask)
                        cx88_core_irq(core,status);
-               if (status & 0x04)
+               if (status & PCI_INT_TSINT)
                        cx8802_mpeg_irq(dev);
        };
        if (MAX_IRQ_LOOP == loop) {