13 #include <linux/module.h>
14 #include <linux/slab.h>
35 static void vb2_dma_contig_put(
void *buf_priv);
37 static void *vb2_dma_contig_alloc(
void *alloc_ctx,
unsigned long size)
49 dev_err(conf->
dev,
"dma_alloc_coherent of size %ld failed\n",
59 buf->
handler.put = vb2_dma_contig_put;
67 static void vb2_dma_contig_put(
void *buf_priv)
78 static void *vb2_dma_contig_cookie(
void *buf_priv)
85 static void *vb2_dma_contig_vaddr(
void *buf_priv)
94 static unsigned int vb2_dma_contig_num_users(
void *buf_priv)
114 static void *vb2_dma_contig_get_userptr(
void *alloc_ctx,
unsigned long vaddr,
115 unsigned long size,
int write)
141 static void vb2_dma_contig_put_userptr(
void *mem_priv)
153 .alloc = vb2_dma_contig_alloc,
154 .put = vb2_dma_contig_put,
155 .cookie = vb2_dma_contig_cookie,
156 .vaddr = vb2_dma_contig_vaddr,
157 .mmap = vb2_dma_contig_mmap,
158 .get_userptr = vb2_dma_contig_get_userptr,
159 .put_userptr = vb2_dma_contig_put_userptr,
160 .num_users = vb2_dma_contig_num_users,