sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
[safe/jmp/linux-2.6] / include / media / videobuf-dma-sg.h
index 62a3709..dda47f0 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * helper functions for PCI DMA video4linux capture buffers
+ * helper functions for SG DMA video4linux capture buffers
  *
- * The functions expect the hardware being able to scatter gatter
+ * The functions expect the hardware being able to scatter gather
  * (i.e. the buffers are not linear in physical memory, but fragmented
  * into PAGE_SIZE chunks).  They also assume the driver does not need
  * to touch the video data.
@@ -49,7 +49,7 @@ struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages,
  *     does memory allocation too using vmalloc_32().
  *
  * videobuf_dma_*()
- *     see Documentation/DMA-mapping.txt, these functions to
+ *     see Documentation/PCI/PCI-DMA-mapping.txt, these functions to
  *     basically the same.  The map function does also build a
  *     scatterlist for the buffer (and unmap frees it ...)
  *
@@ -68,9 +68,6 @@ struct videobuf_dmabuf {
        /* for kernel buffers */
        void                *vmalloc;
 
-       /* Stores the userspace pointer to vmalloc area */
-       void                *varea;
-
        /* for overlay buffers (pci-pci dma) */
        dma_addr_t          bus_addr;
 
@@ -81,28 +78,14 @@ struct videobuf_dmabuf {
        int                 direction;
 };
 
-struct videbuf_pci_sg_memory
+struct videobuf_dma_sg_memory
 {
        u32                 magic;
 
        /* for mmap'ed buffers */
-       struct videobuf_mapping *map;
        struct videobuf_dmabuf  dma;
 };
 
-/* FIXME: To be removed soon */
-typedef int (vb_map_sg_t)(void *dev, struct scatterlist *sglist, int nr_pages,
-                                       int direction);
-
-/* FIXME: To be removed soon */
-struct videobuf_dma_sg_ops
-{
-       vb_map_sg_t     *vb_map_sg;
-       vb_map_sg_t     *vb_dma_sync_sg;
-       vb_map_sg_t     *vb_unmap_sg;
-
-};
-
 void videobuf_dma_init(struct videobuf_dmabuf *dma);
 int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction,
                           unsigned long data, unsigned long size);
@@ -117,11 +100,11 @@ int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
 int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma);
 struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf);
 
-void *videobuf_pci_alloc (size_t size);
+void *videobuf_sg_alloc(size_t size);
 
-void videobuf_queue_pci_init(struct videobuf_queue* q,
+void videobuf_queue_sg_init(struct videobuf_queue* q,
                         struct videobuf_queue_ops *ops,
-                        void *dev,
+                        struct device *dev,
                         spinlock_t *irqlock,
                         enum v4l2_buf_type type,
                         enum v4l2_field field,
@@ -131,12 +114,6 @@ void videobuf_queue_pci_init(struct videobuf_queue* q,
        /*FIXME: these variants are used only on *-alsa code, where videobuf is
         * used without queue
         */
-int videobuf_pci_dma_map(struct pci_dev *pci,struct videobuf_dmabuf *dma);
-int videobuf_pci_dma_unmap(struct pci_dev *pci,struct videobuf_dmabuf *dma);
-
-/* FIXME: temporary routine for vivi and tm6000, while lacking implementation
- * of videobuf-vmalloc
- */
-void videobuf_set_pci_ops (struct videobuf_queue* q,
-                               struct videobuf_dma_sg_ops *ops);
+int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma);
+int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma);