msm-pcm-routing.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef _MSM_PCM_ROUTING_H
  13. #define _MSM_PCM_ROUTING_H
  14. #include <sound/apr_audio.h>
  15. #define LPASS_BE_PRI_I2S_RX "PRIMARY_I2S_RX"
  16. #define LPASS_BE_PRI_I2S_TX "PRIMARY_I2S_TX"
  17. #define LPASS_BE_SLIMBUS_0_RX "SLIMBUS_0_RX"
  18. #define LPASS_BE_SLIMBUS_0_TX "SLIMBUS_0_TX"
  19. #define LPASS_BE_HDMI "HDMI"
  20. #define LPASS_BE_PSEUDO "PSEUDO"
  21. #define LPASS_BE_INT_BT_SCO_RX "INT_BT_SCO_RX"
  22. #define LPASS_BE_INT_BT_SCO_TX "INT_BT_SCO_TX"
  23. #define LPASS_BE_INT_FM_RX "INT_FM_RX"
  24. #define LPASS_BE_INT_FM_TX "INT_FM_TX"
  25. #define LPASS_BE_AFE_PCM_RX "RT_PROXY_DAI_001_RX"
  26. #define LPASS_BE_AFE_PCM_TX "RT_PROXY_DAI_002_TX"
  27. #define LPASS_BE_AUXPCM_RX "AUX_PCM_RX"
  28. #define LPASS_BE_AUXPCM_TX "AUX_PCM_TX"
  29. #define LPASS_BE_SEC_AUXPCM_RX "SEC_AUX_PCM_RX"
  30. #define LPASS_BE_SEC_AUXPCM_TX "SEC_AUX_PCM_TX"
  31. #define LPASS_BE_VOICE_PLAYBACK_TX "VOICE_PLAYBACK_TX"
  32. #define LPASS_BE_INCALL_RECORD_RX "INCALL_RECORD_TX"
  33. #define LPASS_BE_INCALL_RECORD_TX "INCALL_RECORD_RX"
  34. #define LPASS_BE_SEC_I2S_RX "SECONDARY_I2S_RX"
  35. #define LPASS_BE_SEC_I2S_TX "SECONDARY_I2S_TX"
  36. #define LPASS_BE_MI2S_RX "MI2S_RX"
  37. #define LPASS_BE_MI2S_TX "MI2S_TX"
  38. #define LPASS_BE_STUB_RX "STUB_RX"
  39. #define LPASS_BE_STUB_TX "STUB_TX"
  40. #define LPASS_BE_SLIMBUS_1_RX "SLIMBUS_1_RX"
  41. #define LPASS_BE_SLIMBUS_1_TX "SLIMBUS_1_TX"
  42. #define LPASS_BE_STUB_1_TX "STUB_1_TX"
  43. #define LPASS_BE_SLIMBUS_3_RX "SLIMBUS_3_RX"
  44. #define LPASS_BE_SLIMBUS_3_TX "SLIMBUS_3_TX"
  45. #define LPASS_BE_SLIMBUS_4_RX "SLIMBUS_4_RX"
  46. #define LPASS_BE_SLIMBUS_4_TX "SLIMBUS_4_TX"
  47. /* For multimedia front-ends, asm session is allocated dynamically.
  48. * Hence, asm session/multimedia front-end mapping has to be maintained.
  49. * Due to this reason, additional multimedia front-end must be placed before
  50. * non-multimedia front-ends.
  51. */
  52. enum {
  53. MSM_FRONTEND_DAI_MULTIMEDIA1 = 0,
  54. MSM_FRONTEND_DAI_MULTIMEDIA2,
  55. MSM_FRONTEND_DAI_MULTIMEDIA3,
  56. MSM_FRONTEND_DAI_MULTIMEDIA4,
  57. MSM_FRONTEND_DAI_MULTIMEDIA5,
  58. MSM_FRONTEND_DAI_MULTIMEDIA6,
  59. MSM_FRONTEND_DAI_MULTIMEDIA7,
  60. MSM_FRONTEND_DAI_MULTIMEDIA8,
  61. MSM_FRONTEND_DAI_PSEUDO,
  62. MSM_FRONTEND_DAI_CS_VOICE,
  63. MSM_FRONTEND_DAI_VOIP,
  64. MSM_FRONTEND_DAI_AFE_RX,
  65. MSM_FRONTEND_DAI_AFE_TX,
  66. MSM_FRONTEND_DAI_VOICE_STUB,
  67. MSM_FRONTEND_DAI_VOLTE,
  68. MSM_FRONTEND_DAI_VOICE2,
  69. MSM_FRONTEND_DAI_DTMF_RX,
  70. MSM_FRONTEND_DAI_VOLTE_STUB,
  71. MSM_FRONTEND_DAI_VOICE2_STUB,
  72. MSM_FRONTEND_DAI_MAX,
  73. };
  74. #define MSM_FRONTEND_DAI_MM_SIZE (MSM_FRONTEND_DAI_PSEUDO + 1)
  75. #define MSM_FRONTEND_DAI_MM_MAX_ID MSM_FRONTEND_DAI_PSEUDO
  76. enum {
  77. MSM_BACKEND_DAI_PRI_I2S_RX = 0,
  78. MSM_BACKEND_DAI_PRI_I2S_TX,
  79. MSM_BACKEND_DAI_SLIMBUS_0_RX,
  80. MSM_BACKEND_DAI_SLIMBUS_0_TX,
  81. MSM_BACKEND_DAI_HDMI_RX,
  82. MSM_BACKEND_DAI_INT_BT_SCO_RX,
  83. MSM_BACKEND_DAI_INT_BT_SCO_TX,
  84. MSM_BACKEND_DAI_INT_FM_RX,
  85. MSM_BACKEND_DAI_INT_FM_TX,
  86. MSM_BACKEND_DAI_AFE_PCM_RX,
  87. MSM_BACKEND_DAI_AFE_PCM_TX,
  88. MSM_BACKEND_DAI_AUXPCM_RX,
  89. MSM_BACKEND_DAI_AUXPCM_TX,
  90. MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
  91. MSM_BACKEND_DAI_INCALL_RECORD_RX,
  92. MSM_BACKEND_DAI_INCALL_RECORD_TX,
  93. MSM_BACKEND_DAI_MI2S_RX,
  94. MSM_BACKEND_DAI_MI2S_TX,
  95. MSM_BACKEND_DAI_SEC_I2S_RX,
  96. MSM_BACKEND_DAI_SEC_I2S_TX,
  97. MSM_BACKEND_DAI_SLIMBUS_1_RX,
  98. MSM_BACKEND_DAI_SLIMBUS_1_TX,
  99. MSM_BACKEND_DAI_SLIMBUS_4_RX,
  100. MSM_BACKEND_DAI_SLIMBUS_4_TX,
  101. MSM_BACKEND_DAI_SLIMBUS_3_RX,
  102. MSM_BACKEND_DAI_SLIMBUS_3_TX,
  103. MSM_BACKEND_DAI_EXTPROC_RX,
  104. MSM_BACKEND_DAI_EXTPROC_TX,
  105. MSM_BACKEND_DAI_EXTPROC_EC_TX,
  106. MSM_BACKEND_DAI_SEC_AUXPCM_RX,
  107. MSM_BACKEND_DAI_SEC_AUXPCM_TX,
  108. MSM_BACKEND_DAI_PSEUDO_PORT,
  109. MSM_BACKEND_DAI_MAX,
  110. };
  111. enum msm_pcm_routing_event {
  112. MSM_PCM_RT_EVT_BUF_RECFG,
  113. MSM_PCM_RT_EVT_DEVSWITCH,
  114. MSM_PCM_RT_EVT_MAX,
  115. };
  116. /* dai_id: front-end ID,
  117. * dspst_id: DSP audio stream ID
  118. * stream_type: playback or capture
  119. */
  120. void msm_pcm_routing_reg_phy_stream(int fedai_id, bool perf_mode,
  121. int dspst_id, int stream_type);
  122. void msm_pcm_routing_reg_psthr_stream(int fedai_id, int dspst_id,
  123. int stream_type, int enable);
  124. void msm_pcm_routing_reg_pseudo_stream(int fedai_id, bool perf_mode,
  125. int dspst_id, int stream_type, int sample_rate,
  126. int channels);
  127. void msm_pcm_routing_dereg_pseudo_stream(int fedai_id, int dspst_id);
  128. struct msm_pcm_routing_evt {
  129. void (*event_func)(enum msm_pcm_routing_event, void *);
  130. void *priv_data;
  131. };
  132. void msm_pcm_routing_reg_phy_stream_v2(int fedai_id, bool perf_mode,
  133. int dspst_id, int stream_type,
  134. struct msm_pcm_routing_evt event_info);
  135. void msm_pcm_routing_dereg_phy_stream(int fedai_id, int stream_type);
  136. int lpa_set_volume(unsigned volume);
  137. int msm_routing_check_backend_enabled(int fedai_id);
  138. int multi_ch_pcm_set_volume(unsigned volume);
  139. int compressed_set_volume(unsigned volume);
  140. void multi_ch_pcm_set_channel_map(char *channel_mapping);
  141. #endif /*_MSM_PCM_H*/