msm-qti-pp-config.c 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407
  1. /* Copyright (c) 2012-2017, 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. #include <linux/err.h>
  13. #include <linux/module.h>
  14. #include <linux/bitops.h>
  15. #include <linux/mutex.h>
  16. #include <sound/control.h>
  17. #include <sound/asound.h>
  18. #include <sound/tlv.h>
  19. #include <dsp/q6adm-v2.h>
  20. #include <dsp/q6asm-v2.h>
  21. #include <dsp/q6afe-v2.h>
  22. #include <dsp/q6audio-v2.h>
  23. #include "msm-qti-pp-config.h"
  24. #include "msm-pcm-routing-v2.h"
  25. /* EQUALIZER */
  26. /* Equal to Frontend after last of the MULTIMEDIA SESSIONS */
  27. #define MAX_EQ_SESSIONS MSM_FRONTEND_DAI_CS_VOICE
  28. enum {
  29. EQ_BAND1 = 0,
  30. EQ_BAND2,
  31. EQ_BAND3,
  32. EQ_BAND4,
  33. EQ_BAND5,
  34. EQ_BAND6,
  35. EQ_BAND7,
  36. EQ_BAND8,
  37. EQ_BAND9,
  38. EQ_BAND10,
  39. EQ_BAND11,
  40. EQ_BAND12,
  41. EQ_BAND_MAX,
  42. };
  43. /* Audio Sphere data structures */
  44. struct msm_audio_pp_asphere_state_s {
  45. uint32_t enabled;
  46. uint32_t strength;
  47. uint32_t mode;
  48. uint32_t version;
  49. int port_id[AFE_MAX_PORTS];
  50. int copp_idx[AFE_MAX_PORTS];
  51. bool initialized;
  52. uint32_t enabled_prev;
  53. uint32_t strength_prev;
  54. };
  55. static struct msm_audio_pp_asphere_state_s asphere_state;
  56. struct msm_audio_eq_stream_config eq_data[MAX_EQ_SESSIONS];
  57. static int msm_route_hfp_vol_control;
  58. static const DECLARE_TLV_DB_LINEAR(hfp_rx_vol_gain, 0,
  59. INT_RX_VOL_MAX_STEPS);
  60. static int msm_route_icc_vol_control;
  61. static const DECLARE_TLV_DB_LINEAR(icc_rx_vol_gain, 0,
  62. INT_RX_VOL_MAX_STEPS);
  63. static int msm_route_pri_auxpcm_lb_vol_ctrl;
  64. static const DECLARE_TLV_DB_LINEAR(pri_auxpcm_lb_vol_gain, 0,
  65. INT_RX_VOL_MAX_STEPS);
  66. static int msm_route_sec_auxpcm_lb_vol_ctrl;
  67. static const DECLARE_TLV_DB_LINEAR(sec_auxpcm_lb_vol_gain, 0,
  68. INT_RX_VOL_MAX_STEPS);
  69. static int msm_multichannel_ec_primary_mic_ch;
  70. static void msm_qti_pp_send_eq_values_(int eq_idx)
  71. {
  72. int result;
  73. struct msm_pcm_routing_fdai_data fe_dai;
  74. struct audio_client *ac = NULL;
  75. msm_pcm_routing_get_fedai_info(eq_idx, SESSION_TYPE_RX, &fe_dai);
  76. ac = q6asm_get_audio_client(fe_dai.strm_id);
  77. if (ac == NULL) {
  78. pr_err("%s: Could not get audio client for session: %d\n",
  79. __func__, fe_dai.strm_id);
  80. goto done;
  81. }
  82. result = q6asm_equalizer(ac, &eq_data[eq_idx]);
  83. if (result < 0)
  84. pr_err("%s: Call to ASM equalizer failed, returned = %d\n",
  85. __func__, result);
  86. done:
  87. return;
  88. }
  89. static int msm_qti_pp_get_eq_enable_mixer(struct snd_kcontrol *kcontrol,
  90. struct snd_ctl_elem_value *ucontrol)
  91. {
  92. int eq_idx = ((struct soc_multi_mixer_control *)
  93. kcontrol->private_value)->reg;
  94. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS))
  95. return -EINVAL;
  96. ucontrol->value.integer.value[0] = eq_data[eq_idx].enable;
  97. pr_debug("%s: EQ #%d enable %d\n", __func__,
  98. eq_idx, eq_data[eq_idx].enable);
  99. return 0;
  100. }
  101. static int msm_qti_pp_put_eq_enable_mixer(struct snd_kcontrol *kcontrol,
  102. struct snd_ctl_elem_value *ucontrol)
  103. {
  104. int eq_idx = ((struct soc_multi_mixer_control *)
  105. kcontrol->private_value)->reg;
  106. int value = ucontrol->value.integer.value[0];
  107. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS))
  108. return -EINVAL;
  109. pr_debug("%s: EQ #%d enable %d\n", __func__,
  110. eq_idx, value);
  111. eq_data[eq_idx].enable = value;
  112. msm_pcm_routing_acquire_lock();
  113. msm_qti_pp_send_eq_values_(eq_idx);
  114. msm_pcm_routing_release_lock();
  115. return 0;
  116. }
  117. static int msm_qti_pp_get_eq_band_count_audio_mixer(
  118. struct snd_kcontrol *kcontrol,
  119. struct snd_ctl_elem_value *ucontrol)
  120. {
  121. int eq_idx = ((struct soc_multi_mixer_control *)
  122. kcontrol->private_value)->reg;
  123. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS))
  124. return -EINVAL;
  125. ucontrol->value.integer.value[0] = eq_data[eq_idx].num_bands;
  126. pr_debug("%s: EQ #%d bands %d\n", __func__,
  127. eq_idx, eq_data[eq_idx].num_bands);
  128. return eq_data[eq_idx].num_bands;
  129. }
  130. static int msm_qti_pp_put_eq_band_count_audio_mixer(
  131. struct snd_kcontrol *kcontrol,
  132. struct snd_ctl_elem_value *ucontrol)
  133. {
  134. int eq_idx = ((struct soc_multi_mixer_control *)
  135. kcontrol->private_value)->reg;
  136. int value = ucontrol->value.integer.value[0];
  137. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS))
  138. return -EINVAL;
  139. pr_debug("%s: EQ #%d bands %d\n", __func__,
  140. eq_idx, value);
  141. eq_data[eq_idx].num_bands = value;
  142. return 0;
  143. }
  144. static int msm_qti_pp_get_eq_band_audio_mixer(struct snd_kcontrol *kcontrol,
  145. struct snd_ctl_elem_value *ucontrol)
  146. {
  147. int eq_idx = ((struct soc_multi_mixer_control *)
  148. kcontrol->private_value)->reg;
  149. int band_idx = ((struct soc_multi_mixer_control *)
  150. kcontrol->private_value)->shift;
  151. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS) ||
  152. (band_idx < EQ_BAND1) || (band_idx >= EQ_BAND_MAX))
  153. return -EINVAL;
  154. ucontrol->value.integer.value[0] =
  155. eq_data[eq_idx].eq_bands[band_idx].band_idx;
  156. ucontrol->value.integer.value[1] =
  157. eq_data[eq_idx].eq_bands[band_idx].filter_type;
  158. ucontrol->value.integer.value[2] =
  159. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz;
  160. ucontrol->value.integer.value[3] =
  161. eq_data[eq_idx].eq_bands[band_idx].filter_gain;
  162. ucontrol->value.integer.value[4] =
  163. eq_data[eq_idx].eq_bands[band_idx].q_factor;
  164. pr_debug("%s: band_idx = %d\n", __func__,
  165. eq_data[eq_idx].eq_bands[band_idx].band_idx);
  166. pr_debug("%s: filter_type = %d\n", __func__,
  167. eq_data[eq_idx].eq_bands[band_idx].filter_type);
  168. pr_debug("%s: center_freq_hz = %d\n", __func__,
  169. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz);
  170. pr_debug("%s: filter_gain = %d\n", __func__,
  171. eq_data[eq_idx].eq_bands[band_idx].filter_gain);
  172. pr_debug("%s: q_factor = %d\n", __func__,
  173. eq_data[eq_idx].eq_bands[band_idx].q_factor);
  174. return 0;
  175. }
  176. static int msm_qti_pp_put_eq_band_audio_mixer(struct snd_kcontrol *kcontrol,
  177. struct snd_ctl_elem_value *ucontrol)
  178. {
  179. int eq_idx = ((struct soc_multi_mixer_control *)
  180. kcontrol->private_value)->reg;
  181. int band_idx = ((struct soc_multi_mixer_control *)
  182. kcontrol->private_value)->shift;
  183. if ((eq_idx < 0) || (eq_idx >= MAX_EQ_SESSIONS) ||
  184. (band_idx < EQ_BAND1) || (band_idx >= EQ_BAND_MAX))
  185. return -EINVAL;
  186. eq_data[eq_idx].eq_bands[band_idx].band_idx =
  187. ucontrol->value.integer.value[0];
  188. eq_data[eq_idx].eq_bands[band_idx].filter_type =
  189. ucontrol->value.integer.value[1];
  190. eq_data[eq_idx].eq_bands[band_idx].center_freq_hz =
  191. ucontrol->value.integer.value[2];
  192. eq_data[eq_idx].eq_bands[band_idx].filter_gain =
  193. ucontrol->value.integer.value[3];
  194. eq_data[eq_idx].eq_bands[band_idx].q_factor =
  195. ucontrol->value.integer.value[4];
  196. return 0;
  197. }
  198. #ifdef CONFIG_QTI_PP
  199. void msm_qti_pp_send_eq_values(int fedai_id)
  200. {
  201. if (eq_data[fedai_id].enable)
  202. msm_qti_pp_send_eq_values_(fedai_id);
  203. }
  204. /* CUSTOM MIXING */
  205. int msm_qti_pp_send_stereo_to_custom_stereo_cmd(int port_id, int copp_idx,
  206. unsigned int session_id,
  207. uint16_t op_FL_ip_FL_weight,
  208. uint16_t op_FL_ip_FR_weight,
  209. uint16_t op_FR_ip_FL_weight,
  210. uint16_t op_FR_ip_FR_weight)
  211. {
  212. char *params_value;
  213. int *update_params_value32, rc = 0;
  214. int16_t *update_params_value16 = 0;
  215. uint32_t params_length = CUSTOM_STEREO_PAYLOAD_SIZE * sizeof(uint32_t);
  216. uint32_t avail_length = params_length;
  217. pr_debug("%s: port_id - %d, session id - %d\n", __func__, port_id,
  218. session_id);
  219. params_value = kzalloc(params_length, GFP_KERNEL);
  220. if (!params_value) {
  221. pr_err("%s, params memory alloc failed\n", __func__);
  222. return -ENOMEM;
  223. }
  224. update_params_value32 = (int *)params_value;
  225. if (avail_length < 2 * sizeof(uint32_t))
  226. goto skip_send_cmd;
  227. *update_params_value32++ = MTMX_MODULE_ID_DEFAULT_CHMIXER;
  228. *update_params_value32++ = DEFAULT_CHMIXER_PARAM_ID_COEFF;
  229. avail_length = avail_length - (2 * sizeof(uint32_t));
  230. update_params_value16 = (int16_t *)update_params_value32;
  231. if (avail_length < 10 * sizeof(uint16_t))
  232. goto skip_send_cmd;
  233. *update_params_value16++ = CUSTOM_STEREO_CMD_PARAM_SIZE;
  234. /*for alignment only*/
  235. *update_params_value16++ = 0;
  236. /*index is 32-bit param in little endian*/
  237. *update_params_value16++ = CUSTOM_STEREO_INDEX_PARAM;
  238. *update_params_value16++ = 0;
  239. /*for stereo mixing num out ch*/
  240. *update_params_value16++ = CUSTOM_STEREO_NUM_OUT_CH;
  241. /*for stereo mixing num in ch*/
  242. *update_params_value16++ = CUSTOM_STEREO_NUM_IN_CH;
  243. /* Out ch map FL/FR*/
  244. *update_params_value16++ = PCM_CHANNEL_FL;
  245. *update_params_value16++ = PCM_CHANNEL_FR;
  246. /* In ch map FL/FR*/
  247. *update_params_value16++ = PCM_CHANNEL_FL;
  248. *update_params_value16++ = PCM_CHANNEL_FR;
  249. avail_length = avail_length - (10 * sizeof(uint16_t));
  250. /* weighting coefficients as name suggests,
  251. * mixing will be done according to these coefficients
  252. */
  253. if (avail_length < 4 * sizeof(uint16_t))
  254. goto skip_send_cmd;
  255. *update_params_value16++ = op_FL_ip_FL_weight;
  256. *update_params_value16++ = op_FL_ip_FR_weight;
  257. *update_params_value16++ = op_FR_ip_FL_weight;
  258. *update_params_value16++ = op_FR_ip_FR_weight;
  259. avail_length = avail_length - (4 * sizeof(uint16_t));
  260. if (params_length) {
  261. rc = adm_set_stereo_to_custom_stereo(port_id,
  262. copp_idx,
  263. session_id,
  264. params_value,
  265. params_length);
  266. if (rc) {
  267. pr_err("%s: send params failed rc=%d\n", __func__, rc);
  268. kfree(params_value);
  269. return -EINVAL;
  270. }
  271. }
  272. kfree(params_value);
  273. return 0;
  274. skip_send_cmd:
  275. pr_err("%s: insufficient memory, send cmd failed\n",
  276. __func__);
  277. kfree(params_value);
  278. return -ENOMEM;
  279. }
  280. #endif /* CONFIG_QTI_PP */
  281. /* RMS */
  282. static int msm_qti_pp_get_rms_value_control(struct snd_kcontrol *kcontrol,
  283. struct snd_ctl_elem_value *ucontrol)
  284. {
  285. int rc = 0;
  286. int be_idx = 0, copp_idx;
  287. char *param_value;
  288. int *update_param_value;
  289. uint32_t param_length = sizeof(uint32_t);
  290. uint32_t param_payload_len = RMS_PAYLOAD_LEN * sizeof(uint32_t);
  291. struct msm_pcm_routing_bdai_data msm_bedai;
  292. param_value = kzalloc(param_length + param_payload_len, GFP_KERNEL);
  293. if (!param_value)
  294. return -ENOMEM;
  295. msm_pcm_routing_acquire_lock();
  296. for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++) {
  297. msm_pcm_routing_get_bedai_info(be_idx, &msm_bedai);
  298. if (msm_bedai.port_id == SLIMBUS_0_TX)
  299. break;
  300. }
  301. if ((be_idx >= MSM_BACKEND_DAI_MAX) || !msm_bedai.active) {
  302. pr_err("%s, back not active to query rms be_idx:%d\n",
  303. __func__, be_idx);
  304. rc = -EINVAL;
  305. goto get_rms_value_err;
  306. }
  307. copp_idx = adm_get_default_copp_idx(SLIMBUS_0_TX);
  308. if ((copp_idx < 0) || (copp_idx > MAX_COPPS_PER_PORT)) {
  309. pr_err("%s, no active copp to query rms copp_idx:%d\n",
  310. __func__, copp_idx);
  311. rc = -EINVAL;
  312. goto get_rms_value_err;
  313. }
  314. rc = adm_get_params(SLIMBUS_0_TX, copp_idx,
  315. RMS_MODULEID_APPI_PASSTHRU,
  316. RMS_PARAM_FIRST_SAMPLE,
  317. param_length + param_payload_len,
  318. param_value);
  319. if (rc) {
  320. pr_err("%s: get parameters failed rc=%d\n", __func__, rc);
  321. rc = -EINVAL;
  322. goto get_rms_value_err;
  323. }
  324. update_param_value = (int *)param_value;
  325. ucontrol->value.integer.value[0] = update_param_value[0];
  326. pr_debug("%s: FROM DSP value[0] 0x%x\n",
  327. __func__, update_param_value[0]);
  328. get_rms_value_err:
  329. msm_pcm_routing_release_lock();
  330. kfree(param_value);
  331. return rc;
  332. }
  333. static int msm_qti_pp_put_rms_value_control(struct snd_kcontrol *kcontrol,
  334. struct snd_ctl_elem_value *ucontrol)
  335. {
  336. /* not used */
  337. return 0;
  338. }
  339. /* VOLUME */
  340. static int msm_route_fm_vol_control;
  341. static int msm_afe_lb_vol_ctrl;
  342. static int msm_afe_sec_mi2s_lb_vol_ctrl;
  343. static int msm_afe_tert_mi2s_lb_vol_ctrl;
  344. static int msm_afe_quat_mi2s_lb_vol_ctrl;
  345. static int msm_afe_slimbus_7_lb_vol_ctrl;
  346. static int msm_afe_slimbus_8_lb_vol_ctrl;
  347. static const DECLARE_TLV_DB_LINEAR(fm_rx_vol_gain, 0, INT_RX_VOL_MAX_STEPS);
  348. static const DECLARE_TLV_DB_LINEAR(afe_lb_vol_gain, 0, INT_RX_VOL_MAX_STEPS);
  349. static int msm_qti_pp_get_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  350. struct snd_ctl_elem_value *ucontrol)
  351. {
  352. ucontrol->value.integer.value[0] = msm_route_fm_vol_control;
  353. return 0;
  354. }
  355. static int msm_qti_pp_set_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  356. struct snd_ctl_elem_value *ucontrol)
  357. {
  358. afe_loopback_gain(INT_FM_TX, ucontrol->value.integer.value[0]);
  359. msm_route_fm_vol_control = ucontrol->value.integer.value[0];
  360. return 0;
  361. }
  362. static int msm_qti_pp_get_pri_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  363. struct snd_ctl_elem_value *ucontrol)
  364. {
  365. ucontrol->value.integer.value[0] = msm_afe_lb_vol_ctrl;
  366. return 0;
  367. }
  368. static int msm_qti_pp_set_pri_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  369. struct snd_ctl_elem_value *ucontrol)
  370. {
  371. afe_loopback_gain(AFE_PORT_ID_PRIMARY_MI2S_TX,
  372. ucontrol->value.integer.value[0]);
  373. msm_afe_lb_vol_ctrl = ucontrol->value.integer.value[0];
  374. return 0;
  375. }
  376. static int msm_qti_pp_get_sec_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  377. struct snd_ctl_elem_value *ucontrol)
  378. {
  379. ucontrol->value.integer.value[0] = msm_afe_sec_mi2s_lb_vol_ctrl;
  380. return 0;
  381. }
  382. static int msm_qti_pp_set_sec_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  383. struct snd_ctl_elem_value *ucontrol)
  384. {
  385. afe_loopback_gain(AFE_PORT_ID_SECONDARY_MI2S_TX,
  386. ucontrol->value.integer.value[0]);
  387. msm_afe_sec_mi2s_lb_vol_ctrl = ucontrol->value.integer.value[0];
  388. return 0;
  389. }
  390. static int msm_qti_pp_get_tert_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  391. struct snd_ctl_elem_value *ucontrol)
  392. {
  393. ucontrol->value.integer.value[0] = msm_afe_tert_mi2s_lb_vol_ctrl;
  394. return 0;
  395. }
  396. static int msm_qti_pp_set_tert_mi2s_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  397. struct snd_ctl_elem_value *ucontrol)
  398. {
  399. afe_loopback_gain(AFE_PORT_ID_TERTIARY_MI2S_TX,
  400. ucontrol->value.integer.value[0]);
  401. msm_afe_tert_mi2s_lb_vol_ctrl = ucontrol->value.integer.value[0];
  402. return 0;
  403. }
  404. static int msm_qti_pp_get_slimbus_7_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  405. struct snd_ctl_elem_value *ucontrol)
  406. {
  407. ucontrol->value.integer.value[0] = msm_afe_slimbus_7_lb_vol_ctrl;
  408. return 0;
  409. }
  410. static int msm_qti_pp_set_slimbus_7_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  411. struct snd_ctl_elem_value *ucontrol)
  412. {
  413. int ret = afe_loopback_gain(SLIMBUS_7_TX,
  414. ucontrol->value.integer.value[0]);
  415. if (ret)
  416. pr_err("%s: failed to set LB vol for SLIMBUS_7_TX, err %d\n",
  417. __func__, ret);
  418. else
  419. msm_afe_slimbus_7_lb_vol_ctrl =
  420. ucontrol->value.integer.value[0];
  421. return ret;
  422. }
  423. static int msm_qti_pp_get_slimbus_8_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  424. struct snd_ctl_elem_value *ucontrol)
  425. {
  426. ucontrol->value.integer.value[0] = msm_afe_slimbus_8_lb_vol_ctrl;
  427. return 0;
  428. }
  429. static int msm_qti_pp_set_slimbus_8_lb_vol_mixer(struct snd_kcontrol *kcontrol,
  430. struct snd_ctl_elem_value *ucontrol)
  431. {
  432. int ret = 0;
  433. ret = afe_loopback_gain(SLIMBUS_8_TX,
  434. ucontrol->value.integer.value[0]);
  435. if (ret)
  436. pr_err("%s: failed to set LB vol for SLIMBUS_8_TX", __func__);
  437. else
  438. msm_afe_slimbus_8_lb_vol_ctrl =
  439. ucontrol->value.integer.value[0];
  440. return ret;
  441. }
  442. static int msm_qti_pp_get_icc_vol_mixer(struct snd_kcontrol *kcontrol,
  443. struct snd_ctl_elem_value *ucontrol)
  444. {
  445. ucontrol->value.integer.value[0] = msm_route_icc_vol_control;
  446. return 0;
  447. }
  448. static int msm_qti_pp_set_icc_vol_mixer(struct snd_kcontrol *kcontrol,
  449. struct snd_ctl_elem_value *ucontrol)
  450. {
  451. adm_set_mic_gain(AFE_PORT_ID_QUATERNARY_TDM_TX,
  452. adm_get_default_copp_idx(AFE_PORT_ID_QUATERNARY_TDM_TX),
  453. ucontrol->value.integer.value[0]);
  454. msm_route_icc_vol_control = ucontrol->value.integer.value[0];
  455. return 0;
  456. }
  457. static int msm_qti_pp_get_quat_mi2s_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  458. struct snd_ctl_elem_value *ucontrol)
  459. {
  460. ucontrol->value.integer.value[0] = msm_afe_quat_mi2s_lb_vol_ctrl;
  461. return 0;
  462. }
  463. static int msm_qti_pp_set_quat_mi2s_fm_vol_mixer(struct snd_kcontrol *kcontrol,
  464. struct snd_ctl_elem_value *ucontrol)
  465. {
  466. afe_loopback_gain(AFE_PORT_ID_QUATERNARY_MI2S_TX,
  467. ucontrol->value.integer.value[0]);
  468. msm_afe_quat_mi2s_lb_vol_ctrl = ucontrol->value.integer.value[0];
  469. return 0;
  470. }
  471. static int msm_qti_pp_get_hfp_vol_mixer(struct snd_kcontrol *kcontrol,
  472. struct snd_ctl_elem_value *ucontrol)
  473. {
  474. ucontrol->value.integer.value[0] = msm_route_hfp_vol_control;
  475. return 0;
  476. }
  477. static int msm_qti_pp_set_hfp_vol_mixer(struct snd_kcontrol *kcontrol,
  478. struct snd_ctl_elem_value *ucontrol)
  479. {
  480. afe_loopback_gain(INT_BT_SCO_TX, ucontrol->value.integer.value[0]);
  481. msm_route_hfp_vol_control = ucontrol->value.integer.value[0];
  482. return 0;
  483. }
  484. static int msm_qti_pp_get_pri_auxpcm_lb_vol_mixer(
  485. struct snd_kcontrol *kcontrol,
  486. struct snd_ctl_elem_value *ucontrol)
  487. {
  488. ucontrol->value.integer.value[0] = msm_route_pri_auxpcm_lb_vol_ctrl;
  489. pr_debug("%s: Volume = %ld\n", __func__,
  490. ucontrol->value.integer.value[0]);
  491. return 0;
  492. }
  493. static int msm_qti_pp_set_pri_auxpcm_lb_vol_mixer(
  494. struct snd_kcontrol *kcontrol,
  495. struct snd_ctl_elem_value *ucontrol)
  496. {
  497. struct soc_mixer_control *mc =
  498. (struct soc_mixer_control *)kcontrol->private_value;
  499. afe_loopback_gain(mc->reg, ucontrol->value.integer.value[0]);
  500. msm_route_pri_auxpcm_lb_vol_ctrl = ucontrol->value.integer.value[0];
  501. return 0;
  502. }
  503. static int msm_qti_pp_get_sec_auxpcm_lb_vol_mixer(
  504. struct snd_kcontrol *kcontrol,
  505. struct snd_ctl_elem_value *ucontrol)
  506. {
  507. ucontrol->value.integer.value[0] = msm_route_sec_auxpcm_lb_vol_ctrl;
  508. pr_debug("%s: Volume = %ld\n", __func__,
  509. ucontrol->value.integer.value[0]);
  510. return 0;
  511. }
  512. static int msm_qti_pp_set_sec_auxpcm_lb_vol_mixer(
  513. struct snd_kcontrol *kcontrol,
  514. struct snd_ctl_elem_value *ucontrol)
  515. {
  516. struct soc_mixer_control *mc =
  517. (struct soc_mixer_control *)kcontrol->private_value;
  518. afe_loopback_gain(mc->reg, ucontrol->value.integer.value[0]);
  519. msm_route_sec_auxpcm_lb_vol_ctrl = ucontrol->value.integer.value[0];
  520. return 0;
  521. }
  522. static int msm_qti_pp_get_channel_map_mixer(struct snd_kcontrol *kcontrol,
  523. struct snd_ctl_elem_value *ucontrol)
  524. {
  525. char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL] = {0};
  526. int i;
  527. adm_get_multi_ch_map(channel_map, ADM_PATH_PLAYBACK);
  528. for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
  529. ucontrol->value.integer.value[i] =
  530. (unsigned int) channel_map[i];
  531. return 0;
  532. }
  533. static int msm_qti_pp_put_channel_map_mixer(struct snd_kcontrol *kcontrol,
  534. struct snd_ctl_elem_value *ucontrol)
  535. {
  536. char channel_map[PCM_FORMAT_MAX_NUM_CHANNEL];
  537. int i;
  538. for (i = 0; i < PCM_FORMAT_MAX_NUM_CHANNEL; i++)
  539. channel_map[i] = (char)(ucontrol->value.integer.value[i]);
  540. adm_set_multi_ch_map(channel_map, ADM_PATH_PLAYBACK);
  541. return 0;
  542. }
  543. /* Audio Sphere functions */
  544. static void msm_qti_pp_asphere_init_state(void)
  545. {
  546. int i;
  547. if (asphere_state.initialized)
  548. return;
  549. asphere_state.initialized = true;
  550. for (i = 0; i < AFE_MAX_PORTS; i++) {
  551. asphere_state.port_id[i] = -1;
  552. asphere_state.copp_idx[i] = -1;
  553. }
  554. asphere_state.enabled = 0;
  555. asphere_state.strength = 0;
  556. asphere_state.mode = 0;
  557. asphere_state.version = 0;
  558. asphere_state.enabled_prev = 0;
  559. asphere_state.strength_prev = 0;
  560. }
  561. static int msm_qti_pp_asphere_send_params(int port_id, int copp_idx, bool force)
  562. {
  563. char *params_value = NULL;
  564. uint32_t *update_params_value = NULL;
  565. uint32_t param_size = sizeof(uint32_t) +
  566. sizeof(struct adm_param_data_v5);
  567. int params_length = 0, param_count = 0, ret = 0;
  568. bool set_enable = force ||
  569. (asphere_state.enabled != asphere_state.enabled_prev);
  570. bool set_strength = asphere_state.enabled == 1 && (set_enable ||
  571. (asphere_state.strength != asphere_state.strength_prev));
  572. if (set_enable)
  573. param_count++;
  574. if (set_strength)
  575. param_count++;
  576. params_length = param_count * param_size;
  577. pr_debug("%s: port_id %d, copp_id %d, forced %d, param_count %d\n",
  578. __func__, port_id, copp_idx, force, param_count);
  579. pr_debug("%s: enable prev:%u cur:%u, strength prev:%u cur:%u\n",
  580. __func__, asphere_state.enabled_prev, asphere_state.enabled,
  581. asphere_state.strength_prev, asphere_state.strength);
  582. if (params_length > 0)
  583. params_value = kzalloc(params_length, GFP_KERNEL);
  584. if (!params_value) {
  585. pr_err("%s, params memory alloc failed\n", __func__);
  586. return -ENOMEM;
  587. }
  588. update_params_value = (uint32_t *)params_value;
  589. params_length = 0;
  590. if (set_strength) {
  591. /* add strength command */
  592. *update_params_value++ = AUDPROC_MODULE_ID_AUDIOSPHERE;
  593. *update_params_value++ = AUDPROC_PARAM_ID_AUDIOSPHERE_STRENGTH;
  594. *update_params_value++ = sizeof(uint32_t);
  595. *update_params_value++ = asphere_state.strength;
  596. params_length += param_size;
  597. }
  598. if (set_enable) {
  599. /* add enable command */
  600. *update_params_value++ = AUDPROC_MODULE_ID_AUDIOSPHERE;
  601. *update_params_value++ = AUDPROC_PARAM_ID_AUDIOSPHERE_ENABLE;
  602. *update_params_value++ = sizeof(uint32_t);
  603. *update_params_value++ = asphere_state.enabled;
  604. params_length += param_size;
  605. }
  606. pr_debug("%s, param length: %d\n", __func__, params_length);
  607. if (params_length) {
  608. ret = adm_send_params_v5(port_id, copp_idx,
  609. params_value, params_length);
  610. if (ret) {
  611. pr_err("%s: setting param failed with err=%d\n",
  612. __func__, ret);
  613. kfree(params_value);
  614. return -EINVAL;
  615. }
  616. }
  617. kfree(params_value);
  618. return 0;
  619. }
  620. #if defined(CONFIG_QTI_PP) && defined(CONFIG_QTI_PP_AUDIOSPHERE)
  621. int msm_qti_pp_asphere_init(int port_id, int copp_idx)
  622. {
  623. int index = adm_validate_and_get_port_index(port_id);
  624. pr_debug("%s, port_id %d, copp_id %d\n", __func__, port_id, copp_idx);
  625. if (index < 0) {
  626. pr_err("%s: Invalid port idx %d port_id %#x\n", __func__, index,
  627. port_id);
  628. return -EINVAL;
  629. }
  630. msm_qti_pp_asphere_init_state();
  631. asphere_state.port_id[index] = port_id;
  632. asphere_state.copp_idx[index] = copp_idx;
  633. if (asphere_state.enabled)
  634. msm_qti_pp_asphere_send_params(port_id, copp_idx, true);
  635. return 0;
  636. }
  637. void msm_qti_pp_asphere_deinit(int port_id)
  638. {
  639. int index = adm_validate_and_get_port_index(port_id);
  640. pr_debug("%s, port_id %d\n", __func__, port_id);
  641. if (index < 0) {
  642. pr_err("%s: Invalid port idx %d port_id %#x\n", __func__, index,
  643. port_id);
  644. return;
  645. }
  646. if (asphere_state.port_id[index] == port_id) {
  647. asphere_state.port_id[index] = -1;
  648. asphere_state.copp_idx[index] = -1;
  649. }
  650. }
  651. #endif
  652. static int msm_qti_pp_asphere_get(struct snd_kcontrol *kcontrol,
  653. struct snd_ctl_elem_value *ucontrol)
  654. {
  655. if (!asphere_state.initialized)
  656. return -EAGAIN;
  657. ucontrol->value.integer.value[0] = asphere_state.enabled;
  658. ucontrol->value.integer.value[1] = asphere_state.strength;
  659. pr_debug("%s, enable %u, strength %u\n", __func__,
  660. asphere_state.enabled, asphere_state.strength);
  661. return 0;
  662. }
  663. static int msm_qti_pp_asphere_set(struct snd_kcontrol *kcontrol,
  664. struct snd_ctl_elem_value *ucontrol)
  665. {
  666. int32_t enable = ucontrol->value.integer.value[0];
  667. int32_t strength = ucontrol->value.integer.value[1];
  668. int i;
  669. pr_debug("%s, enable %u, strength %u\n", __func__, enable, strength);
  670. msm_qti_pp_asphere_init_state();
  671. if (enable == 0 || enable == 1) {
  672. asphere_state.enabled_prev = asphere_state.enabled;
  673. asphere_state.enabled = enable;
  674. }
  675. if (strength >= 0 && strength <= 1000) {
  676. asphere_state.strength_prev = asphere_state.strength;
  677. asphere_state.strength = strength;
  678. }
  679. if (asphere_state.strength != asphere_state.strength_prev ||
  680. asphere_state.enabled != asphere_state.enabled_prev) {
  681. for (i = 0; i < AFE_MAX_PORTS; i++) {
  682. if (asphere_state.port_id[i] >= 0)
  683. msm_qti_pp_asphere_send_params(
  684. asphere_state.port_id[i],
  685. asphere_state.copp_idx[i],
  686. false);
  687. }
  688. }
  689. return 0;
  690. }
  691. int msm_adsp_init_mixer_ctl_pp_event_queue(struct snd_soc_pcm_runtime *rtd)
  692. {
  693. struct snd_kcontrol *kctl;
  694. const char *deviceNo = "NN";
  695. char *mixer_str = NULL;
  696. int ctl_len = 0, ret = 0;
  697. const char *mixer_ctl_name = DSP_STREAM_CALLBACK;
  698. struct dsp_stream_callback_prtd *kctl_prtd = NULL;
  699. if (!rtd) {
  700. pr_err("%s: rtd is NULL\n", __func__);
  701. ret = -EINVAL;
  702. goto done;
  703. }
  704. ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1;
  705. mixer_str = kzalloc(ctl_len, GFP_KERNEL);
  706. if (!mixer_str) {
  707. ret = -EINVAL;
  708. goto done;
  709. }
  710. snprintf(mixer_str, ctl_len, "%s %d", mixer_ctl_name,
  711. rtd->pcm->device);
  712. kctl = snd_soc_card_get_kcontrol(rtd->card, mixer_str);
  713. kfree(mixer_str);
  714. if (!kctl) {
  715. pr_err("%s: failed to get kctl.\n", __func__);
  716. ret = -EINVAL;
  717. goto done;
  718. }
  719. if (kctl->private_data != NULL) {
  720. pr_err("%s: kctl_prtd is not NULL at initialization.\n",
  721. __func__);
  722. return -EINVAL;
  723. }
  724. kctl_prtd = kzalloc(sizeof(struct dsp_stream_callback_prtd),
  725. GFP_KERNEL);
  726. if (!kctl_prtd) {
  727. ret = -ENOMEM;
  728. goto done;
  729. }
  730. spin_lock_init(&kctl_prtd->prtd_spin_lock);
  731. INIT_LIST_HEAD(&kctl_prtd->event_queue);
  732. kctl_prtd->event_count = 0;
  733. kctl->private_data = kctl_prtd;
  734. done:
  735. return ret;
  736. }
  737. int msm_adsp_clean_mixer_ctl_pp_event_queue(struct snd_soc_pcm_runtime *rtd)
  738. {
  739. struct snd_kcontrol *kctl;
  740. const char *deviceNo = "NN";
  741. char *mixer_str = NULL;
  742. int ctl_len = 0, ret = 0;
  743. struct dsp_stream_callback_list *node, *n;
  744. unsigned long spin_flags;
  745. const char *mixer_ctl_name = DSP_STREAM_CALLBACK;
  746. struct dsp_stream_callback_prtd *kctl_prtd = NULL;
  747. if (!rtd) {
  748. pr_err("%s: rtd is NULL\n", __func__);
  749. ret = -EINVAL;
  750. goto done;
  751. }
  752. ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1;
  753. mixer_str = kzalloc(ctl_len, GFP_KERNEL);
  754. if (!mixer_str) {
  755. ret = -EINVAL;
  756. goto done;
  757. }
  758. snprintf(mixer_str, ctl_len, "%s %d", mixer_ctl_name,
  759. rtd->pcm->device);
  760. kctl = snd_soc_card_get_kcontrol(rtd->card, mixer_str);
  761. kfree(mixer_str);
  762. if (!kctl) {
  763. pr_err("%s: failed to get kctl.\n", __func__);
  764. ret = -EINVAL;
  765. goto done;
  766. }
  767. kctl_prtd = (struct dsp_stream_callback_prtd *)
  768. kctl->private_data;
  769. if (kctl_prtd != NULL) {
  770. spin_lock_irqsave(&kctl_prtd->prtd_spin_lock, spin_flags);
  771. /* clean the queue */
  772. list_for_each_entry_safe(node, n,
  773. &kctl_prtd->event_queue, list) {
  774. list_del(&node->list);
  775. kctl_prtd->event_count--;
  776. pr_debug("%s: %d remaining events after del.\n",
  777. __func__, kctl_prtd->event_count);
  778. kfree(node);
  779. }
  780. spin_unlock_irqrestore(&kctl_prtd->prtd_spin_lock, spin_flags);
  781. }
  782. kfree(kctl_prtd);
  783. kctl->private_data = NULL;
  784. done:
  785. return ret;
  786. }
  787. int msm_adsp_inform_mixer_ctl(struct snd_soc_pcm_runtime *rtd,
  788. uint32_t *payload)
  789. {
  790. /* adsp pp event notifier */
  791. struct snd_kcontrol *kctl;
  792. struct snd_ctl_elem_value control;
  793. const char *deviceNo = "NN";
  794. char *mixer_str = NULL;
  795. int ctl_len = 0, ret = 0;
  796. struct dsp_stream_callback_list *new_event;
  797. struct dsp_stream_callback_list *oldest_event;
  798. unsigned long spin_flags;
  799. struct dsp_stream_callback_prtd *kctl_prtd = NULL;
  800. struct msm_adsp_event_data *event_data = NULL;
  801. const char *mixer_ctl_name = DSP_STREAM_CALLBACK;
  802. struct snd_ctl_elem_info kctl_info;
  803. if (!rtd || !payload) {
  804. pr_err("%s: %s is NULL\n", __func__,
  805. (!rtd) ? "rtd" : "payload");
  806. ret = -EINVAL;
  807. goto done;
  808. }
  809. if (rtd->card->snd_card == NULL) {
  810. pr_err("%s: snd_card is null.\n", __func__);
  811. ret = -EINVAL;
  812. goto done;
  813. }
  814. ctl_len = strlen(mixer_ctl_name) + 1 + strlen(deviceNo) + 1;
  815. mixer_str = kzalloc(ctl_len, GFP_ATOMIC);
  816. if (!mixer_str) {
  817. ret = -EINVAL;
  818. goto done;
  819. }
  820. snprintf(mixer_str, ctl_len, "%s %d", mixer_ctl_name,
  821. rtd->pcm->device);
  822. kctl = snd_soc_card_get_kcontrol(rtd->card, mixer_str);
  823. kfree(mixer_str);
  824. if (!kctl) {
  825. pr_err("%s: failed to get kctl.\n", __func__);
  826. ret = -EINVAL;
  827. goto done;
  828. }
  829. event_data = (struct msm_adsp_event_data *)payload;
  830. kctl->info(kctl, &kctl_info);
  831. if (sizeof(struct msm_adsp_event_data)
  832. + event_data->payload_len > kctl_info.count) {
  833. pr_err("%s: payload length exceeds limit of %u bytes.\n",
  834. __func__, kctl_info.count);
  835. ret = -EINVAL;
  836. goto done;
  837. }
  838. kctl_prtd = (struct dsp_stream_callback_prtd *)
  839. kctl->private_data;
  840. if (kctl_prtd == NULL) {
  841. /* queue is not initialized */
  842. ret = -EINVAL;
  843. pr_err("%s: event queue is not initialized.\n", __func__);
  844. goto done;
  845. }
  846. new_event = kzalloc(sizeof(struct dsp_stream_callback_list)
  847. + event_data->payload_len,
  848. GFP_ATOMIC);
  849. if (new_event == NULL) {
  850. ret = -ENOMEM;
  851. goto done;
  852. }
  853. memcpy((void *)&new_event->event, (void *)payload,
  854. event_data->payload_len
  855. + sizeof(struct msm_adsp_event_data));
  856. spin_lock_irqsave(&kctl_prtd->prtd_spin_lock, spin_flags);
  857. while (kctl_prtd->event_count >= DSP_STREAM_CALLBACK_QUEUE_SIZE) {
  858. pr_info("%s: queue of size %d is full. delete oldest one.\n",
  859. __func__, DSP_STREAM_CALLBACK_QUEUE_SIZE);
  860. oldest_event = list_first_entry(&kctl_prtd->event_queue,
  861. struct dsp_stream_callback_list, list);
  862. pr_info("%s: event deleted: type %d length %d\n",
  863. __func__, oldest_event->event.event_type,
  864. oldest_event->event.payload_len);
  865. list_del(&oldest_event->list);
  866. kctl_prtd->event_count--;
  867. kfree(oldest_event);
  868. }
  869. list_add_tail(&new_event->list, &kctl_prtd->event_queue);
  870. kctl_prtd->event_count++;
  871. spin_unlock_irqrestore(&kctl_prtd->prtd_spin_lock, spin_flags);
  872. control.id = kctl->id;
  873. snd_ctl_notify(rtd->card->snd_card,
  874. SNDRV_CTL_EVENT_MASK_INFO,
  875. &control.id);
  876. done:
  877. return ret;
  878. }
  879. int msm_adsp_stream_cmd_info(struct snd_kcontrol *kcontrol,
  880. struct snd_ctl_elem_info *uinfo)
  881. {
  882. uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
  883. uinfo->count =
  884. sizeof(((struct snd_ctl_elem_value *)0)->value.bytes.data);
  885. return 0;
  886. }
  887. int msm_adsp_stream_callback_get(struct snd_kcontrol *kcontrol,
  888. struct snd_ctl_elem_value *ucontrol)
  889. {
  890. uint32_t payload_size = 0;
  891. struct dsp_stream_callback_list *oldest_event;
  892. unsigned long spin_flags;
  893. struct dsp_stream_callback_prtd *kctl_prtd = NULL;
  894. int ret = 0;
  895. kctl_prtd = (struct dsp_stream_callback_prtd *)
  896. kcontrol->private_data;
  897. if (kctl_prtd == NULL) {
  898. pr_err("%s: ASM Stream PP event queue is not initialized.\n",
  899. __func__);
  900. ret = -EINVAL;
  901. goto done;
  902. }
  903. spin_lock_irqsave(&kctl_prtd->prtd_spin_lock, spin_flags);
  904. pr_debug("%s: %d events in queue.\n", __func__, kctl_prtd->event_count);
  905. if (list_empty(&kctl_prtd->event_queue)) {
  906. pr_err("%s: ASM Stream PP event queue is empty.\n", __func__);
  907. ret = -EINVAL;
  908. spin_unlock_irqrestore(&kctl_prtd->prtd_spin_lock, spin_flags);
  909. goto done;
  910. }
  911. oldest_event = list_first_entry(&kctl_prtd->event_queue,
  912. struct dsp_stream_callback_list, list);
  913. list_del(&oldest_event->list);
  914. kctl_prtd->event_count--;
  915. spin_unlock_irqrestore(&kctl_prtd->prtd_spin_lock, spin_flags);
  916. payload_size = oldest_event->event.payload_len;
  917. pr_debug("%s: event fetched: type %d length %d\n",
  918. __func__, oldest_event->event.event_type,
  919. oldest_event->event.payload_len);
  920. memcpy(ucontrol->value.bytes.data, &oldest_event->event,
  921. sizeof(struct msm_adsp_event_data) + payload_size);
  922. kfree(oldest_event);
  923. done:
  924. return ret;
  925. }
  926. int msm_adsp_stream_callback_info(struct snd_kcontrol *kcontrol,
  927. struct snd_ctl_elem_info *uinfo)
  928. {
  929. uinfo->type = SNDRV_CTL_ELEM_TYPE_BYTES;
  930. uinfo->count =
  931. sizeof(((struct snd_ctl_elem_value *)0)->value.bytes.data);
  932. return 0;
  933. }
  934. static int msm_multichannel_ec_primary_mic_ch_put(struct snd_kcontrol *kcontrol,
  935. struct snd_ctl_elem_value *ucontrol)
  936. {
  937. int ret = 0;
  938. int copp_idx = 0;
  939. int port_id = AFE_PORT_ID_QUATERNARY_TDM_TX;
  940. msm_multichannel_ec_primary_mic_ch = ucontrol->value.integer.value[0];
  941. pr_debug("%s: msm_multichannel_ec_primary_mic_ch = %u\n",
  942. __func__, msm_multichannel_ec_primary_mic_ch);
  943. copp_idx = adm_get_default_copp_idx(port_id);
  944. if ((copp_idx < 0) || (copp_idx > MAX_COPPS_PER_PORT)) {
  945. pr_err("%s : no active copp to query multichannel ec copp_idx: %u\n",
  946. __func__, copp_idx);
  947. return -EINVAL;
  948. }
  949. adm_send_set_multichannel_ec_primary_mic_ch(port_id, copp_idx,
  950. msm_multichannel_ec_primary_mic_ch);
  951. return ret;
  952. }
  953. static int msm_multichannel_ec_primary_mic_ch_get(struct snd_kcontrol *kcontrol,
  954. struct snd_ctl_elem_value *ucontrol)
  955. {
  956. ucontrol->value.integer.value[0] = msm_multichannel_ec_primary_mic_ch;
  957. pr_debug("%s: msm_multichannel_ec_primary_mic_ch = %lu\n",
  958. __func__, ucontrol->value.integer.value[0]);
  959. return 0;
  960. }
  961. static const struct snd_kcontrol_new msm_multichannel_ec_controls[] = {
  962. SOC_SINGLE_EXT("Multichannel EC Primary Mic Ch", SND_SOC_NOPM, 0,
  963. 0xFFFFFFFF, 0, msm_multichannel_ec_primary_mic_ch_get,
  964. msm_multichannel_ec_primary_mic_ch_put),
  965. };
  966. static const struct snd_kcontrol_new int_fm_vol_mixer_controls[] = {
  967. SOC_SINGLE_EXT_TLV("Internal FM RX Volume", SND_SOC_NOPM, 0,
  968. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_fm_vol_mixer,
  969. msm_qti_pp_set_fm_vol_mixer, fm_rx_vol_gain),
  970. SOC_SINGLE_EXT_TLV("Quat MI2S FM RX Volume", SND_SOC_NOPM, 0,
  971. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_quat_mi2s_fm_vol_mixer,
  972. msm_qti_pp_set_quat_mi2s_fm_vol_mixer, fm_rx_vol_gain),
  973. };
  974. static const struct snd_kcontrol_new pri_mi2s_lb_vol_mixer_controls[] = {
  975. SOC_SINGLE_EXT_TLV("PRI MI2S LOOPBACK Volume", SND_SOC_NOPM, 0,
  976. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_pri_mi2s_lb_vol_mixer,
  977. msm_qti_pp_set_pri_mi2s_lb_vol_mixer, afe_lb_vol_gain),
  978. };
  979. static const struct snd_kcontrol_new sec_mi2s_lb_vol_mixer_controls[] = {
  980. SOC_SINGLE_EXT_TLV("SEC MI2S LOOPBACK Volume", SND_SOC_NOPM, 0,
  981. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_sec_mi2s_lb_vol_mixer,
  982. msm_qti_pp_set_sec_mi2s_lb_vol_mixer, afe_lb_vol_gain),
  983. };
  984. static const struct snd_kcontrol_new tert_mi2s_lb_vol_mixer_controls[] = {
  985. SOC_SINGLE_EXT_TLV("Tert MI2S LOOPBACK Volume", SND_SOC_NOPM, 0,
  986. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_tert_mi2s_lb_vol_mixer,
  987. msm_qti_pp_set_tert_mi2s_lb_vol_mixer, afe_lb_vol_gain),
  988. };
  989. static const struct snd_kcontrol_new slimbus_7_lb_vol_mixer_controls[] = {
  990. SOC_SINGLE_EXT_TLV("SLIMBUS_7 LOOPBACK Volume", SND_SOC_NOPM, 0,
  991. INT_RX_VOL_GAIN, 0,
  992. msm_qti_pp_get_slimbus_7_lb_vol_mixer,
  993. msm_qti_pp_set_slimbus_7_lb_vol_mixer,
  994. afe_lb_vol_gain),
  995. };
  996. static const struct snd_kcontrol_new slimbus_8_lb_vol_mixer_controls[] = {
  997. SOC_SINGLE_EXT_TLV("SLIMBUS_8 LOOPBACK Volume", SND_SOC_NOPM, 0,
  998. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_slimbus_8_lb_vol_mixer,
  999. msm_qti_pp_set_slimbus_8_lb_vol_mixer, afe_lb_vol_gain),
  1000. };
  1001. static const struct snd_kcontrol_new int_hfp_vol_mixer_controls[] = {
  1002. SOC_SINGLE_EXT_TLV("Internal HFP RX Volume", SND_SOC_NOPM, 0,
  1003. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_hfp_vol_mixer,
  1004. msm_qti_pp_set_hfp_vol_mixer, hfp_rx_vol_gain),
  1005. };
  1006. static const struct snd_kcontrol_new int_icc_vol_mixer_controls[] = {
  1007. SOC_SINGLE_EXT_TLV("Internal ICC Volume", SND_SOC_NOPM, 0,
  1008. INT_RX_VOL_GAIN, 0, msm_qti_pp_get_icc_vol_mixer,
  1009. msm_qti_pp_set_icc_vol_mixer, icc_rx_vol_gain),
  1010. };
  1011. static const struct snd_kcontrol_new pri_auxpcm_lb_vol_mixer_controls[] = {
  1012. SOC_SINGLE_EXT_TLV("PRI AUXPCM LOOPBACK Volume",
  1013. AFE_PORT_ID_PRIMARY_PCM_TX, 0, INT_RX_VOL_GAIN, 0,
  1014. msm_qti_pp_get_pri_auxpcm_lb_vol_mixer,
  1015. msm_qti_pp_set_pri_auxpcm_lb_vol_mixer,
  1016. pri_auxpcm_lb_vol_gain),
  1017. };
  1018. static const struct snd_kcontrol_new sec_auxpcm_lb_vol_mixer_controls[] = {
  1019. SOC_SINGLE_EXT_TLV("SEC AUXPCM LOOPBACK Volume",
  1020. AFE_PORT_ID_SECONDARY_PCM_TX, 0, INT_RX_VOL_GAIN, 0,
  1021. msm_qti_pp_get_sec_auxpcm_lb_vol_mixer,
  1022. msm_qti_pp_set_sec_auxpcm_lb_vol_mixer,
  1023. sec_auxpcm_lb_vol_gain),
  1024. };
  1025. static const struct snd_kcontrol_new multi_ch_channel_map_mixer_controls[] = {
  1026. SOC_SINGLE_MULTI_EXT("Playback Device Channel Map", SND_SOC_NOPM, 0, 16,
  1027. 0, 8, msm_qti_pp_get_channel_map_mixer,
  1028. msm_qti_pp_put_channel_map_mixer),
  1029. };
  1030. static const struct snd_kcontrol_new get_rms_controls[] = {
  1031. SOC_SINGLE_EXT("Get RMS", SND_SOC_NOPM, 0, 0xFFFFFFFF,
  1032. 0, msm_qti_pp_get_rms_value_control, msm_qti_pp_put_rms_value_control),
  1033. };
  1034. static const struct snd_kcontrol_new eq_enable_mixer_controls[] = {
  1035. SOC_SINGLE_EXT("MultiMedia1 EQ Enable", SND_SOC_NOPM,
  1036. MSM_FRONTEND_DAI_MULTIMEDIA1, 1, 0, msm_qti_pp_get_eq_enable_mixer,
  1037. msm_qti_pp_put_eq_enable_mixer),
  1038. SOC_SINGLE_EXT("MultiMedia2 EQ Enable", SND_SOC_NOPM,
  1039. MSM_FRONTEND_DAI_MULTIMEDIA2, 1, 0, msm_qti_pp_get_eq_enable_mixer,
  1040. msm_qti_pp_put_eq_enable_mixer),
  1041. SOC_SINGLE_EXT("MultiMedia3 EQ Enable", SND_SOC_NOPM,
  1042. MSM_FRONTEND_DAI_MULTIMEDIA3, 1, 0, msm_qti_pp_get_eq_enable_mixer,
  1043. msm_qti_pp_put_eq_enable_mixer),
  1044. };
  1045. static const struct snd_kcontrol_new eq_band_mixer_controls[] = {
  1046. SOC_SINGLE_EXT("MultiMedia1 EQ Band Count", SND_SOC_NOPM,
  1047. MSM_FRONTEND_DAI_MULTIMEDIA1, 11, 0,
  1048. msm_qti_pp_get_eq_band_count_audio_mixer,
  1049. msm_qti_pp_put_eq_band_count_audio_mixer),
  1050. SOC_SINGLE_EXT("MultiMedia2 EQ Band Count", SND_SOC_NOPM,
  1051. MSM_FRONTEND_DAI_MULTIMEDIA2, 11, 0,
  1052. msm_qti_pp_get_eq_band_count_audio_mixer,
  1053. msm_qti_pp_put_eq_band_count_audio_mixer),
  1054. SOC_SINGLE_EXT("MultiMedia3 EQ Band Count", SND_SOC_NOPM,
  1055. MSM_FRONTEND_DAI_MULTIMEDIA3, 11, 0,
  1056. msm_qti_pp_get_eq_band_count_audio_mixer,
  1057. msm_qti_pp_put_eq_band_count_audio_mixer),
  1058. };
  1059. static const struct snd_kcontrol_new eq_coeff_mixer_controls[] = {
  1060. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band1", EQ_BAND1,
  1061. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1062. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1063. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band2", EQ_BAND2,
  1064. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1065. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1066. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band3", EQ_BAND3,
  1067. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1068. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1069. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band4", EQ_BAND4,
  1070. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1071. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1072. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band5", EQ_BAND5,
  1073. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1074. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1075. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band6", EQ_BAND6,
  1076. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1077. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1078. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band7", EQ_BAND7,
  1079. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1080. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1081. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band8", EQ_BAND8,
  1082. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1083. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1084. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band9", EQ_BAND9,
  1085. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1086. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1087. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band10", EQ_BAND10,
  1088. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1089. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1090. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band11", EQ_BAND11,
  1091. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1092. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1093. SOC_SINGLE_MULTI_EXT("MultiMedia1 EQ Band12", EQ_BAND12,
  1094. MSM_FRONTEND_DAI_MULTIMEDIA1, 255, 0, 5,
  1095. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1096. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band1", EQ_BAND1,
  1097. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1098. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1099. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band2", EQ_BAND2,
  1100. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1101. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1102. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band3", EQ_BAND3,
  1103. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1104. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1105. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band4", EQ_BAND4,
  1106. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1107. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1108. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band5", EQ_BAND5,
  1109. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1110. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1111. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band6", EQ_BAND6,
  1112. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1113. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1114. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band7", EQ_BAND7,
  1115. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1116. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1117. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band8", EQ_BAND8,
  1118. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1119. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1120. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band9", EQ_BAND9,
  1121. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1122. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1123. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band10", EQ_BAND10,
  1124. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1125. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1126. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band11", EQ_BAND11,
  1127. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1128. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1129. SOC_SINGLE_MULTI_EXT("MultiMedia2 EQ Band12", EQ_BAND12,
  1130. MSM_FRONTEND_DAI_MULTIMEDIA2, 255, 0, 5,
  1131. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1132. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band1", EQ_BAND1,
  1133. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1134. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1135. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band2", EQ_BAND2,
  1136. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1137. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1138. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band3", EQ_BAND3,
  1139. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1140. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1141. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band4", EQ_BAND4,
  1142. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1143. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1144. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band5", EQ_BAND5,
  1145. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1146. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1147. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band6", EQ_BAND6,
  1148. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1149. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1150. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band7", EQ_BAND7,
  1151. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1152. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1153. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band8", EQ_BAND8,
  1154. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1155. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1156. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band9", EQ_BAND9,
  1157. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1158. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1159. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band10", EQ_BAND10,
  1160. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1161. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1162. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band11", EQ_BAND11,
  1163. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1164. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1165. SOC_SINGLE_MULTI_EXT("MultiMedia3 EQ Band12", EQ_BAND12,
  1166. MSM_FRONTEND_DAI_MULTIMEDIA3, 255, 0, 5,
  1167. msm_qti_pp_get_eq_band_audio_mixer, msm_qti_pp_put_eq_band_audio_mixer),
  1168. };
  1169. static const struct snd_kcontrol_new asphere_mixer_controls[] = {
  1170. SOC_SINGLE_MULTI_EXT("MSM ASphere Set Param", SND_SOC_NOPM, 0,
  1171. 0xFFFFFFFF, 0, 2, msm_qti_pp_asphere_get, msm_qti_pp_asphere_set),
  1172. };
  1173. #ifdef CONFIG_QTI_PP
  1174. void msm_qti_pp_add_controls(struct snd_soc_platform *platform)
  1175. {
  1176. snd_soc_add_platform_controls(platform, int_fm_vol_mixer_controls,
  1177. ARRAY_SIZE(int_fm_vol_mixer_controls));
  1178. snd_soc_add_platform_controls(platform, pri_mi2s_lb_vol_mixer_controls,
  1179. ARRAY_SIZE(pri_mi2s_lb_vol_mixer_controls));
  1180. snd_soc_add_platform_controls(platform, sec_mi2s_lb_vol_mixer_controls,
  1181. ARRAY_SIZE(sec_mi2s_lb_vol_mixer_controls));
  1182. snd_soc_add_platform_controls(platform, tert_mi2s_lb_vol_mixer_controls,
  1183. ARRAY_SIZE(tert_mi2s_lb_vol_mixer_controls));
  1184. snd_soc_add_platform_controls(platform, slimbus_7_lb_vol_mixer_controls,
  1185. ARRAY_SIZE(slimbus_7_lb_vol_mixer_controls));
  1186. snd_soc_add_platform_controls(platform, slimbus_8_lb_vol_mixer_controls,
  1187. ARRAY_SIZE(slimbus_8_lb_vol_mixer_controls));
  1188. snd_soc_add_platform_controls(platform, int_hfp_vol_mixer_controls,
  1189. ARRAY_SIZE(int_hfp_vol_mixer_controls));
  1190. snd_soc_add_platform_controls(platform, int_icc_vol_mixer_controls,
  1191. ARRAY_SIZE(int_icc_vol_mixer_controls));
  1192. snd_soc_add_platform_controls(platform,
  1193. pri_auxpcm_lb_vol_mixer_controls,
  1194. ARRAY_SIZE(pri_auxpcm_lb_vol_mixer_controls));
  1195. snd_soc_add_platform_controls(platform,
  1196. sec_auxpcm_lb_vol_mixer_controls,
  1197. ARRAY_SIZE(sec_auxpcm_lb_vol_mixer_controls));
  1198. snd_soc_add_platform_controls(platform,
  1199. multi_ch_channel_map_mixer_controls,
  1200. ARRAY_SIZE(multi_ch_channel_map_mixer_controls));
  1201. snd_soc_add_platform_controls(platform, get_rms_controls,
  1202. ARRAY_SIZE(get_rms_controls));
  1203. snd_soc_add_platform_controls(platform, eq_enable_mixer_controls,
  1204. ARRAY_SIZE(eq_enable_mixer_controls));
  1205. snd_soc_add_platform_controls(platform, eq_band_mixer_controls,
  1206. ARRAY_SIZE(eq_band_mixer_controls));
  1207. snd_soc_add_platform_controls(platform, eq_coeff_mixer_controls,
  1208. ARRAY_SIZE(eq_coeff_mixer_controls));
  1209. snd_soc_add_platform_controls(platform, asphere_mixer_controls,
  1210. ARRAY_SIZE(asphere_mixer_controls));
  1211. snd_soc_add_platform_controls(platform, msm_multichannel_ec_controls,
  1212. ARRAY_SIZE(msm_multichannel_ec_controls));
  1213. }
  1214. #endif /* CONFIG_QTI_PP */