msm_audio_ion.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  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. #ifndef _LINUX_MSM_AUDIO_ION_H
  14. #define _LINUX_MSM_AUDIO_ION_H
  15. #ifdef CONFIG_SND_SOC_QDSP6V2
  16. #include <sound/q6asm-v2.h>
  17. #else
  18. #include <sound/q6asm.h>
  19. #endif
  20. #include <sound/pcm.h>
  21. #include <linux/msm_ion.h>
  22. int msm_audio_ion_alloc(const char *name, struct ion_client **client,
  23. struct ion_handle **handle, size_t bufsz,
  24. ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
  25. int msm_audio_ion_import(const char *name, struct ion_client **client,
  26. struct ion_handle **handle, int fd,
  27. unsigned long *ionflag, size_t bufsz,
  28. ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
  29. int msm_audio_ion_free(struct ion_client *client, struct ion_handle *handle);
  30. int msm_audio_ion_mmap(struct audio_buffer *substream,
  31. struct vm_area_struct *vma);
  32. bool msm_audio_ion_is_smmu_available(void);
  33. int msm_audio_ion_cache_operations(struct audio_buffer *abuff, int cache_op);
  34. #ifdef CONFIG_SND_SOC_QDSP6V2
  35. struct ion_client *msm_audio_ion_client_create(unsigned int heap_mask,
  36. const char *name);
  37. void msm_audio_ion_client_destroy(struct ion_client *client);
  38. int msm_audio_ion_import_legacy(const char *name, struct ion_client *client,
  39. struct ion_handle **handle, int fd,
  40. unsigned long *ionflag, size_t bufsz,
  41. ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr);
  42. int msm_audio_ion_free_legacy(struct ion_client *client,
  43. struct ion_handle *handle);
  44. #else
  45. static struct ion_client *msm_audio_ion_client_create(unsigned int heap_mask,
  46. const char *name)
  47. { return NULL; }
  48. static void msm_audio_ion_client_destroy(struct ion_client *client)
  49. {}
  50. static int msm_audio_ion_import_legacy(const char *name,
  51. struct ion_client *client,
  52. struct ion_handle **handle, int fd,
  53. unsigned long *ionflag, size_t bufsz,
  54. ion_phys_addr_t *paddr, size_t *pa_len, void **vaddr)
  55. { return 0; }
  56. static int msm_audio_ion_free_legacy(struct ion_client *client,
  57. struct ion_handle *handle)
  58. { return 0; }
  59. #endif /* CONFIG_MSM_QDSP6V2_CODECS */
  60. #endif /* _LINUX_MSM_AUDIO_ION_H */