diff options
author | Xiaowen Liu <xiaowen.liu@freescale.com> | 2015-11-19 11:08:24 -0500 |
---|---|---|
committer | Xiaowen Liu <xiaowen.liu@freescale.com> | 2015-11-20 10:08:31 -0500 |
commit | 247271e59c76fe57d70f00f926f0d2e7c77567b8 (patch) | |
tree | bda232053ee753f92dd1d8ecd14da9b9c935d5f7 | |
parent | 7ca93a9d192bd31b03d55abcdeb03631c137a1bf (diff) | |
download | freescale-247271e59c76fe57d70f00f926f0d2e7c77567b8.tar.gz |
MA-7121 enable camera hal v3 interface.
Add vmap and vunmap interface for ION module.
Because they are called by UVC driver.
Signed-off-by: Xiaowen Liu <xiaowen.liu@freescale.com>
-rw-r--r-- | drivers/staging/android/ion/ion.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 218a02c3822..78f6f09e604 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1088,6 +1088,22 @@ static void ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf, size_t start, mutex_unlock(&buffer->lock); } +static void* ion_dma_buf_vmap(struct dma_buf *dmabuf) +{ + struct ion_buffer *buffer = dmabuf->priv; + + if (ion_dma_buf_begin_cpu_access(dmabuf, 0, 0, DMA_NONE) != 0) { + return NULL; + } + + return buffer->vaddr; +} + +static void ion_dma_buf_vunmap(struct dma_buf *dmabuf, void* vaddr) +{ + return ion_dma_buf_end_cpu_access(dmabuf, 0, 0, DMA_NONE); +} + static struct dma_buf_ops dma_buf_ops = { .map_dma_buf = ion_map_dma_buf, .unmap_dma_buf = ion_unmap_dma_buf, @@ -1099,6 +1115,8 @@ static struct dma_buf_ops dma_buf_ops = { .kunmap_atomic = ion_dma_buf_kunmap, .kmap = ion_dma_buf_kmap, .kunmap = ion_dma_buf_kunmap, + .vmap = ion_dma_buf_vmap, + .vunmap = ion_dma_buf_vunmap, }; struct dma_buf *ion_share_dma_buf(struct ion_client *client, |