siu_pcm.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  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.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_len(&sg) = size;
  106. sg_dma_address(&sg) = buff;
  107. desc = dmaengine_prep_slave_sg(siu_stream->chan,
  108. &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
  109. if (!desc) {
  110. dev_err(dev, "Failed to allocate a dma descriptor\n");
  111. return -ENOMEM;
  112. }
  113. desc->callback = siu_dma_tx_complete;
  114. desc->callback_param = siu_stream;
  115. cookie = dmaengine_submit(desc);
  116. if (cookie < 0) {
  117. dev_err(dev, "Failed to submit a dma transfer\n");
  118. return cookie;
  119. }
  120. siu_stream->tx_desc = desc;
  121. siu_stream->cookie = cookie;
  122. dma_async_issue_pending(siu_stream->chan);
  123. /* only output FIFO enable */
  124. stfifo = siu_read32(base + SIU_STFIFO);
  125. siu_write32(base + SIU_STFIFO, stfifo | (port_info->stfifo & 0x0c180c18));
  126. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  127. stfifo, stfifo | (port_info->stfifo & 0x0c180c18));
  128. return 0;
  129. }
  130. static int siu_pcm_rd_set(struct siu_port *port_info,
  131. dma_addr_t buff, size_t size)
  132. {
  133. struct siu_info *info = siu_i2s_data;
  134. u32 __iomem *base = info->reg;
  135. struct siu_stream *siu_stream = &port_info->capture;
  136. struct snd_pcm_substream *substream = siu_stream->substream;
  137. struct device *dev = substream->pcm->card->dev;
  138. struct dma_async_tx_descriptor *desc;
  139. dma_cookie_t cookie;
  140. struct scatterlist sg;
  141. u32 stfifo;
  142. dev_dbg(dev, "%s: %u@%llx\n", __func__, size, (unsigned long long)buff);
  143. sg_init_table(&sg, 1);
  144. sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)),
  145. size, offset_in_page(buff));
  146. sg_dma_len(&sg) = size;
  147. sg_dma_address(&sg) = buff;
  148. desc = dmaengine_prep_slave_sg(siu_stream->chan,
  149. &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
  150. if (!desc) {
  151. dev_err(dev, "Failed to allocate dma descriptor\n");
  152. return -ENOMEM;
  153. }
  154. desc->callback = siu_dma_tx_complete;
  155. desc->callback_param = siu_stream;
  156. cookie = dmaengine_submit(desc);
  157. if (cookie < 0) {
  158. dev_err(dev, "Failed to submit dma descriptor\n");
  159. return cookie;
  160. }
  161. siu_stream->tx_desc = desc;
  162. siu_stream->cookie = cookie;
  163. dma_async_issue_pending(siu_stream->chan);
  164. /* only input FIFO enable */
  165. stfifo = siu_read32(base + SIU_STFIFO);
  166. siu_write32(base + SIU_STFIFO, siu_read32(base + SIU_STFIFO) |
  167. (port_info->stfifo & 0x13071307));
  168. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  169. stfifo, stfifo | (port_info->stfifo & 0x13071307));
  170. return 0;
  171. }
  172. static void siu_io_tasklet(unsigned long data)
  173. {
  174. struct siu_stream *siu_stream = (struct siu_stream *)data;
  175. struct snd_pcm_substream *substream = siu_stream->substream;
  176. struct device *dev = substream->pcm->card->dev;
  177. struct snd_pcm_runtime *rt = substream->runtime;
  178. struct siu_port *port_info = siu_port_info(substream);
  179. dev_dbg(dev, "%s: flags %x\n", __func__, siu_stream->rw_flg);
  180. if (!siu_stream->rw_flg) {
  181. dev_dbg(dev, "%s: stream inactive\n", __func__);
  182. return;
  183. }
  184. if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
  185. dma_addr_t buff;
  186. size_t count;
  187. u8 *virt;
  188. buff = (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
  189. siu_stream->cur_period,
  190. siu_stream->period_bytes);
  191. virt = PERIOD_OFFSET(rt->dma_area,
  192. siu_stream->cur_period,
  193. siu_stream->period_bytes);
  194. count = siu_stream->period_bytes;
  195. /* DMA transfer start */
  196. siu_pcm_rd_set(port_info, buff, count);
  197. } else {
  198. siu_pcm_wr_set(port_info,
  199. (dma_addr_t)PERIOD_OFFSET(rt->dma_addr,
  200. siu_stream->cur_period,
  201. siu_stream->period_bytes),
  202. siu_stream->period_bytes);
  203. }
  204. }
  205. /* Capture */
  206. static int siu_pcm_stmread_start(struct siu_port *port_info)
  207. {
  208. struct siu_stream *siu_stream = &port_info->capture;
  209. if (siu_stream->xfer_cnt > 0x1000000)
  210. return -EINVAL;
  211. if (siu_stream->rw_flg)
  212. return -EPERM;
  213. /* Current period in buffer */
  214. siu_stream->cur_period = 0;
  215. /* during stmread flag set */
  216. siu_stream->rw_flg = RWF_STM_RD;
  217. tasklet_schedule(&siu_stream->tasklet);
  218. return 0;
  219. }
  220. static int siu_pcm_stmread_stop(struct siu_port *port_info)
  221. {
  222. struct siu_info *info = siu_i2s_data;
  223. u32 __iomem *base = info->reg;
  224. struct siu_stream *siu_stream = &port_info->capture;
  225. struct device *dev = siu_stream->substream->pcm->card->dev;
  226. u32 stfifo;
  227. if (!siu_stream->rw_flg)
  228. return -EPERM;
  229. /* input FIFO disable */
  230. stfifo = siu_read32(base + SIU_STFIFO);
  231. siu_write32(base + SIU_STFIFO, stfifo & ~0x13071307);
  232. dev_dbg(dev, "%s: STFIFO %x -> %x\n", __func__,
  233. stfifo, stfifo & ~0x13071307);
  234. /* during stmread flag clear */
  235. siu_stream->rw_flg = 0;
  236. return 0;
  237. }
  238. static int siu_pcm_hw_params(struct snd_pcm_substream *ss,
  239. struct snd_pcm_hw_params *hw_params)
  240. {
  241. struct siu_info *info = siu_i2s_data;
  242. struct device *dev = ss->pcm->card->dev;
  243. int ret;
  244. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  245. ret = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw_params));
  246. if (ret < 0)
  247. dev_err(dev, "snd_pcm_lib_malloc_pages() failed\n");
  248. return ret;
  249. }
  250. static int siu_pcm_hw_free(struct snd_pcm_substream *ss)
  251. {
  252. struct siu_info *info = siu_i2s_data;
  253. struct siu_port *port_info = siu_port_info(ss);
  254. struct device *dev = ss->pcm->card->dev;
  255. struct siu_stream *siu_stream;
  256. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  257. siu_stream = &port_info->playback;
  258. else
  259. siu_stream = &port_info->capture;
  260. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  261. return snd_pcm_lib_free_pages(ss);
  262. }
  263. static bool filter(struct dma_chan *chan, void *slave)
  264. {
  265. struct sh_dmae_slave *param = slave;
  266. pr_debug("%s: slave ID %d\n", __func__, param->shdma_slave.slave_id);
  267. chan->private = &param->shdma_slave;
  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->shdma_slave.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->shdma_slave.slave_id = port ? pdata->dma_slave_rx_b :
  294. pdata->dma_slave_rx_a;
  295. }
  296. /* Get DMA channel */
  297. siu_stream->chan = dma_request_channel(mask, filter, param);
  298. if (!siu_stream->chan) {
  299. dev_err(dev, "DMA channel allocation failed!\n");
  300. return -EBUSY;
  301. }
  302. siu_stream->substream = ss;
  303. return 0;
  304. }
  305. static int siu_pcm_close(struct snd_pcm_substream *ss)
  306. {
  307. struct siu_info *info = siu_i2s_data;
  308. struct device *dev = ss->pcm->card->dev;
  309. struct siu_port *port_info = siu_port_info(ss);
  310. struct siu_stream *siu_stream;
  311. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  312. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  313. siu_stream = &port_info->playback;
  314. else
  315. siu_stream = &port_info->capture;
  316. dma_release_channel(siu_stream->chan);
  317. siu_stream->chan = NULL;
  318. siu_stream->substream = NULL;
  319. return 0;
  320. }
  321. static int siu_pcm_prepare(struct snd_pcm_substream *ss)
  322. {
  323. struct siu_info *info = siu_i2s_data;
  324. struct siu_port *port_info = siu_port_info(ss);
  325. struct device *dev = ss->pcm->card->dev;
  326. struct snd_pcm_runtime *rt = ss->runtime;
  327. struct siu_stream *siu_stream;
  328. snd_pcm_sframes_t xfer_cnt;
  329. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  330. siu_stream = &port_info->playback;
  331. else
  332. siu_stream = &port_info->capture;
  333. rt = siu_stream->substream->runtime;
  334. siu_stream->buf_bytes = snd_pcm_lib_buffer_bytes(ss);
  335. siu_stream->period_bytes = snd_pcm_lib_period_bytes(ss);
  336. dev_dbg(dev, "%s: port=%d, %d channels, period=%u bytes\n", __func__,
  337. info->port_id, rt->channels, siu_stream->period_bytes);
  338. /* We only support buffers that are multiples of the period */
  339. if (siu_stream->buf_bytes % siu_stream->period_bytes) {
  340. dev_err(dev, "%s() - buffer=%d not multiple of period=%d\n",
  341. __func__, siu_stream->buf_bytes,
  342. siu_stream->period_bytes);
  343. return -EINVAL;
  344. }
  345. xfer_cnt = bytes_to_frames(rt, siu_stream->period_bytes);
  346. if (!xfer_cnt || xfer_cnt > 0x1000000)
  347. return -EINVAL;
  348. siu_stream->format = rt->format;
  349. siu_stream->xfer_cnt = xfer_cnt;
  350. dev_dbg(dev, "port=%d buf=%lx buf_bytes=%d period_bytes=%d "
  351. "format=%d channels=%d xfer_cnt=%d\n", info->port_id,
  352. (unsigned long)rt->dma_addr, siu_stream->buf_bytes,
  353. siu_stream->period_bytes,
  354. siu_stream->format, rt->channels, (int)xfer_cnt);
  355. return 0;
  356. }
  357. static int siu_pcm_trigger(struct snd_pcm_substream *ss, int cmd)
  358. {
  359. struct siu_info *info = siu_i2s_data;
  360. struct device *dev = ss->pcm->card->dev;
  361. struct siu_port *port_info = siu_port_info(ss);
  362. int ret;
  363. dev_dbg(dev, "%s: port=%d@%p, cmd=%d\n", __func__,
  364. info->port_id, port_info, cmd);
  365. switch (cmd) {
  366. case SNDRV_PCM_TRIGGER_START:
  367. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  368. ret = siu_pcm_stmwrite_start(port_info);
  369. else
  370. ret = siu_pcm_stmread_start(port_info);
  371. if (ret < 0)
  372. dev_warn(dev, "%s: start failed on port=%d\n",
  373. __func__, info->port_id);
  374. break;
  375. case SNDRV_PCM_TRIGGER_STOP:
  376. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  377. siu_pcm_stmwrite_stop(port_info);
  378. else
  379. siu_pcm_stmread_stop(port_info);
  380. ret = 0;
  381. break;
  382. default:
  383. dev_err(dev, "%s() unsupported cmd=%d\n", __func__, cmd);
  384. ret = -EINVAL;
  385. }
  386. return ret;
  387. }
  388. /*
  389. * So far only resolution of one period is supported, subject to extending the
  390. * dmangine API
  391. */
  392. static snd_pcm_uframes_t siu_pcm_pointer_dma(struct snd_pcm_substream *ss)
  393. {
  394. struct device *dev = ss->pcm->card->dev;
  395. struct siu_info *info = siu_i2s_data;
  396. u32 __iomem *base = info->reg;
  397. struct siu_port *port_info = siu_port_info(ss);
  398. struct snd_pcm_runtime *rt = ss->runtime;
  399. size_t ptr;
  400. struct siu_stream *siu_stream;
  401. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  402. siu_stream = &port_info->playback;
  403. else
  404. siu_stream = &port_info->capture;
  405. /*
  406. * ptr is the offset into the buffer where the dma is currently at. We
  407. * check if the dma buffer has just wrapped.
  408. */
  409. ptr = PERIOD_OFFSET(rt->dma_addr,
  410. siu_stream->cur_period,
  411. siu_stream->period_bytes) - rt->dma_addr;
  412. dev_dbg(dev,
  413. "%s: port=%d, events %x, FSTS %x, xferred %u/%u, cookie %d\n",
  414. __func__, info->port_id, siu_read32(base + SIU_EVNTC),
  415. siu_read32(base + SIU_SBFSTS), ptr, siu_stream->buf_bytes,
  416. siu_stream->cookie);
  417. if (ptr >= siu_stream->buf_bytes)
  418. ptr = 0;
  419. return bytes_to_frames(ss->runtime, ptr);
  420. }
  421. static int siu_pcm_new(struct snd_soc_pcm_runtime *rtd)
  422. {
  423. /* card->dev == socdev->dev, see snd_soc_new_pcms() */
  424. struct snd_card *card = rtd->card->snd_card;
  425. struct snd_pcm *pcm = rtd->pcm;
  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. dev_dbg(pcm->card->dev, "%s\n", __func__);
  476. }
  477. static struct snd_pcm_ops siu_pcm_ops = {
  478. .open = siu_pcm_open,
  479. .close = siu_pcm_close,
  480. .ioctl = snd_pcm_lib_ioctl,
  481. .hw_params = siu_pcm_hw_params,
  482. .hw_free = siu_pcm_hw_free,
  483. .prepare = siu_pcm_prepare,
  484. .trigger = siu_pcm_trigger,
  485. .pointer = siu_pcm_pointer_dma,
  486. };
  487. struct snd_soc_platform_driver siu_platform = {
  488. .ops = &siu_pcm_ops,
  489. .pcm_new = siu_pcm_new,
  490. .pcm_free = siu_pcm_free,
  491. };
  492. EXPORT_SYMBOL_GPL(siu_platform);