msm-dai-fe.c 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. /* Copyright (c) 2012-2014, 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/init.h>
  13. #include <linux/module.h>
  14. #include <linux/device.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/of_device.h>
  17. #include <sound/core.h>
  18. #include <sound/pcm.h>
  19. #include <sound/soc.h>
  20. static struct snd_soc_dai_ops msm_fe_dai_ops = {};
  21. /* Conventional and unconventional sample rate supported */
  22. static unsigned int supported_sample_rates[] = {
  23. 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000,
  24. 88200, 96000, 176400, 192000
  25. };
  26. static struct snd_pcm_hw_constraint_list constraints_sample_rates = {
  27. .count = ARRAY_SIZE(supported_sample_rates),
  28. .list = supported_sample_rates,
  29. .mask = 0,
  30. };
  31. static int multimedia_startup(struct snd_pcm_substream *substream,
  32. struct snd_soc_dai *dai)
  33. {
  34. return snd_pcm_hw_constraint_list(substream->runtime, 0,
  35. SNDRV_PCM_HW_PARAM_RATE,
  36. &constraints_sample_rates);
  37. }
  38. static struct snd_soc_dai_ops msm_fe_Multimedia_dai_ops = {
  39. .startup = multimedia_startup,
  40. };
  41. static struct snd_soc_dai_driver msm_fe_dais[] = {
  42. {
  43. .playback = {
  44. .stream_name = "Multimedia1 Playback",
  45. .aif_name = "MM_DL1",
  46. .rates = (SNDRV_PCM_RATE_8000_192000|
  47. SNDRV_PCM_RATE_KNOT),
  48. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  49. SNDRV_PCM_FMTBIT_S24_LE),
  50. .channels_min = 1,
  51. .channels_max = 8,
  52. .rate_min = 8000,
  53. .rate_max = 192000,
  54. },
  55. .capture = {
  56. .stream_name = "Multimedia1 Capture",
  57. .aif_name = "MM_UL1",
  58. .rates = (SNDRV_PCM_RATE_8000_48000|
  59. SNDRV_PCM_RATE_KNOT),
  60. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  61. SNDRV_PCM_FMTBIT_S24_LE),
  62. .channels_min = 1,
  63. .channels_max = 4,
  64. .rate_min = 8000,
  65. .rate_max = 48000,
  66. },
  67. .ops = &msm_fe_Multimedia_dai_ops,
  68. .name = "MultiMedia1",
  69. },
  70. {
  71. .playback = {
  72. .stream_name = "Multimedia2 Playback",
  73. .aif_name = "MM_DL2",
  74. .rates = (SNDRV_PCM_RATE_8000_192000|
  75. SNDRV_PCM_RATE_KNOT),
  76. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  77. SNDRV_PCM_FMTBIT_S24_LE),
  78. .channels_min = 1,
  79. .channels_max = 8,
  80. .rate_min = 8000,
  81. .rate_max = 192000,
  82. },
  83. .capture = {
  84. .stream_name = "Multimedia2 Capture",
  85. .aif_name = "MM_UL2",
  86. .rates = (SNDRV_PCM_RATE_8000_48000|
  87. SNDRV_PCM_RATE_KNOT),
  88. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  89. .channels_min = 1,
  90. .channels_max = 8,
  91. .rate_min = 8000,
  92. .rate_max = 48000,
  93. },
  94. .ops = &msm_fe_Multimedia_dai_ops,
  95. .name = "MultiMedia2",
  96. },
  97. {
  98. .playback = {
  99. .stream_name = "Voice Playback",
  100. .aif_name = "CS-VOICE_DL1",
  101. .rates = SNDRV_PCM_RATE_8000_48000,
  102. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  103. .channels_min = 1,
  104. .channels_max = 2,
  105. .rate_min = 8000,
  106. .rate_max = 48000,
  107. },
  108. .capture = {
  109. .stream_name = "Voice Capture",
  110. .aif_name = "CS-VOICE_UL1",
  111. .rates = SNDRV_PCM_RATE_8000_48000,
  112. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  113. .channels_min = 1,
  114. .channels_max = 2,
  115. .rate_min = 8000,
  116. .rate_max = 48000,
  117. },
  118. .ops = &msm_fe_dai_ops,
  119. .name = "CS-VOICE",
  120. },
  121. {
  122. .playback = {
  123. .stream_name = "VoIP Playback",
  124. .aif_name = "VOIP_DL",
  125. .rates = SNDRV_PCM_RATE_8000_48000,
  126. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  127. SNDRV_PCM_FMTBIT_SPECIAL,
  128. .channels_min = 1,
  129. .channels_max = 2,
  130. .rate_min = 8000,
  131. .rate_max = 48000,
  132. },
  133. .capture = {
  134. .stream_name = "VoIP Capture",
  135. .aif_name = "VOIP_UL",
  136. .rates = SNDRV_PCM_RATE_8000_48000,
  137. .formats = SNDRV_PCM_FMTBIT_S16_LE |
  138. SNDRV_PCM_FMTBIT_SPECIAL,
  139. .channels_min = 1,
  140. .channels_max = 2,
  141. .rate_min = 8000,
  142. .rate_max = 48000,
  143. },
  144. .ops = &msm_fe_dai_ops,
  145. .name = "VoIP",
  146. },
  147. {
  148. .playback = {
  149. .stream_name = "MultiMedia3 Playback",
  150. .aif_name = "MM_DL3",
  151. .rates = (SNDRV_PCM_RATE_8000_192000 |
  152. SNDRV_PCM_RATE_KNOT),
  153. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  154. SNDRV_PCM_FMTBIT_S24_LE),
  155. .channels_min = 1,
  156. .channels_max = 6,
  157. .rate_min = 8000,
  158. .rate_max = 192000,
  159. },
  160. .ops = &msm_fe_Multimedia_dai_ops,
  161. .name = "MultiMedia3",
  162. },
  163. {
  164. .playback = {
  165. .stream_name = "MultiMedia4 Playback",
  166. .aif_name = "MM_DL4",
  167. .rates = (SNDRV_PCM_RATE_8000_192000 |
  168. SNDRV_PCM_RATE_KNOT),
  169. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  170. SNDRV_PCM_FMTBIT_S24_LE),
  171. .channels_min = 1,
  172. .channels_max = 8,
  173. .rate_min = 8000,
  174. .rate_max = 192000,
  175. },
  176. .capture = {
  177. .stream_name = "MultiMedia4 Capture",
  178. .aif_name = "MM_UL4",
  179. .rates = (SNDRV_PCM_RATE_8000_48000|
  180. SNDRV_PCM_RATE_KNOT),
  181. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  182. .channels_min = 1,
  183. .channels_max = 8,
  184. .rate_min = 8000,
  185. .rate_max = 48000,
  186. },
  187. .ops = &msm_fe_Multimedia_dai_ops,
  188. .compress_dai = 1,
  189. .name = "MultiMedia4",
  190. },
  191. {
  192. .playback = {
  193. .stream_name = "MultiMedia5 Playback",
  194. .aif_name = "MM_DL5",
  195. .rates = (SNDRV_PCM_RATE_8000_192000 |
  196. SNDRV_PCM_RATE_KNOT),
  197. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  198. SNDRV_PCM_FMTBIT_S24_LE),
  199. .channels_min = 1,
  200. .channels_max = 8,
  201. .rate_min = 8000,
  202. .rate_max = 192000,
  203. },
  204. .capture = {
  205. .stream_name = "MultiMedia5 Capture",
  206. .aif_name = "MM_UL5",
  207. .rates = (SNDRV_PCM_RATE_8000_48000|
  208. SNDRV_PCM_RATE_KNOT),
  209. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  210. .channels_min = 1,
  211. .channels_max = 8,
  212. .rate_min = 8000,
  213. .rate_max = 48000,
  214. },
  215. .ops = &msm_fe_Multimedia_dai_ops,
  216. .name = "MultiMedia5",
  217. },
  218. {
  219. .playback = {
  220. .stream_name = "MultiMedia6 Playback",
  221. .aif_name = "MM_DL6",
  222. .rates = (SNDRV_PCM_RATE_8000_192000 |
  223. SNDRV_PCM_RATE_KNOT),
  224. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  225. SNDRV_PCM_FMTBIT_S24_LE),
  226. .channels_min = 1,
  227. .channels_max = 8,
  228. .rate_min = 8000,
  229. .rate_max = 192000,
  230. },
  231. .capture = {
  232. .stream_name = "MultiMedia6 Capture",
  233. .aif_name = "MM_UL6",
  234. .rates = (SNDRV_PCM_RATE_8000_48000|
  235. SNDRV_PCM_RATE_KNOT),
  236. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  237. .channels_min = 1,
  238. .channels_max = 8,
  239. .rate_min = 8000,
  240. .rate_max = 48000,
  241. },
  242. .ops = &msm_fe_Multimedia_dai_ops,
  243. .name = "MultiMedia6",
  244. },
  245. {
  246. .playback = {
  247. .stream_name = "MultiMedia7 Playback",
  248. .aif_name = "MM_DL7",
  249. .rates = (SNDRV_PCM_RATE_8000_192000 |
  250. SNDRV_PCM_RATE_KNOT),
  251. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  252. SNDRV_PCM_FMTBIT_S24_LE),
  253. .channels_min = 1,
  254. .channels_max = 8,
  255. .rate_min = 8000,
  256. .rate_max = 192000,
  257. },
  258. .ops = &msm_fe_Multimedia_dai_ops,
  259. .name = "MultiMedia7",
  260. },
  261. {
  262. .playback = {
  263. .stream_name = "MultiMedia8 Playback",
  264. .aif_name = "MM_DL8",
  265. .rates = (SNDRV_PCM_RATE_8000_192000 |
  266. SNDRV_PCM_RATE_KNOT),
  267. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  268. SNDRV_PCM_FMTBIT_S24_LE),
  269. .channels_min = 1,
  270. .channels_max = 8,
  271. .rate_min = 8000,
  272. .rate_max = 192000,
  273. },
  274. .capture = {
  275. .stream_name = "MultiMedia8 Capture",
  276. .aif_name = "MM_UL8",
  277. .rates = (SNDRV_PCM_RATE_8000_48000|
  278. SNDRV_PCM_RATE_KNOT),
  279. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  280. .channels_min = 1,
  281. .channels_max = 8,
  282. .rate_min = 8000,
  283. .rate_max = 48000,
  284. },
  285. .ops = &msm_fe_Multimedia_dai_ops,
  286. .name = "MultiMedia8",
  287. },
  288. /* FE DAIs created for hostless operation purpose */
  289. {
  290. .playback = {
  291. .stream_name = "SLIMBUS0 Hostless Playback",
  292. .aif_name = "SLIM0_DL_HL",
  293. .rates = SNDRV_PCM_RATE_8000_192000,
  294. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  295. SNDRV_PCM_FMTBIT_S24_LE),
  296. .channels_min = 1,
  297. .channels_max = 8,
  298. .rate_min = 8000,
  299. .rate_max = 192000,
  300. },
  301. .capture = {
  302. .stream_name = "SLIMBUS0 Hostless Capture",
  303. .aif_name = "SLIM0_UL_HL",
  304. .rates = SNDRV_PCM_RATE_8000_96000,
  305. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  306. .channels_min = 1,
  307. .channels_max = 8,
  308. .rate_min = 8000,
  309. .rate_max = 192000,
  310. },
  311. .ops = &msm_fe_dai_ops,
  312. .name = "SLIMBUS0_HOSTLESS",
  313. },
  314. {
  315. .playback = {
  316. .stream_name = "SLIMBUS1 Hostless Playback",
  317. .aif_name = "SLIM1_DL_HL",
  318. .rates = SNDRV_PCM_RATE_8000_192000,
  319. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  320. SNDRV_PCM_FMTBIT_S24_LE),
  321. .channels_min = 1,
  322. .channels_max = 2,
  323. .rate_min = 8000,
  324. .rate_max = 192000,
  325. },
  326. .capture = {
  327. .stream_name = "SLIMBUS1 Hostless Capture",
  328. .aif_name = "SLIM1_UL_HL",
  329. .rates = SNDRV_PCM_RATE_8000_48000,
  330. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  331. .channels_min = 1,
  332. .channels_max = 2,
  333. .rate_min = 8000,
  334. .rate_max = 48000,
  335. },
  336. .ops = &msm_fe_dai_ops,
  337. .name = "SLIMBUS1_HOSTLESS",
  338. },
  339. {
  340. .playback = {
  341. .stream_name = "SLIMBUS3 Hostless Playback",
  342. .aif_name = "SLIM3_DL_HL",
  343. .rates = SNDRV_PCM_RATE_8000_192000,
  344. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  345. SNDRV_PCM_FMTBIT_S24_LE),
  346. .channels_min = 1,
  347. .channels_max = 2,
  348. .rate_min = 8000,
  349. .rate_max = 192000,
  350. },
  351. .capture = {
  352. .stream_name = "SLIMBUS3 Hostless Capture",
  353. .aif_name = "SLIM3_UL_HL",
  354. .rates = SNDRV_PCM_RATE_8000_48000,
  355. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  356. .channels_min = 1,
  357. .channels_max = 2,
  358. .rate_min = 8000,
  359. .rate_max = 48000,
  360. },
  361. .ops = &msm_fe_dai_ops,
  362. .name = "SLIMBUS3_HOSTLESS",
  363. },
  364. {
  365. .playback = {
  366. .stream_name = "SLIMBUS4 Hostless Playback",
  367. .aif_name = "SLIM4_DL_HL",
  368. .rates = SNDRV_PCM_RATE_8000_192000,
  369. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  370. SNDRV_PCM_FMTBIT_S24_LE),
  371. .channels_min = 1,
  372. .channels_max = 2,
  373. .rate_min = 8000,
  374. .rate_max = 192000,
  375. },
  376. .capture = {
  377. .stream_name = "SLIMBUS4 Hostless Capture",
  378. .aif_name = "SLIM4_UL_HL",
  379. .rates = SNDRV_PCM_RATE_8000_48000,
  380. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  381. .channels_min = 1,
  382. .channels_max = 2,
  383. .rate_min = 8000,
  384. .rate_max = 48000,
  385. },
  386. .ops = &msm_fe_dai_ops,
  387. .name = "SLIMBUS4_HOSTLESS",
  388. },
  389. {
  390. .playback = {
  391. .stream_name = "INT_FM Hostless Playback",
  392. .aif_name = "INTFM_DL_HL",
  393. .rates = SNDRV_PCM_RATE_8000_48000,
  394. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  395. .channels_min = 1,
  396. .channels_max = 2,
  397. .rate_min = 8000,
  398. .rate_max = 48000,
  399. },
  400. .capture = {
  401. .stream_name = "INT_FM Hostless Capture",
  402. .aif_name = "INTFM_UL_HL",
  403. .rates = SNDRV_PCM_RATE_8000_48000,
  404. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  405. .channels_min = 1,
  406. .channels_max = 2,
  407. .rate_min = 8000,
  408. .rate_max = 48000,
  409. },
  410. .ops = &msm_fe_dai_ops,
  411. .name = "INT_FM_HOSTLESS",
  412. },
  413. {
  414. .playback = {
  415. .stream_name = "INT_HFP_BT Hostless Playback",
  416. .aif_name = "INTHFP_DL_HL",
  417. .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
  418. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  419. .channels_min = 1,
  420. .channels_max = 2,
  421. .rate_min = 8000,
  422. .rate_max = 16000,
  423. },
  424. .capture = {
  425. .stream_name = "INT_HFP_BT Hostless Capture",
  426. .aif_name = "INTHFP_UL_HL",
  427. .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
  428. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  429. .channels_min = 1,
  430. .channels_max = 2,
  431. .rate_min = 8000,
  432. .rate_max = 16000,
  433. },
  434. .ops = &msm_fe_dai_ops,
  435. .name = "INT_HFP_BT_HOSTLESS",
  436. },
  437. {
  438. .playback = {
  439. .stream_name = "AFE-PROXY Playback",
  440. .aif_name = "PCM_RX",
  441. .rates = (SNDRV_PCM_RATE_8000 |
  442. SNDRV_PCM_RATE_16000 |
  443. SNDRV_PCM_RATE_48000),
  444. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  445. .channels_min = 1,
  446. .channels_max = 2,
  447. .rate_min = 8000,
  448. .rate_max = 48000,
  449. },
  450. .capture = {
  451. .stream_name = "AFE-PROXY Capture",
  452. .aif_name = "PCM_TX",
  453. .rates = (SNDRV_PCM_RATE_8000 |
  454. SNDRV_PCM_RATE_16000 |
  455. SNDRV_PCM_RATE_48000),
  456. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  457. .channels_min = 1,
  458. .channels_max = 2,
  459. .rate_min = 8000,
  460. .rate_max = 48000,
  461. },
  462. .ops = &msm_fe_dai_ops,
  463. .name = "AFE-PROXY",
  464. },
  465. {
  466. .playback = {
  467. .stream_name = "HDMI_Rx Hostless Playback",
  468. .aif_name = "HDMI_DL_HL",
  469. .rates = SNDRV_PCM_RATE_8000_48000,
  470. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  471. .channels_min = 1,
  472. .channels_max = 2,
  473. .rate_min = 8000,
  474. .rate_max = 48000,
  475. },
  476. .ops = &msm_fe_dai_ops,
  477. .name = "HDMI_HOSTLESS"
  478. },
  479. {
  480. .playback = {
  481. .stream_name = "AUXPCM Hostless Playback",
  482. .aif_name = "AUXPCM_DL_HL",
  483. .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
  484. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  485. .channels_min = 1,
  486. .channels_max = 1,
  487. .rate_min = 8000,
  488. .rate_max = 16000,
  489. },
  490. .capture = {
  491. .stream_name = "AUXPCM Hostless Capture",
  492. .aif_name = "AUXPCM_UL_HL",
  493. .rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
  494. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  495. .channels_min = 1,
  496. .channels_max = 1,
  497. .rate_min = 8000,
  498. .rate_max = 16000,
  499. },
  500. .ops = &msm_fe_dai_ops,
  501. .name = "AUXPCM_HOSTLESS",
  502. },
  503. {
  504. .playback = {
  505. .stream_name = "Voice Stub Playback",
  506. .aif_name = "VOICE_STUB_DL",
  507. .rates = SNDRV_PCM_RATE_8000_48000,
  508. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  509. .channels_min = 1,
  510. .channels_max = 2,
  511. .rate_min = 8000,
  512. .rate_max = 48000,
  513. },
  514. .capture = {
  515. .stream_name = "Voice Stub Capture",
  516. .aif_name = "VOICE_STUB_UL",
  517. .rates = SNDRV_PCM_RATE_8000_48000,
  518. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  519. .channels_min = 1,
  520. .channels_max = 2,
  521. .rate_min = 8000,
  522. .rate_max = 48000,
  523. },
  524. .ops = &msm_fe_dai_ops,
  525. .name = "VOICE_STUB",
  526. },
  527. {
  528. .playback = {
  529. .stream_name = "VoLTE Playback",
  530. .aif_name = "VoLTE_DL",
  531. .rates = SNDRV_PCM_RATE_8000_48000,
  532. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  533. .channels_min = 1,
  534. .channels_max = 2,
  535. .rate_min = 8000,
  536. .rate_max = 48000,
  537. },
  538. .capture = {
  539. .stream_name = "VoLTE Capture",
  540. .aif_name = "VoLTE_UL",
  541. .rates = SNDRV_PCM_RATE_8000_48000,
  542. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  543. .channels_min = 1,
  544. .channels_max = 2,
  545. .rate_min = 8000,
  546. .rate_max = 48000,
  547. },
  548. .ops = &msm_fe_dai_ops,
  549. .name = "VoLTE",
  550. },
  551. {
  552. .playback = {
  553. .stream_name = "MI2S_RX_HOSTLESS Playback",
  554. .aif_name = "MI2S_DL_HL",
  555. .rates = SNDRV_PCM_RATE_8000_48000,
  556. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  557. .channels_min = 1,
  558. .channels_max = 2,
  559. .rate_min = 8000,
  560. .rate_max = 48000,
  561. },
  562. .capture = {
  563. .stream_name = "MI2S_TX Hostless Capture",
  564. .aif_name = "MI2S_UL_HL",
  565. .rates = SNDRV_PCM_RATE_8000_48000,
  566. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  567. .channels_min = 1,
  568. .channels_max = 2,
  569. .rate_min = 8000,
  570. .rate_max = 48000,
  571. },
  572. .ops = &msm_fe_dai_ops,
  573. .name = "MI2S_TX_HOSTLESS",
  574. },
  575. {
  576. .playback = {
  577. .stream_name = "SEC_I2S_RX Hostless Playback",
  578. .aif_name = "SEC_I2S_DL_HL",
  579. .rates = SNDRV_PCM_RATE_8000_48000,
  580. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  581. .channels_min = 1,
  582. .channels_max = 2,
  583. .rate_min = 8000,
  584. .rate_max = 48000,
  585. },
  586. .ops = &msm_fe_dai_ops,
  587. .name = "SEC_I2S_RX_HOSTLESS",
  588. },
  589. {
  590. .capture = {
  591. .stream_name = "Primary MI2S_TX Hostless Capture",
  592. .aif_name = "PRI_MI2S_UL_HL",
  593. .rates = SNDRV_PCM_RATE_8000_48000,
  594. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  595. .channels_min = 1,
  596. .channels_max = 2,
  597. .rate_min = 8000,
  598. .rate_max = 48000,
  599. },
  600. .ops = &msm_fe_dai_ops,
  601. .name = "PRI_MI2S_TX_HOSTLESS",
  602. },
  603. {
  604. .playback = {
  605. .stream_name = "Secondary MI2S_RX Hostless Playback",
  606. .aif_name = "SEC_MI2S_DL_HL",
  607. .rates = SNDRV_PCM_RATE_8000_48000,
  608. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  609. .channels_min = 1,
  610. .channels_max = 2,
  611. .rate_min = 8000,
  612. .rate_max = 48000,
  613. },
  614. .ops = &msm_fe_dai_ops,
  615. .name = "SEC_MI2S_RX_HOSTLESS",
  616. },
  617. {
  618. .playback = {
  619. .stream_name = "Voice2 Playback",
  620. .aif_name = "VOICE2_DL",
  621. .rates = SNDRV_PCM_RATE_8000_48000,
  622. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  623. .channels_min = 1,
  624. .channels_max = 2,
  625. .rate_min = 8000,
  626. .rate_max = 48000,
  627. },
  628. .capture = {
  629. .stream_name = "Voice2 Capture",
  630. .aif_name = "VOICE2_UL",
  631. .rates = SNDRV_PCM_RATE_8000_48000,
  632. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  633. .channels_min = 1,
  634. .channels_max = 2,
  635. .rate_min = 8000,
  636. .rate_max = 48000,
  637. },
  638. .ops = &msm_fe_dai_ops,
  639. .name = "Voice2",
  640. },
  641. {
  642. .playback = {
  643. .stream_name = "Pseudo Playback",
  644. .aif_name = "MM_DL9",
  645. .rates = (SNDRV_PCM_RATE_8000_48000 |
  646. SNDRV_PCM_RATE_KNOT),
  647. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  648. .channels_min = 1,
  649. .channels_max = 8,
  650. .rate_min = 8000,
  651. .rate_max = 48000,
  652. },
  653. .capture = {
  654. .stream_name = "Pseudo Capture",
  655. .aif_name = "MM_UL9",
  656. .rates = (SNDRV_PCM_RATE_8000_48000|
  657. SNDRV_PCM_RATE_KNOT),
  658. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  659. .channels_min = 1,
  660. .channels_max = 8,
  661. .rate_min = 8000,
  662. .rate_max = 48000,
  663. },
  664. .ops = &msm_fe_Multimedia_dai_ops,
  665. .name = "Pseudo",
  666. },
  667. {
  668. .playback = {
  669. .stream_name = "DTMF_RX Hostless Playback",
  670. .aif_name = "DTMF_DL_HL",
  671. .rates = SNDRV_PCM_RATE_8000_48000,
  672. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  673. .channels_min = 1,
  674. .channels_max = 2,
  675. .rate_min = 8000,
  676. .rate_max = 48000,
  677. },
  678. .ops = &msm_fe_dai_ops,
  679. .name = "DTMF_RX_HOSTLESS",
  680. },
  681. {
  682. .playback = {
  683. .stream_name = "VoLTE Stub Playback",
  684. .aif_name = "VOLTE_STUB_DL",
  685. .rates = SNDRV_PCM_RATE_8000_48000,
  686. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  687. .channels_min = 1,
  688. .channels_max = 2,
  689. .rate_min = 8000,
  690. .rate_max = 48000,
  691. },
  692. .capture = {
  693. .stream_name = "VoLTE Stub Capture",
  694. .aif_name = "VOLTE_STUB_UL",
  695. .rates = SNDRV_PCM_RATE_8000_48000,
  696. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  697. .channels_min = 1,
  698. .channels_max = 2,
  699. .rate_min = 8000,
  700. .rate_max = 48000,
  701. },
  702. .ops = &msm_fe_dai_ops,
  703. .name = "VOLTE_STUB",
  704. },
  705. {
  706. .playback = {
  707. .stream_name = "Voice2 Stub Playback",
  708. .aif_name = "VOICE2_STUB_DL",
  709. .rates = SNDRV_PCM_RATE_8000_48000,
  710. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  711. .channels_min = 1,
  712. .channels_max = 2,
  713. .rate_min = 8000,
  714. .rate_max = 48000,
  715. },
  716. .capture = {
  717. .stream_name = "Voice2 Stub Capture",
  718. .aif_name = "VOICE2_STUB_UL",
  719. .rates = SNDRV_PCM_RATE_8000_48000,
  720. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  721. .channels_min = 1,
  722. .channels_max = 2,
  723. .rate_min = 8000,
  724. .rate_max = 48000,
  725. },
  726. .ops = &msm_fe_dai_ops,
  727. .name = "VOICE2_STUB",
  728. },
  729. {
  730. .playback = {
  731. .stream_name = "Multimedia9 Playback",
  732. .aif_name = "MM_DL9",
  733. .rates = (SNDRV_PCM_RATE_8000_192000|
  734. SNDRV_PCM_RATE_KNOT),
  735. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  736. SNDRV_PCM_FMTBIT_S24_LE),
  737. .channels_min = 1,
  738. .channels_max = 8,
  739. .rate_min = 8000,
  740. .rate_max = 192000,
  741. },
  742. .capture = {
  743. .stream_name = "Multimedia9 Capture",
  744. .aif_name = "MM_UL9",
  745. .rates = (SNDRV_PCM_RATE_8000_48000|
  746. SNDRV_PCM_RATE_KNOT),
  747. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  748. .channels_min = 1,
  749. .channels_max = 8,
  750. .rate_min = 8000,
  751. .rate_max = 48000,
  752. },
  753. .ops = &msm_fe_Multimedia_dai_ops,
  754. .name = "MultiMedia9",
  755. },
  756. #ifdef CONFIG_JACK_AUDIO
  757. {
  758. .playback = {
  759. .stream_name = "MultiMedia10 Playback",
  760. .aif_name = "MM_DL10",
  761. .rates = (SNDRV_PCM_RATE_8000_192000 |
  762. SNDRV_PCM_RATE_KNOT),
  763. .formats = (SNDRV_PCM_FMTBIT_S16_LE |
  764. SNDRV_PCM_FMTBIT_S24_LE),
  765. .channels_min = 1,
  766. .channels_max = 8,
  767. .rate_min = 8000,
  768. .rate_max = 192000,
  769. },
  770. .capture = {
  771. .stream_name = "MultiMedia10 Capture",
  772. .aif_name = "MM_UL10",
  773. .rates = (SNDRV_PCM_RATE_8000_48000|
  774. SNDRV_PCM_RATE_KNOT),
  775. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  776. .channels_min = 1,
  777. .channels_max = 8,
  778. .rate_min = 8000,
  779. .rate_max = 48000,
  780. },
  781. .ops = &msm_fe_Multimedia_dai_ops,
  782. .name = "MultiMedia10",
  783. },
  784. #endif
  785. {
  786. .playback = {
  787. .stream_name = "QCHAT Playback",
  788. .aif_name = "QCHAT_DL",
  789. .rates = SNDRV_PCM_RATE_8000_48000,
  790. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  791. .channels_min = 1,
  792. .channels_max = 2,
  793. .rate_min = 8000,
  794. .rate_max = 48000,
  795. },
  796. .capture = {
  797. .stream_name = "QCHAT Capture",
  798. .aif_name = "QCHAT_UL",
  799. .rates = SNDRV_PCM_RATE_8000_48000,
  800. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  801. .channels_min = 1,
  802. .channels_max = 2,
  803. .rate_min = 8000,
  804. .rate_max = 48000,
  805. },
  806. .ops = &msm_fe_dai_ops,
  807. .name = "QCHAT",
  808. },
  809. {
  810. .capture = {
  811. .stream_name = "Listen 1 Audio Service Capture",
  812. .aif_name = "LSM1_UL_HL",
  813. .rates = SNDRV_PCM_RATE_16000,
  814. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  815. .channels_min = 1,
  816. .channels_max = 1,
  817. .rate_min = 16000,
  818. .rate_max = 16000,
  819. },
  820. .ops = &msm_fe_dai_ops,
  821. .name = "LSM1",
  822. },
  823. {
  824. .capture = {
  825. .stream_name = "Listen 2 Audio Service Capture",
  826. .aif_name = "LSM2_UL_HL",
  827. .rates = SNDRV_PCM_RATE_16000,
  828. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  829. .channels_min = 1,
  830. .channels_max = 1,
  831. .rate_min = 16000,
  832. .rate_max = 16000,
  833. },
  834. .ops = &msm_fe_dai_ops,
  835. .name = "LSM2",
  836. },
  837. {
  838. .capture = {
  839. .stream_name = "Listen 3 Audio Service Capture",
  840. .aif_name = "LSM3_UL_HL",
  841. .rates = SNDRV_PCM_RATE_16000,
  842. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  843. .channels_min = 1,
  844. .channels_max = 1,
  845. .rate_min = 16000,
  846. .rate_max = 16000,
  847. },
  848. .ops = &msm_fe_dai_ops,
  849. .name = "LSM3",
  850. },
  851. {
  852. .capture = {
  853. .stream_name = "Listen 4 Audio Service Capture",
  854. .aif_name = "LSM4_UL_HL",
  855. .rates = SNDRV_PCM_RATE_16000,
  856. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  857. .channels_min = 1,
  858. .channels_max = 1,
  859. .rate_min = 16000,
  860. .rate_max = 16000,
  861. },
  862. .ops = &msm_fe_dai_ops,
  863. .name = "LSM4",
  864. },
  865. {
  866. .capture = {
  867. .stream_name = "Listen 5 Audio Service Capture",
  868. .aif_name = "LSM5_UL_HL",
  869. .rates = SNDRV_PCM_RATE_16000,
  870. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  871. .channels_min = 1,
  872. .channels_max = 1,
  873. .rate_min = 16000,
  874. .rate_max = 16000,
  875. },
  876. .ops = &msm_fe_dai_ops,
  877. .name = "LSM5",
  878. },
  879. {
  880. .capture = {
  881. .stream_name = "Listen 6 Audio Service Capture",
  882. .aif_name = "LSM6_UL_HL",
  883. .rates = SNDRV_PCM_RATE_16000,
  884. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  885. .channels_min = 1,
  886. .channels_max = 1,
  887. .rate_min = 16000,
  888. .rate_max = 16000,
  889. },
  890. .ops = &msm_fe_dai_ops,
  891. .name = "LSM6",
  892. },
  893. {
  894. .capture = {
  895. .stream_name = "Listen 7 Audio Service Capture",
  896. .aif_name = "LSM7_UL_HL",
  897. .rates = SNDRV_PCM_RATE_16000,
  898. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  899. .channels_min = 1,
  900. .channels_max = 1,
  901. .rate_min = 16000,
  902. .rate_max = 16000,
  903. },
  904. .ops = &msm_fe_dai_ops,
  905. .name = "LSM7",
  906. },
  907. {
  908. .capture = {
  909. .stream_name = "Listen 8 Audio Service Capture",
  910. .aif_name = "LSM8_UL_HL",
  911. .rates = SNDRV_PCM_RATE_16000,
  912. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  913. .channels_min = 1,
  914. .channels_max = 1,
  915. .rate_min = 16000,
  916. .rate_max = 16000,
  917. },
  918. .ops = &msm_fe_dai_ops,
  919. .name = "LSM8",
  920. },
  921. {
  922. .playback = {
  923. .stream_name = "VoWLAN Playback",
  924. .aif_name = "VoWLAN_DL",
  925. .rates = SNDRV_PCM_RATE_8000_48000,
  926. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  927. .channels_min = 1,
  928. .channels_max = 2,
  929. .rate_min = 8000,
  930. .rate_max = 48000,
  931. },
  932. .capture = {
  933. .stream_name = "VoWLAN Capture",
  934. .aif_name = "VoWLAN_UL",
  935. .rates = SNDRV_PCM_RATE_8000_48000,
  936. .formats = SNDRV_PCM_FMTBIT_S16_LE,
  937. .channels_min = 1,
  938. .channels_max = 2,
  939. .rate_min = 8000,
  940. .rate_max = 48000,
  941. },
  942. .ops = &msm_fe_dai_ops,
  943. .name = "VoWLAN",
  944. },
  945. };
  946. static __devinit int msm_fe_dai_dev_probe(struct platform_device *pdev)
  947. {
  948. if (pdev->dev.of_node)
  949. dev_set_name(&pdev->dev, "%s", "msm-dai-fe");
  950. dev_dbg(&pdev->dev, "%s: dev name %s\n", __func__,
  951. dev_name(&pdev->dev));
  952. return snd_soc_register_dais(&pdev->dev, msm_fe_dais,
  953. ARRAY_SIZE(msm_fe_dais));
  954. }
  955. static __devexit int msm_fe_dai_dev_remove(struct platform_device *pdev)
  956. {
  957. snd_soc_unregister_dai(&pdev->dev);
  958. return 0;
  959. }
  960. static const struct of_device_id msm_dai_fe_dt_match[] = {
  961. {.compatible = "qcom,msm-dai-fe"},
  962. {}
  963. };
  964. static struct platform_driver msm_fe_dai_driver = {
  965. .probe = msm_fe_dai_dev_probe,
  966. .remove = msm_fe_dai_dev_remove,
  967. .driver = {
  968. .name = "msm-dai-fe",
  969. .owner = THIS_MODULE,
  970. .of_match_table = msm_dai_fe_dt_match,
  971. },
  972. };
  973. static int __init msm_fe_dai_init(void)
  974. {
  975. return platform_driver_register(&msm_fe_dai_driver);
  976. }
  977. module_init(msm_fe_dai_init);
  978. static void __exit msm_fe_dai_exit(void)
  979. {
  980. platform_driver_unregister(&msm_fe_dai_driver);
  981. }
  982. module_exit(msm_fe_dai_exit);
  983. /* Module information */
  984. MODULE_DESCRIPTION("MSM Frontend DAI driver");
  985. MODULE_LICENSE("GPL v2");