siu_pcm.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * siu_pcm.c - ALSA driver for Renesas SH7343, SH7722 SIU peripheral.
  3. *
  4. * Copyright (C) 2009-2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5. * Copyright (C) 2006 Carlos Munoz <carlos@kenati.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/delay.h>
  22. #include <linux/dma-mapping.h>
  23. #include <linux/dmaengine.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/module.h>
  26. #include <linux/platform_device.h>
  27. #include <sound/control.h>
  28. #include <sound/core.h>
  29. #include <sound/pcm.h>
  30. #include <sound/pcm_params.h>
  31. #include <sound/soc-dai.h>
  32. #include <asm/siu.h>
  33. #include "siu.h"
  34. #define GET_MAX_PERIODS(buf_bytes, period_bytes) \
  35. ((buf_bytes) / (period_bytes))
  36. #define PERIOD_OFFSET(buf_addr, period_num, period_bytes) \
  37. ((buf_addr) + ((period_num) * (period_bytes)))
  38. #define RWF_STM_RD 0x01 /* Read in progress */
  39. #define RWF_STM_WT 0x02 /* Write in progress */
  40. struct siu_port *siu_ports[SIU_PORT_NUM];
  41. /* transfersize is number of u32 dma transfers per period */
  42. static int siu_pcm_stmwrite_stop(struct siu_port *port_info)
  43. {
  44. struct siu_info *info = siu_i2s_data;
  45. u32 __iomem *base = info->reg;
  46. struct siu_stream *siu_stream = &port_info->playback;
  47. u32 stfifo;
  48. if (!siu_stream->rw_flg)
  49. return -EPERM;
  50. /* output FIFO disable */
  51. stfifo = siu_read32(base + SIU_STFIFO);
  52. siu_write32(base + SIU_STFIFO, stfifo & ~0x0c180c18);
  53. pr_debug("%s: STFIFO %x -> %x\n", __func__,
  54. stfifo, stfifo & ~0x0c180c18);
  55. /* during stmwrite clear */
  56. siu_stream->rw_flg = 0;
  57. return 0;
  58. }
  59. static int siu_pcm_stmwrite_start(struct siu_port *port_info)
  60. {
  61. struct siu_stream *siu_stream = &port_info->playback;
  62. if (siu_stream->rw_flg)
  63. return -EPERM;
  64. /* Current period in buffer */
  65. port_info->playback.cur_period = 0;
  66. /* during stmwrite flag set */
  67. siu_stream->rw_flg = RWF_STM_WT;
  68. /* DMA transfer start */
  69. tasklet_schedule(&siu_stream->tasklet);
  70. return 0;
  71. }
  72. static void siu_dma_tx_complete(void *arg)
  73. {
  74. struct siu_stream *siu_stream = arg;
  75. if (!siu_stream->rw_flg)
  76. return;
  77. /* Update completed period count */
  78. if (++siu_stream->cur_period >=
  79. GET_MAX_PERIODS(siu_stream->buf_bytes,
  80. siu_stream->period_bytes))
  81. siu_stream->cur_period = 0;
  82. pr_debug("%s: done period #%d (%u/%u bytes), cookie %d\n",
  83. __func__, siu_stream->cur_period,
  84. siu_stream->cur_period * siu_stream->period_bytes,
  85. siu_stream->buf_bytes, siu_stream->cookie);
  86. tasklet_schedule(&siu_stream->tasklet);
  87. /* Notify alsa: a period is done */
  88. snd_pcm_period_elapsed(siu_stream->substream);
  89. }
  90. static int siu_pcm_wr_set(struct siu_port *port_info,
  91. dma_addr_t buff, u32 size)
  92. {
  93. struct siu_info *info = siu_i2s_data;
  94. u32 __iomem *base = info->reg;
  95. struct siu_stream *siu_stream = &port_info->playback;
  96. struct snd_pcm_substream *substream = siu_stream->substream;
  97. struct device *dev = substream->pcm->card->dev;
  98. struct dma_async_tx_descriptor *desc;
  99. dma_cookie_t cookie;
  100. struct scatterlist sg;
  101. u32 stfifo;
  102. sg_init_table(&sg, 1);
  103. sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
  104. size, offset_in_page(buff));
  105. sg_dma_address(&sg) = buff;
  106. desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
  107. &sg, 1, DMA_TO_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
  108. if (!desc) {
  109. dev_err(dev, "Failed to allocate a dma descriptor\n");
  110. return -ENOMEM;
  111. }
  112. desc->callback = siu_dma_tx_complete;
  113. desc->callback_param = siu_stream;
  114. cookie = desc->tx_submit(desc);
  115. if (cookie < 0) {
  116. dev_err(dev, "Failed to submit a dma transfer\n");
  117. return cookie;
  118. }
  119. siu_stream->tx_desc = desc;
  120. siu_stream->cookie = cookie;
  121. dma_async_issue_pending(siu_stream->chan);
  122. /* only output FIFO enable */
  123. stfifo = siu_read32(base + SIU_STFIFO);
  124. siu_write32(base + SIU_STFIFO, stfifo | (port_info->stfifo & 0x0c180c18));
  125. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  126. stfifo, stfifo | (port_info->stfifo & 0x0c180c18));
  127. return 0;
  128. }
  129. static int siu_pcm_rd_set(struct siu_port *port_info,
  130. dma_addr_t buff, size_t size)
  131. {
  132. struct siu_info *info = siu_i2s_data;
  133. u32 __iomem *base = info->reg;
  134. struct siu_stream *siu_stream = &port_info->capture;
  135. struct snd_pcm_substream *substream = siu_stream->substream;
  136. struct device *dev = substream->pcm->card->dev;
  137. struct dma_async_tx_descriptor *desc;
  138. dma_cookie_t cookie;
  139. struct scatterlist sg;
  140. u32 stfifo;
  141. dev_dbg(dev, "%s: %u@%llx\n", __func__, size, (unsigned long long)buff);
  142. sg_init_table(&sg, 1);
  143. sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
  144. size, offset_in_page(buff));
  145. sg_dma_address(&sg) = buff;
  146. desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
  147. &sg, 1, DMA_FROM_DEVICE, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
  148. if (!desc) {
  149. dev_err(dev, "Failed to allocate dma descriptor\n");
  150. return -ENOMEM;
  151. }
  152. desc->callback = siu_dma_tx_complete;
  153. desc->callback_param = siu_stream;
  154. cookie = desc->tx_submit(desc);
  155. if (cookie < 0) {
  156. dev_err(dev, "Failed to submit dma descriptor\n");
  157. return cookie;
  158. }
  159. siu_stream->tx_desc = desc;
  160. siu_stream->cookie = cookie;
  161. dma_async_issue_pending(siu_stream->chan);
  162. /* only input FIFO enable */
  163. stfifo = siu_read32(base + SIU_STFIFO);
  164. siu_write32(base + SIU_STFIFO, siu_read32(base + SIU_STFIFO) |
  165. (port_info->stfifo & 0x13071307));
  166. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  167. stfifo, stfifo | (port_info->stfifo & 0x13071307));
  168. return 0;
  169. }
  170. static void siu_io_tasklet(unsigned long data)
  171. {
  172. struct siu_stream *siu_stream = (struct siu_stream *)data;
  173. struct snd_pcm_substream *substream = siu_stream->substream;
  174. struct device *dev = substream->pcm->card->dev;
  175. struct snd_pcm_runtime *rt = substream->runtime;
  176. struct siu_port *port_info = siu_port_info(substream);
  177. dev_dbg(dev, "%s: flags %x\n", __func__, siu_stream->rw_flg);
  178. if (!siu_stream->rw_flg) {
  179. dev_dbg(dev, "%s: stream inactive\n", __func__);
  180. return;
  181. }
  182. if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
  183. dma_addr_t buff;
  184. size_t count;
  185. u8 *virt;
  186. buff = (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
  187. siu_stream->cur_period,
  188. siu_stream->period_bytes);
  189. virt = PERIOD_OFFSET(rt->dma_area,
  190. siu_stream->cur_period,
  191. siu_stream->period_bytes);
  192. count = siu_stream->period_bytes;
  193. /* DMA transfer start */
  194. siu_pcm_rd_set(port_info, buff, count);
  195. } else {
  196. siu_pcm_wr_set(port_info,
  197. (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
  198. siu_stream->cur_period,
  199. siu_stream->period_bytes),
  200. siu_stream->period_bytes);
  201. }
  202. }
  203. /* Capture */
  204. static int siu_pcm_stmread_start(struct siu_port *port_info)
  205. {
  206. struct siu_stream *siu_stream = &port_info->capture;
  207. if (siu_stream->xfer_cnt > 0x1000000)
  208. return -EINVAL;
  209. if (siu_stream->rw_flg)
  210. return -EPERM;
  211. /* Current period in buffer */
  212. siu_stream->cur_period = 0;
  213. /* during stmread flag set */
  214. siu_stream->rw_flg = RWF_STM_RD;
  215. tasklet_schedule(&siu_stream->tasklet);
  216. return 0;
  217. }
  218. static int siu_pcm_stmread_stop(struct siu_port *port_info)
  219. {
  220. struct siu_info *info = siu_i2s_data;
  221. u32 __iomem *base = info->reg;
  222. struct siu_stream *siu_stream = &port_info->capture;
  223. struct device *dev = siu_stream->substream->pcm->card->dev;
  224. u32 stfifo;
  225. if (!siu_stream->rw_flg)
  226. return -EPERM;
  227. /* input FIFO disable */
  228. stfifo = siu_read32(base + SIU_STFIFO);
  229. siu_write32(base + SIU_STFIFO, stfifo & ~0x13071307);
  230. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  231. stfifo, stfifo & ~0x13071307);
  232. /* during stmread flag clear */
  233. siu_stream->rw_flg = 0;
  234. return 0;
  235. }
  236. static int siu_pcm_hw_params(struct snd_pcm_substream *ss,
  237. struct snd_pcm_hw_params *hw_params)
  238. {
  239. struct siu_info *info = siu_i2s_data;
  240. struct device *dev = ss->pcm->card->dev;
  241. int ret;
  242. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  243. ret = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw_params));
  244. if (ret < 0)
  245. dev_err(dev, "snd_pcm_lib_malloc_pages() failed\n");
  246. return ret;
  247. }
  248. static int siu_pcm_hw_free(struct snd_pcm_substream *ss)
  249. {
  250. struct siu_info *info = siu_i2s_data;
  251. struct siu_port *port_info = siu_port_info(ss);
  252. struct device *dev = ss->pcm->card->dev;
  253. struct siu_stream *siu_stream;
  254. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  255. siu_stream = &port_info->playback;
  256. else
  257. siu_stream = &port_info->capture;
  258. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  259. return snd_pcm_lib_free_pages(ss);
  260. }
  261. static bool filter(struct dma_chan *chan, void *slave)
  262. {
  263. struct sh_dmae_slave *param = slave;
  264. pr_debug("%s: slave ID %d\n", __func__, param->slave_id);
  265. if (unlikely(param->dma_dev != chan->device->dev))
  266. return false;
  267. chan->private = param;
  268. return true;
  269. }
  270. static int siu_pcm_open(struct snd_pcm_substream *ss)
  271. {
  272. /* Playback / Capture */
  273. struct snd_soc_pcm_runtime *rtd = ss->private_data;
  274. struct siu_platform *pdata = rtd->platform->dev->platform_data;
  275. struct siu_info *info = siu_i2s_data;
  276. struct siu_port *port_info = siu_port_info(ss);
  277. struct siu_stream *siu_stream;
  278. u32 port = info->port_id;
  279. struct device *dev = ss->pcm->card->dev;
  280. dma_cap_mask_t mask;
  281. struct sh_dmae_slave *param;
  282. dma_cap_zero(mask);
  283. dma_cap_set(DMA_SLAVE, mask);
  284. dev_dbg(dev, "%s, port=%d@%p\n", __func__, port, port_info);
  285. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  286. siu_stream = &port_info->playback;
  287. param = &siu_stream->param;
  288. param->slave_id = port ? pdata->dma_slave_tx_b :
  289. pdata->dma_slave_tx_a;
  290. } else {
  291. siu_stream = &port_info->capture;
  292. param = &siu_stream->param;
  293. param->slave_id = port ? pdata->dma_slave_rx_b :
  294. pdata->dma_slave_rx_a;
  295. }
  296. param->dma_dev = pdata->dma_dev;
  297. /* Get DMA channel */
  298. siu_stream->chan = dma_request_channel(mask, filter, param);
  299. if (!siu_stream->chan) {
  300. dev_err(dev, "DMA channel allocation failed!\n");
  301. return -EBUSY;
  302. }
  303. siu_stream->substream = ss;
  304. return 0;
  305. }
  306. static int siu_pcm_close(struct snd_pcm_substream *ss)
  307. {
  308. struct siu_info *info = siu_i2s_data;
  309. struct device *dev = ss->pcm->card->dev;
  310. struct siu_port *port_info = siu_port_info(ss);
  311. struct siu_stream *siu_stream;
  312. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  313. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  314. siu_stream = &port_info->playback;
  315. else
  316. siu_stream = &port_info->capture;
  317. dma_release_channel(siu_stream->chan);
  318. siu_stream->chan = NULL;
  319. siu_stream->substream = NULL;
  320. return 0;
  321. }
  322. static int siu_pcm_prepare(struct snd_pcm_substream *ss)
  323. {
  324. struct siu_info *info = siu_i2s_data;
  325. struct siu_port *port_info = siu_port_info(ss);
  326. struct device *dev = ss->pcm->card->dev;
  327. struct snd_pcm_runtime *rt = ss->runtime;
  328. struct siu_stream *siu_stream;
  329. snd_pcm_sframes_t xfer_cnt;
  330. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  331. siu_stream = &port_info->playback;
  332. else
  333. siu_stream = &port_info->capture;
  334. rt = siu_stream->substream->runtime;
  335. siu_stream->buf_bytes = snd_pcm_lib_buffer_bytes(ss);
  336. siu_stream->period_bytes = snd_pcm_lib_period_bytes(ss);
  337. dev_dbg(dev, "%s: port=%d, %d channels, period=%u bytes\n", __func__,
  338. info->port_id, rt->channels, siu_stream->period_bytes);
  339. /* We only support buffers that are multiples of the period */
  340. if (siu_stream->buf_bytes % siu_stream->period_bytes) {
  341. dev_err(dev, "%s() - buffer=%d not multiple of period=%d\n",
  342. __func__, siu_stream->buf_bytes,
  343. siu_stream->period_bytes);
  344. return -EINVAL;
  345. }
  346. xfer_cnt = bytes_to_frames(rt, siu_stream->period_bytes);
  347. if (!xfer_cnt || xfer_cnt > 0x1000000)
  348. return -EINVAL;
  349. siu_stream->format = rt->format;
  350. siu_stream->xfer_cnt = xfer_cnt;
  351. dev_dbg(dev, "port=%d buf=%lx buf_bytes=%d period_bytes=%d "
  352. "format=%d channels=%d xfer_cnt=%d\n", info->port_id,
  353. (unsigned long)rt->dma_addr, siu_stream->buf_bytes,
  354. siu_stream->period_bytes,
  355. siu_stream->format, rt->channels, (int)xfer_cnt);
  356. return 0;
  357. }
  358. static int siu_pcm_trigger(struct snd_pcm_substream *ss, int cmd)
  359. {
  360. struct siu_info *info = siu_i2s_data;
  361. struct device *dev = ss->pcm->card->dev;
  362. struct siu_port *port_info = siu_port_info(ss);
  363. int ret;
  364. dev_dbg(dev, "%s: port=%d@%p, cmd=%d\n", __func__,
  365. info->port_id, port_info, cmd);
  366. switch (cmd) {
  367. case SNDRV_PCM_TRIGGER_START:
  368. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  369. ret = siu_pcm_stmwrite_start(port_info);
  370. else
  371. ret = siu_pcm_stmread_start(port_info);
  372. if (ret < 0)
  373. dev_warn(dev, "%s: start failed on port=%d\n",
  374. __func__, info->port_id);
  375. break;
  376. case SNDRV_PCM_TRIGGER_STOP:
  377. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  378. siu_pcm_stmwrite_stop(port_info);
  379. else
  380. siu_pcm_stmread_stop(port_info);
  381. ret = 0;
  382. break;
  383. default:
  384. dev_err(dev, "%s() unsupported cmd=%d\n", __func__, cmd);
  385. ret = -EINVAL;
  386. }
  387. return ret;
  388. }
  389. /*
  390. * So far only resolution of one period is supported, subject to extending the
  391. * dmangine API
  392. */
  393. static snd_pcm_uframes_t siu_pcm_pointer_dma(struct snd_pcm_substream *ss)
  394. {
  395. struct device *dev = ss->pcm->card->dev;
  396. struct siu_info *info = siu_i2s_data;
  397. u32 __iomem *base = info->reg;
  398. struct siu_port *port_info = siu_port_info(ss);
  399. struct snd_pcm_runtime *rt = ss->runtime;
  400. size_t ptr;
  401. struct siu_stream *siu_stream;
  402. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  403. siu_stream = &port_info->playback;
  404. else
  405. siu_stream = &port_info->capture;
  406. /*
  407. * ptr is the offset into the buffer where the dma is currently at. We
  408. * check if the dma buffer has just wrapped.
  409. */
  410. ptr = PERIOD_OFFSET(rt->dma_addr,
  411. siu_stream->cur_period,
  412. siu_stream->period_bytes) - rt->dma_addr;
  413. dev_dbg(dev,
  414. "%s: port=%d, events %x, FSTS %x, xferred %u/%u, cookie %d\n",
  415. __func__, info->port_id, siu_read32(base + SIU_EVNTC),
  416. siu_read32(base + SIU_SBFSTS), ptr, siu_stream->buf_bytes,
  417. siu_stream->cookie);
  418. if (ptr >= siu_stream->buf_bytes)
  419. ptr = 0;
  420. return bytes_to_frames(ss->runtime, ptr);
  421. }
  422. static int siu_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
  423. struct snd_pcm *pcm)
  424. {
  425. /* card->dev == socdev->dev, see snd_soc_new_pcms() */
  426. struct siu_info *info = siu_i2s_data;
  427. struct platform_device *pdev = to_platform_device(card->dev);
  428. int ret;
  429. int i;
  430. /* pdev->id selects between SIUA and SIUB */
  431. if (pdev->id < 0 || pdev->id >= SIU_PORT_NUM)
  432. return -EINVAL;
  433. info->port_id = pdev->id;
  434. /*
  435. * While the siu has 2 ports, only one port can be on at a time (only 1
  436. * SPB). So far all the boards using the siu had only one of the ports
  437. * wired to a codec. To simplify things, we only register one port with
  438. * alsa. In case both ports are needed, it should be changed here
  439. */
  440. for (i = pdev->id; i < pdev->id + 1; i++) {
  441. struct siu_port **port_info = &siu_ports[i];
  442. ret = siu_init_port(i, port_info, card);
  443. if (ret < 0)
  444. return ret;
  445. ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
  446. SNDRV_DMA_TYPE_DEV, NULL,
  447. SIU_BUFFER_BYTES_MAX, SIU_BUFFER_BYTES_MAX);
  448. if (ret < 0) {
  449. dev_err(card->dev,
  450. "snd_pcm_lib_preallocate_pages_for_all() err=%d",
  451. ret);
  452. goto fail;
  453. }
  454. (*port_info)->pcm = pcm;
  455. /* IO tasklets */
  456. tasklet_init(&(*port_info)->playback.tasklet, siu_io_tasklet,
  457. (unsigned long)&(*port_info)->playback);
  458. tasklet_init(&(*port_info)->capture.tasklet, siu_io_tasklet,
  459. (unsigned long)&(*port_info)->capture);
  460. }
  461. dev_info(card->dev, "SuperH SIU driver initialized.\n");
  462. return 0;
  463. fail:
  464. siu_free_port(siu_ports[pdev->id]);
  465. dev_err(card->dev, "SIU: failed to initialize.\n");
  466. return ret;
  467. }
  468. static void siu_pcm_free(struct snd_pcm *pcm)
  469. {
  470. struct platform_device *pdev = to_platform_device(pcm->card->dev);
  471. struct siu_port *port_info = siu_ports[pdev->id];
  472. tasklet_kill(&port_info->capture.tasklet);
  473. tasklet_kill(&port_info->playback.tasklet);
  474. siu_free_port(port_info);
  475. snd_pcm_lib_preallocate_free_for_all(pcm);
  476. dev_dbg(pcm->card->dev, "%s\n", __func__);
  477. }
  478. static struct snd_pcm_ops siu_pcm_ops = {
  479. .open = siu_pcm_open,
  480. .close = siu_pcm_close,
  481. .ioctl = snd_pcm_lib_ioctl,
  482. .hw_params = siu_pcm_hw_params,
  483. .hw_free = siu_pcm_hw_free,
  484. .prepare = siu_pcm_prepare,
  485. .trigger = siu_pcm_trigger,
  486. .pointer = siu_pcm_pointer_dma,
  487. };
  488. struct snd_soc_platform_driver siu_platform = {
  489. .ops = &siu_pcm_ops,
  490. .pcm_new = siu_pcm_new,
  491. .pcm_free = siu_pcm_free,
  492. };
  493. EXPORT_SYMBOL_GPL(siu_platform);