rtac.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2011, 2013-2015, 2017-2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __RTAC_H__
  6. #define __RTAC_H__
  7. #include <dsp/apr_audio-v2.h>
  8. /* Voice Modes */
  9. #define RTAC_CVP 0
  10. #define RTAC_CVS 1
  11. #define RTAC_VOICE_MODES 2
  12. #define RTAC_MAX_ACTIVE_DEVICES 4
  13. #define RTAC_MAX_ACTIVE_POPP 8
  14. #define DEFAULT_APP_TYPE 0x00011130
  15. enum {
  16. ADM_RTAC_CAL,
  17. ASM_RTAC_CAL,
  18. VOICE_RTAC_CAL,
  19. AFE_RTAC_CAL,
  20. MAX_RTAC_BLOCKS
  21. };
  22. struct rtac_cal_mem_map_data {
  23. uint32_t map_size;
  24. uint32_t map_handle;
  25. struct dma_buf *dma_buf;
  26. };
  27. struct rtac_cal_data {
  28. size_t size;
  29. void *kvaddr;
  30. phys_addr_t paddr;
  31. };
  32. struct rtac_cal_block_data {
  33. struct rtac_cal_mem_map_data map_data;
  34. struct rtac_cal_data cal_data;
  35. };
  36. struct rtac_popp_data {
  37. uint32_t popp;
  38. uint32_t popp_topology;
  39. uint32_t app_type;
  40. };
  41. struct rtac_adm_data {
  42. uint32_t topology_id;
  43. uint32_t afe_topology;
  44. uint32_t afe_port;
  45. uint32_t copp;
  46. uint32_t num_of_popp;
  47. uint32_t app_type;
  48. uint32_t acdb_dev_id;
  49. struct rtac_popp_data popp[RTAC_MAX_ACTIVE_POPP];
  50. };
  51. struct rtac_adm {
  52. uint32_t num_of_dev;
  53. struct rtac_adm_data device[RTAC_MAX_ACTIVE_DEVICES];
  54. };
  55. void rtac_add_adm_device(u32 port_id, u32 copp_id, u32 path_id, u32 popp_id,
  56. u32 app_type, u32 acdb_dev_id);
  57. void rtac_remove_adm_device(u32 port_id, u32 copp_id);
  58. void rtac_remove_popp_from_adm_devices(u32 popp_id);
  59. void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port,
  60. u32 tx_afe_port, u32 rx_acdb_id, u32 tx_acdb_id, u32 session_id);
  61. void rtac_remove_voice(u32 cvs_handle);
  62. void rtac_set_adm_handle(void *handle);
  63. bool rtac_make_adm_callback(uint32_t *payload, u32 payload_size);
  64. void rtac_copy_adm_payload_to_user(void *payload, u32 payload_size);
  65. void rtac_set_asm_handle(u32 session_id, void *handle);
  66. bool rtac_make_asm_callback(u32 session_id, uint32_t *payload,
  67. u32 payload_size);
  68. void rtac_copy_asm_payload_to_user(void *payload, u32 payload_size);
  69. void rtac_set_voice_handle(u32 mode, void *handle);
  70. bool rtac_make_voice_callback(u32 mode, uint32_t *payload, u32 payload_size);
  71. void rtac_copy_voice_payload_to_user(void *payload, u32 payload_size);
  72. int rtac_clear_mapping(uint32_t cal_type);
  73. bool rtac_make_afe_callback(uint32_t *payload, u32 payload_size);
  74. void rtac_set_afe_handle(void *handle);
  75. void get_rtac_adm_data(struct rtac_adm *adm_data);
  76. void rtac_update_afe_topology(u32 port_id);
  77. #endif