2 * Copyright (c) 2013-2015, 2017 The Linux Foundation. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #ifndef _LINUX_MSM_AUDIO_ION_H
15 #define _LINUX_MSM_AUDIO_ION_H
16 #include <sound/q6asm-v2.h>
17 #include <sound/pcm.h>
18 #include <linux/msm_ion.h>
25 #define VMID_CP_ADSP_SHARED 33
27 int msm_audio_ion_alloc(const char *name, struct ion_client **client,
28 struct ion_handle **handle, size_t bufsz,
29 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
31 int msm_audio_ion_import(const char *name, struct ion_client **client,
32 struct ion_handle **handle, int fd,
33 unsigned long *ionflag, size_t bufsz,
34 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
36 int msm_audio_ion_free(struct ion_client *client, struct ion_handle *handle);
37 int msm_audio_ion_mmap(struct audio_buffer *substream,
38 struct vm_area_struct *vma);
40 bool msm_audio_ion_is_smmu_available(void);
41 int msm_audio_ion_cache_operations(struct audio_buffer *abuff, int cache_op);
43 struct ion_client *msm_audio_ion_client_create(const char *name);
44 void msm_audio_ion_client_destroy(struct ion_client *client);
45 int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
46 struct ion_handle **handle, int fd,
47 unsigned long *ionflag, size_t bufsz,
48 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
49 int msm_audio_ion_free_legacy(struct ion_client *client,
50 struct ion_handle *handle);
51 u32 msm_audio_populate_upper_32_bits(ion_phys_addr_t pa);
53 int msm_audio_ion_phys_assign(const char *name, struct ion_client **client,
54 struct ion_handle **handle,
55 int fd, ion_phys_addr_t *paddr,
56 size_t *pa_len, u8 assign_type);
57 int msm_audio_ion_phys_free(struct ion_client *client,
58 struct ion_handle *handle,
59 ion_phys_addr_t *paddr,
60 size_t *pa_len, u8 assign_type);
61 #endif /* _LINUX_MSM_AUDIO_ION_H */