msm-dai-slim.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/init.h>
  6. #include <linux/module.h>
  7. #include <linux/of.h>
  8. #include <linux/bitops.h>
  9. #include <linux/slimbus/slimbus.h>
  10. #include <sound/soc.h>
  11. #include <sound/pcm.h>
  12. #include <sound/pcm_params.h>
  13. #include "msm-slim-dma.h"
  14. #define SLIM_DEV_NAME "msm-dai-slim"
  15. #define SLIM_DAI_RATES (SNDRV_PCM_RATE_48000 | \
  16. SNDRV_PCM_RATE_8000 | \
  17. SNDRV_PCM_RATE_16000 | \
  18. SNDRV_PCM_RATE_96000 | \
  19. SNDRV_PCM_RATE_192000 | \
  20. SNDRV_PCM_RATE_384000)
  21. #define SLIM_DAI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
  22. SNDRV_PCM_FMTBIT_S24_LE | \
  23. SNDRV_PCM_FMTBIT_S32_LE)
  24. #define DAI_STATE_INITIALIZED (0x01 << 0)
  25. #define DAI_STATE_PREPARED (0x01 << 1)
  26. #define DAI_STATE_RUNNING (0x01 << 2)
  27. #define SET_DAI_STATE(status, state) \
  28. (status |= state)
  29. #define CLR_DAI_STATE(status, state) \
  30. (status = status & (~state))
  31. enum {
  32. MSM_DAI_SLIM0 = 0,
  33. NUM_SLIM_DAIS,
  34. };
  35. struct msm_slim_dai_data {
  36. unsigned int dai_id;
  37. u16 *chan_h;
  38. u16 *sh_ch;
  39. u16 grph;
  40. u32 rate;
  41. u16 bits;
  42. u16 ch_cnt;
  43. u8 status;
  44. struct snd_soc_dai_driver *dai_drv;
  45. struct msm_slim_dma_data dma_data;
  46. struct slim_port_cfg port_cfg;
  47. };
  48. struct msm_dai_slim_drv_data {
  49. struct slim_device *sdev;
  50. u16 num_dais;
  51. struct msm_slim_dai_data slim_dai_data[NUM_SLIM_DAIS];
  52. };
  53. struct msm_slim_dai_data *msm_slim_get_dai_data(
  54. struct msm_dai_slim_drv_data *drv_data,
  55. struct snd_soc_dai *dai)
  56. {
  57. struct msm_slim_dai_data *dai_data_t;
  58. int i;
  59. for (i = 0; i < drv_data->num_dais; i++) {
  60. dai_data_t = &drv_data->slim_dai_data[i];
  61. if (dai_data_t->dai_id == dai->id)
  62. return dai_data_t;
  63. }
  64. dev_err(dai->dev,
  65. "%s: no dai data found for dai_id %d\n",
  66. __func__, dai->id);
  67. return NULL;
  68. }
  69. static int msm_dai_slim_ch_ctl(struct msm_slim_dma_data *dma_data,
  70. struct snd_soc_dai *dai, bool enable)
  71. {
  72. struct slim_device *sdev;
  73. struct msm_dai_slim_drv_data *drv_data;
  74. struct msm_slim_dai_data *dai_data;
  75. int rc, rc1, i;
  76. if (!dma_data || !dma_data->sdev) {
  77. pr_err("%s: Invalid %s\n", __func__,
  78. (!dma_data) ? "dma_data" : "slim_device");
  79. return -EINVAL;
  80. }
  81. sdev = dma_data->sdev;
  82. drv_data = dev_get_drvdata(&sdev->dev);
  83. dai_data = msm_slim_get_dai_data(drv_data, dai);
  84. if (!dai_data) {
  85. dev_err(dai->dev,
  86. "%s: Invalid dai_data for dai_id %d\n",
  87. __func__, dai->id);
  88. return -EINVAL;
  89. }
  90. dev_dbg(&sdev->dev,
  91. "%s: enable = %s, rate = %u\n", __func__,
  92. enable ? "true" : "false",
  93. dai_data->rate);
  94. if (enable) {
  95. if (!(dai_data->status & DAI_STATE_PREPARED)) {
  96. dev_err(&sdev->dev,
  97. "%s: dai id (%d) has invalid state 0x%x\n",
  98. __func__, dai->id, dai_data->status);
  99. return -EINVAL;
  100. }
  101. rc = slim_alloc_mgrports(sdev,
  102. SLIM_REQ_DEFAULT, dai_data->ch_cnt,
  103. &(dma_data->ph),
  104. sizeof(dma_data->ph));
  105. if (rc < 0) {
  106. dev_err(&sdev->dev,
  107. "%s:alloc mgrport failed rc %d\n",
  108. __func__, rc);
  109. goto done;
  110. }
  111. rc = slim_config_mgrports(sdev, &(dma_data->ph),
  112. dai_data->ch_cnt,
  113. &(dai_data->port_cfg));
  114. if (rc < 0) {
  115. dev_err(&sdev->dev,
  116. "%s: config mgrport failed rc %d\n",
  117. __func__, rc);
  118. goto err_done;
  119. }
  120. for (i = 0; i < dai_data->ch_cnt; i++) {
  121. rc = slim_connect_sink(sdev,
  122. &dma_data->ph, 1,
  123. dai_data->chan_h[i]);
  124. if (rc < 0) {
  125. dev_err(&sdev->dev,
  126. "%s: slim_connect_sink failed, ch = %d, err = %d\n",
  127. __func__, i, rc);
  128. goto err_done;
  129. }
  130. }
  131. rc = slim_control_ch(sdev,
  132. dai_data->grph,
  133. SLIM_CH_ACTIVATE, true);
  134. if (rc < 0) {
  135. dev_err(&sdev->dev,
  136. "%s: slim activate ch failed, err = %d\n",
  137. __func__, rc);
  138. goto err_done;
  139. }
  140. /* Mark dai status as running */
  141. SET_DAI_STATE(dai_data->status, DAI_STATE_RUNNING);
  142. } else {
  143. if (!(dai_data->status & DAI_STATE_RUNNING)) {
  144. dev_err(&sdev->dev,
  145. "%s: dai id (%d) has invalid state 0x%x\n",
  146. __func__, dai->id, dai_data->status);
  147. return -EINVAL;
  148. }
  149. rc = slim_control_ch(sdev,
  150. dai_data->grph,
  151. SLIM_CH_REMOVE, true);
  152. if (rc < 0) {
  153. dev_err(&sdev->dev,
  154. "%s: slim activate ch failed, err = %d\n",
  155. __func__, rc);
  156. goto done;
  157. }
  158. rc = slim_dealloc_mgrports(sdev,
  159. &dma_data->ph, 1);
  160. if (rc < 0) {
  161. dev_err(&sdev->dev,
  162. "%s: dealloc mgrport failed, err = %d\n",
  163. __func__, rc);
  164. goto done;
  165. }
  166. /* clear running state for dai*/
  167. CLR_DAI_STATE(dai_data->status, DAI_STATE_RUNNING);
  168. }
  169. return rc;
  170. err_done:
  171. rc1 = slim_dealloc_mgrports(sdev,
  172. &dma_data->ph, 1);
  173. if (rc1 < 0)
  174. dev_err(&sdev->dev,
  175. "%s: dealloc mgrport failed, err = %d\n",
  176. __func__, rc1);
  177. done:
  178. return rc;
  179. }
  180. static int msm_dai_slim_hw_params(
  181. struct snd_pcm_substream *substream,
  182. struct snd_pcm_hw_params *params,
  183. struct snd_soc_dai *dai)
  184. {
  185. struct msm_dai_slim_drv_data *drv_data = dev_get_drvdata(dai->dev);
  186. struct msm_slim_dai_data *dai_data;
  187. int rc = 0;
  188. dai_data = msm_slim_get_dai_data(drv_data, dai);
  189. if (!dai_data) {
  190. dev_err(dai->dev,
  191. "%s: Invalid dai_data for dai_id %d\n",
  192. __func__, dai->id);
  193. rc = -EINVAL;
  194. goto done;
  195. }
  196. if (!dai_data->ch_cnt || dai_data->ch_cnt != params_channels(params)) {
  197. dev_err(dai->dev, "%s: invalid ch_cnt %d %d\n",
  198. __func__, dai_data->ch_cnt, params_channels(params));
  199. rc = -EINVAL;
  200. goto done;
  201. }
  202. dai_data->rate = params_rate(params);
  203. dai_data->port_cfg.port_opts = SLIM_OPT_NONE;
  204. if (dai_data->rate >= SNDRV_PCM_RATE_48000)
  205. dai_data->port_cfg.watermark = 16;
  206. else
  207. dai_data->port_cfg.watermark = 8;
  208. switch (params_format(params)) {
  209. case SNDRV_PCM_FORMAT_S16_LE:
  210. dai_data->bits = 16;
  211. break;
  212. case SNDRV_PCM_FORMAT_S24_LE:
  213. dai_data->bits = 24;
  214. break;
  215. case SNDRV_PCM_FORMAT_S32_LE:
  216. dai_data->bits = 32;
  217. break;
  218. default:
  219. dev_err(dai->dev, "%s: invalid format %d\n", __func__,
  220. params_format(params));
  221. rc = -EINVAL;
  222. goto done;
  223. }
  224. dev_dbg(dai->dev, "%s: ch_cnt=%u rate=%u, bit_width = %u\n",
  225. __func__, dai_data->ch_cnt, dai_data->rate,
  226. dai_data->bits);
  227. done:
  228. return rc;
  229. }
  230. static int msm_dai_slim_set_channel_map(struct snd_soc_dai *dai,
  231. unsigned int tx_num, unsigned int *tx_slot,
  232. unsigned int rx_num, unsigned int *rx_slot)
  233. {
  234. struct msm_dai_slim_drv_data *drv_data = dev_get_drvdata(dai->dev);
  235. struct msm_slim_dai_data *dai_data;
  236. struct snd_soc_dai_driver *dai_drv;
  237. u8 i = 0;
  238. dev_dbg(dai->dev,
  239. "%s: tx_num=%u, rx_num=%u\n",
  240. __func__, tx_num, rx_num);
  241. dai_data = msm_slim_get_dai_data(drv_data, dai);
  242. if (!dai_data) {
  243. dev_err(dai->dev,
  244. "%s: Invalid dai_data for dai_id %d\n",
  245. __func__, dai->id);
  246. return -EINVAL;
  247. }
  248. dai_drv = dai_data->dai_drv;
  249. if (tx_num > dai_drv->capture.channels_max) {
  250. dev_err(dai->dev, "%s: tx_num %u max out master port cnt\n",
  251. __func__, tx_num);
  252. return -EINVAL;
  253. }
  254. for (i = 0; i < tx_num; i++)
  255. dai_data->sh_ch[i] = tx_slot[i];
  256. dai_data->ch_cnt = tx_num;
  257. return 0;
  258. }
  259. static int msm_dai_slim_prepare(struct snd_pcm_substream *substream,
  260. struct snd_soc_dai *dai)
  261. {
  262. struct msm_dai_slim_drv_data *drv_data = dev_get_drvdata(dai->dev);
  263. struct msm_slim_dma_data *dma_data;
  264. struct msm_slim_dai_data *dai_data = NULL;
  265. struct slim_ch prop;
  266. int rc;
  267. u8 i, j;
  268. dai_data = msm_slim_get_dai_data(drv_data, dai);
  269. if (!dai_data) {
  270. dev_err(dai->dev,
  271. "%s: Invalid dai_data for dai %d\n",
  272. __func__, dai->id);
  273. return -EINVAL;
  274. }
  275. if (!(dai_data->status & DAI_STATE_INITIALIZED)) {
  276. dev_err(dai->dev,
  277. "%s: dai id (%d) has invalid state 0x%x\n",
  278. __func__, dai->id, dai_data->status);
  279. return -EINVAL;
  280. }
  281. if (dai_data->status & DAI_STATE_PREPARED) {
  282. dev_dbg(dai->dev,
  283. "%s: dai id (%d) has already prepared.\n",
  284. __func__, dai->id);
  285. return 0;
  286. }
  287. dma_data = &dai_data->dma_data;
  288. snd_soc_dai_set_dma_data(dai, substream, dma_data);
  289. for (i = 0; i < dai_data->ch_cnt; i++) {
  290. rc = slim_query_ch(drv_data->sdev, dai_data->sh_ch[i],
  291. &dai_data->chan_h[i]);
  292. if (rc) {
  293. dev_err(dai->dev, "%s:query chan handle failed rc %d\n",
  294. __func__, rc);
  295. goto error_chan_query;
  296. }
  297. }
  298. prop.prot = SLIM_AUTO_ISO;
  299. prop.baser = SLIM_RATE_4000HZ;
  300. prop.dataf = SLIM_CH_DATAF_NOT_DEFINED;
  301. prop.auxf = SLIM_CH_AUXF_NOT_APPLICABLE;
  302. prop.ratem = (dai_data->rate/4000);
  303. prop.sampleszbits = dai_data->bits;
  304. rc = slim_define_ch(drv_data->sdev, &prop, dai_data->chan_h,
  305. dai_data->ch_cnt, true, &dai_data->grph);
  306. if (rc) {
  307. dev_err(dai->dev, "%s:define chan failed rc %d\n",
  308. __func__, rc);
  309. goto error_define_chan;
  310. }
  311. /* Mark stream status as prepared */
  312. SET_DAI_STATE(dai_data->status, DAI_STATE_PREPARED);
  313. return rc;
  314. error_define_chan:
  315. error_chan_query:
  316. for (j = 0; j < i; j++)
  317. slim_dealloc_ch(drv_data->sdev, dai_data->chan_h[j]);
  318. return rc;
  319. }
  320. static void msm_dai_slim_shutdown(struct snd_pcm_substream *stream,
  321. struct snd_soc_dai *dai)
  322. {
  323. struct msm_dai_slim_drv_data *drv_data = dev_get_drvdata(dai->dev);
  324. struct msm_slim_dma_data *dma_data = NULL;
  325. struct msm_slim_dai_data *dai_data;
  326. int i, rc = 0;
  327. dai_data = msm_slim_get_dai_data(drv_data, dai);
  328. dma_data = snd_soc_dai_get_dma_data(dai, stream);
  329. if (!dma_data || !dai_data) {
  330. dev_err(dai->dev,
  331. "%s: Invalid %s\n", __func__,
  332. (!dma_data) ? "dma_data" : "dai_data");
  333. return;
  334. }
  335. if ((!(dai_data->status & DAI_STATE_PREPARED)) ||
  336. dai_data->status & DAI_STATE_RUNNING) {
  337. dev_err(dai->dev,
  338. "%s: dai id (%d) has invalid state 0x%x\n",
  339. __func__, dai->id, dai_data->status);
  340. return;
  341. }
  342. for (i = 0; i < dai_data->ch_cnt; i++) {
  343. rc = slim_dealloc_ch(drv_data->sdev, dai_data->chan_h[i]);
  344. if (rc) {
  345. dev_err(dai->dev,
  346. "%s: dealloc_ch failed, err = %d\n",
  347. __func__, rc);
  348. }
  349. }
  350. snd_soc_dai_set_dma_data(dai, stream, NULL);
  351. /* clear prepared state for the dai */
  352. CLR_DAI_STATE(dai_data->status, DAI_STATE_PREPARED);
  353. }
  354. static const struct snd_soc_component_driver msm_dai_slim_component = {
  355. .name = "msm-dai-slim-cmpnt",
  356. };
  357. static struct snd_soc_dai_ops msm_dai_slim_ops = {
  358. .prepare = msm_dai_slim_prepare,
  359. .hw_params = msm_dai_slim_hw_params,
  360. .shutdown = msm_dai_slim_shutdown,
  361. .set_channel_map = msm_dai_slim_set_channel_map,
  362. };
  363. static struct snd_soc_dai_driver msm_slim_dais[] = {
  364. {
  365. /*
  366. * The first dai name should be same as device name
  367. * to support registering single and multile dais.
  368. */
  369. .name = SLIM_DEV_NAME,
  370. .id = MSM_DAI_SLIM0,
  371. .capture = {
  372. .rates = SLIM_DAI_RATES,
  373. .formats = SLIM_DAI_FORMATS,
  374. .channels_min = 1,
  375. /*
  376. * max channels allowed is
  377. * dependent on platform and
  378. * will be updated before this
  379. * dai driver is registered.
  380. */
  381. .channels_max = 1,
  382. .rate_min = 8000,
  383. .rate_max = 384000,
  384. .stream_name = "SLIM_DAI0 Capture",
  385. },
  386. .ops = &msm_dai_slim_ops,
  387. },
  388. /*
  389. * If multiple dais are needed,
  390. * add dais here and update the
  391. * dai_id enum.
  392. */
  393. };
  394. static void msm_dai_slim_remove_dai_data(
  395. struct device *dev,
  396. struct msm_dai_slim_drv_data *drv_data)
  397. {
  398. int i;
  399. struct msm_slim_dai_data *dai_data_t;
  400. for (i = 0; i < drv_data->num_dais; i++) {
  401. dai_data_t = &drv_data->slim_dai_data[i];
  402. kfree(dai_data_t->chan_h);
  403. dai_data_t->chan_h = NULL;
  404. kfree(dai_data_t->sh_ch);
  405. dai_data_t->sh_ch = NULL;
  406. }
  407. }
  408. static int msm_dai_slim_populate_dai_data(struct device *dev,
  409. struct msm_dai_slim_drv_data *drv_data)
  410. {
  411. struct snd_soc_dai_driver *dai_drv;
  412. struct msm_slim_dai_data *dai_data_t;
  413. u8 num_ch;
  414. int i, j, rc;
  415. for (i = 0; i < drv_data->num_dais; i++) {
  416. num_ch = 0;
  417. dai_drv = &msm_slim_dais[i];
  418. num_ch += dai_drv->capture.channels_max;
  419. num_ch += dai_drv->playback.channels_max;
  420. dai_data_t = &drv_data->slim_dai_data[i];
  421. dai_data_t->dai_drv = dai_drv;
  422. dai_data_t->dai_id = dai_drv->id;
  423. dai_data_t->dma_data.sdev = drv_data->sdev;
  424. dai_data_t->dma_data.dai_channel_ctl =
  425. msm_dai_slim_ch_ctl;
  426. SET_DAI_STATE(dai_data_t->status,
  427. DAI_STATE_INITIALIZED);
  428. dai_data_t->chan_h = devm_kzalloc(dev,
  429. sizeof(u16) * num_ch,
  430. GFP_KERNEL);
  431. if (!dai_data_t->chan_h) {
  432. dev_err(dev,
  433. "%s: DAI ID %d, Failed to alloc channel handles\n",
  434. __func__, i);
  435. rc = -ENOMEM;
  436. goto err_mem_alloc;
  437. }
  438. dai_data_t->sh_ch = devm_kzalloc(dev,
  439. sizeof(u16) * num_ch,
  440. GFP_KERNEL);
  441. if (!dai_data_t->sh_ch) {
  442. dev_err(dev,
  443. "%s: DAI ID %d, Failed to alloc sh_ch\n",
  444. __func__, i);
  445. rc = -ENOMEM;
  446. goto err_mem_alloc;
  447. }
  448. }
  449. return 0;
  450. err_mem_alloc:
  451. for (j = 0; j < i; j++) {
  452. dai_data_t = &drv_data->slim_dai_data[i];
  453. devm_kfree(dev, dai_data_t->chan_h);
  454. dai_data_t->chan_h = NULL;
  455. devm_kfree(dev, dai_data_t->sh_ch);
  456. dai_data_t->sh_ch = NULL;
  457. }
  458. return rc;
  459. }
  460. static int msm_dai_slim_dev_probe(struct slim_device *sdev)
  461. {
  462. int rc, i;
  463. u8 max_channels;
  464. u32 apps_ch_pipes;
  465. struct msm_dai_slim_drv_data *drv_data;
  466. struct device *dev = &sdev->dev;
  467. struct snd_soc_dai_driver *dai_drv;
  468. if (!dev->of_node ||
  469. !dev->of_node->parent) {
  470. dev_err(dev,
  471. "%s: Invalid %s\n", __func__,
  472. (!dev->of_node) ? "of_node" : "parent_of_node");
  473. return -EINVAL;
  474. }
  475. rc = of_property_read_u32(dev->of_node->parent,
  476. "qcom,apps-ch-pipes",
  477. &apps_ch_pipes);
  478. if (rc) {
  479. dev_err(dev,
  480. "%s: Failed to lookup property %s in node %s, err = %d\n",
  481. __func__, "qcom,apps-ch-pipes",
  482. dev->of_node->parent->full_name, rc);
  483. goto err_ret;
  484. }
  485. max_channels = hweight_long(apps_ch_pipes);
  486. if (max_channels <= 0) {
  487. dev_err(dev,
  488. "%s: Invalid apps owned ports %d\n",
  489. __func__, max_channels);
  490. goto err_ret;
  491. }
  492. dev_dbg(dev, "%s: max channels = %u\n",
  493. __func__, max_channels);
  494. for (i = 0; i < ARRAY_SIZE(msm_slim_dais); i++) {
  495. dai_drv = &msm_slim_dais[i];
  496. dai_drv->capture.channels_max = max_channels;
  497. dai_drv->playback.channels_max = max_channels;
  498. }
  499. drv_data = devm_kzalloc(dev, sizeof(*drv_data),
  500. GFP_KERNEL);
  501. if (!drv_data) {
  502. rc = -ENOMEM;
  503. goto err_ret;
  504. }
  505. drv_data->sdev = sdev;
  506. drv_data->num_dais = NUM_SLIM_DAIS;
  507. rc = msm_dai_slim_populate_dai_data(dev, drv_data);
  508. if (rc) {
  509. dev_err(dev,
  510. "%s: failed to setup dai_data, err = %d\n",
  511. __func__, rc);
  512. goto err_populate_dai;
  513. }
  514. rc = snd_soc_register_component(&sdev->dev, &msm_dai_slim_component,
  515. msm_slim_dais, NUM_SLIM_DAIS);
  516. if (rc < 0) {
  517. dev_err(dev, "%s: failed to register DAI, err = %d\n",
  518. __func__, rc);
  519. goto err_reg_comp;
  520. }
  521. dev_set_drvdata(dev, drv_data);
  522. return rc;
  523. err_reg_comp:
  524. msm_dai_slim_remove_dai_data(dev, drv_data);
  525. err_populate_dai:
  526. devm_kfree(dev, drv_data);
  527. err_ret:
  528. return rc;
  529. }
  530. static int msm_dai_slim_dev_remove(struct slim_device *sdev)
  531. {
  532. snd_soc_unregister_component(&sdev->dev);
  533. return 0;
  534. }
  535. static const struct slim_device_id msm_dai_slim_dt_match[] = {
  536. {SLIM_DEV_NAME, 0 },
  537. {}
  538. };
  539. static struct slim_driver msm_dai_slim_driver = {
  540. .driver = {
  541. .name = SLIM_DEV_NAME,
  542. .owner = THIS_MODULE,
  543. },
  544. .probe = msm_dai_slim_dev_probe,
  545. .remove = msm_dai_slim_dev_remove,
  546. .id_table = msm_dai_slim_dt_match,
  547. };
  548. int __init msm_dai_slim_init(void)
  549. {
  550. int rc;
  551. rc = slim_driver_register(&msm_dai_slim_driver);
  552. if (rc)
  553. pr_err("%s: failed to register with slimbus driver rc = %d",
  554. __func__, rc);
  555. return rc;
  556. }
  557. void msm_dai_slim_exit(void)
  558. {
  559. slim_driver_unregister(&msm_dai_slim_driver);
  560. }
  561. /* Module information */
  562. MODULE_DESCRIPTION("Slimbus apps-owned channel handling driver");
  563. MODULE_LICENSE("GPL v2");