blob: 83e5dff354540fcae01a75145e23c104c70fe0db [file] [log] [blame]
Fred Ohde9438a2013-04-04 11:29:12 -07001/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
3 *
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.
7 *
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.
12 */
13
14#ifndef _LINUX_MSM_AUDIO_ION_H
15#define _LINUX_MSM_AUDIO_ION_H
16
17#include <linux/msm_ion.h>
18
19
20int msm_audio_ion_alloc(const char *name, struct ion_client **client,
21 struct ion_handle **handle, size_t bufsz,
22 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
23
24int msm_audio_ion_import(const char *name, struct ion_client **client,
25 struct ion_handle **handle, int fd,
26 unsigned long *ionflag, size_t bufsz,
27 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
28int msm_audio_ion_free(struct ion_client *client, struct ion_handle *handle);
29
30
31bool msm_audio_ion_is_smmu_available(void);
32
33#ifdef CONFIG_SND_SOC_QDSP6V2
34struct ion_client *msm_audio_ion_client_create(unsigned int heap_mask,
35 const char *name);
36void msm_audio_ion_client_destroy(struct ion_client *client);
37int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
38 struct ion_handle **handle, int fd,
39 unsigned long *ionflag, size_t bufsz,
40 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
41int msm_audio_ion_free_legacy(struct ion_client *client,
42 struct ion_handle *handle);
43#else
44static struct ion_client *msm_audio_ion_client_create(unsigned int heap_mask,
45 const char *name)
46{ return NULL; }
47static void msm_audio_ion_client_destroy(struct ion_client *client)
48{}
49static int msm_audio_ion_import_legacy(const char *name,
50 struct ion_client *client,
51 struct ion_handle **handle, int fd,
52 unsigned long *ionflag, size_t bufsz,
53 ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr)
54{ return 0; }
55static int msm_audio_ion_free_legacy(struct ion_client *client,
56 struct ion_handle *handle)
57{ return 0; }
58
59#endif /* CONFIG_MSM_QDSP6V2_CODECS */
60#endif /* _LINUX_MSM_AUDIO_ION_H */
61