swr-slave-port-config.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _SWR_SLAVE_PORT_CONFIG
  6. #define _SWR_SLAVE_PORT_CONFIG
  7. #include <soc/swr-common.h>
  8. #define WSA_MSTR_PORT_MASK 0xFF
  9. /*
  10. * Add port configuration in the format
  11. *{ si, off1, off2, hstart, hstop, wd_len, bp_mode, bgp_ctrl, lane_ctrl, dir,
  12. * stream_type}
  13. */
  14. /* DUMMY */
  15. static struct port_params tx_dummy[SWR_MSTR_PORT_LEN] = {
  16. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  17. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  18. {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
  19. };
  20. /* AMIC 9.6 MHz clock */
  21. #ifdef CONFIG_SND_SOC_HOLI
  22. static struct port_params tx_wcd_9p6MHz[SWR_MSTR_PORT_LEN] = {
  23. {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */
  24. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  25. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
  26. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */
  27. };
  28. #else
  29. static struct port_params tx_wcd_9p6MHz[SWR_MSTR_PORT_LEN] = {
  30. {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */
  31. {7, 5, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  32. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
  33. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */
  34. };
  35. #endif
  36. /* AMIC 4.8 MHz clock */
  37. static struct port_params tx_wcd_4p8MHz[SWR_MSTR_PORT_LEN] = {
  38. {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */
  39. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  40. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
  41. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */
  42. };
  43. /* AMIC 0.6 MHz clock, single channel */
  44. static struct port_params tx_wcd_0p6MHz[SWR_MSTR_PORT_LEN] = {
  45. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  46. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  47. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
  48. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX4 */
  49. };
  50. /* 4 Channel configuration */
  51. /* SWR DMIC0 */
  52. static struct port_params tx_bottom_mic_9p6MHz[SWR_MSTR_PORT_LEN] = {
  53. {7, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  54. {7, 6, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  55. };
  56. /* SWR DMIC1 */
  57. static struct port_params tx_receiver_mic_9p6MHz[SWR_MSTR_PORT_LEN] = {
  58. {7, 4, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  59. {7, 7, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  60. };
  61. /* SWR DMIC2 */
  62. static struct port_params tx_back_mic_9p6MHz[SWR_MSTR_PORT_LEN] = {
  63. {7, 3, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  64. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  65. };
  66. /* SWR DMIC3 */
  67. static struct port_params tx_top_mic_9p6MHz[SWR_MSTR_PORT_LEN] = {
  68. {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  69. {7, 5, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  70. };
  71. /* The 4.8MHZ port config is used in
  72. * 1. single mic standalone in "high power" mode
  73. * 2. dual mic standalone in "high power" mode
  74. * 3. sva standalone single/dual/tri/quad in "low-power" mode
  75. * 4. sva single/dmic in "low-power" + single mic in "high power" concurrency
  76. */
  77. /* SWR DMIC0 */
  78. static struct port_params tx_bottom_mic_4p8MHz[SWR_MSTR_PORT_LEN] = {
  79. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  80. {15, 4, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  81. };
  82. /* SWR DMIC1 */
  83. static struct port_params tx_receiver_mic_4p8MHz[SWR_MSTR_PORT_LEN] = {
  84. {3, 3, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  85. {7, 6, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  86. };
  87. /* SWR DMIC2 */
  88. static struct port_params tx_back_mic_4p8MHz[SWR_MSTR_PORT_LEN] = {
  89. {3, 3, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  90. {7, 7, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  91. };
  92. /* SWR DMIC3 */
  93. static struct port_params tx_top_mic_4p8MHz[SWR_MSTR_PORT_LEN] = {
  94. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  95. {15, 3, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  96. };
  97. /* 1 Channel configuration */
  98. /* SWR DMIC0 */
  99. static struct port_params tx_bottom_mic_0p6MHz[SWR_MSTR_PORT_LEN] = {
  100. {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  101. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  102. };
  103. /* SWR DMIC1 */
  104. static struct port_params tx_receiver_mic_0p6MHz[SWR_MSTR_PORT_LEN] = {
  105. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  106. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  107. };
  108. /* SWR DMIC2 */
  109. static struct port_params tx_back_mic_0p6MHz[SWR_MSTR_PORT_LEN] = {
  110. {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  111. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  112. };
  113. /* SWR DMIC3 */
  114. static struct port_params tx_top_mic_0p6MHz[SWR_MSTR_PORT_LEN] = {
  115. {3, 3, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX1 */
  116. {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
  117. };
  118. struct swr_dev_frame_config {
  119. struct port_params *pp;
  120. };
  121. static struct swr_dev_frame_config swrdev_frame_params_9p6MHz[] = {
  122. {tx_dummy},
  123. {tx_wcd_9p6MHz},
  124. {tx_top_mic_9p6MHz},
  125. {tx_back_mic_9p6MHz},
  126. {tx_receiver_mic_9p6MHz},
  127. {tx_bottom_mic_9p6MHz},
  128. };
  129. static struct swr_dev_frame_config swrdev_frame_params_4p8MHz[] = {
  130. {tx_dummy},
  131. {tx_wcd_4p8MHz},
  132. {tx_top_mic_4p8MHz},
  133. {tx_back_mic_4p8MHz},
  134. {tx_receiver_mic_4p8MHz},
  135. {tx_bottom_mic_4p8MHz},
  136. };
  137. static struct swr_dev_frame_config swrdev_frame_params_0p6MHz[] = {
  138. {tx_dummy},
  139. {tx_wcd_0p6MHz},
  140. {tx_top_mic_0p6MHz},
  141. {tx_back_mic_0p6MHz},
  142. {tx_receiver_mic_0p6MHz},
  143. {tx_bottom_mic_0p6MHz},
  144. };
  145. #endif /* _LAHAINA_PORT_CONFIG */