siu_pcm.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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 = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
  108. &sg, 1, DMA_TO_DEVICE, 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 = desc->tx_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 = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,
  149. &sg, 1, DMA_FROM_DEVICE, 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 = desc->tx_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->slave_id);
  267. if (unlikely(param->dma_dev != chan->device->dev))
  268. return false;
  269. chan->private = param;
  270. return true;
  271. }
  272. static int siu_pcm_open(struct snd_pcm_substream *ss)
  273. {
  274. /* Playback / Capture */
  275. struct snd_soc_pcm_runtime *rtd = ss->private_data;
  276. struct siu_platform *pdata = rtd->platform->dev->platform_data;
  277. struct siu_info *info = siu_i2s_data;
  278. struct siu_port *port_info = siu_port_info(ss);
  279. struct siu_stream *siu_stream;
  280. u32 port = info->port_id;
  281. struct device *dev = ss->pcm->card->dev;
  282. dma_cap_mask_t mask;
  283. struct sh_dmae_slave *param;
  284. dma_cap_zero(mask);
  285. dma_cap_set(DMA_SLAVE, mask);
  286. dev_dbg(dev, "%s, port=%d@%p\n", __func__, port, port_info);
  287. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  288. siu_stream = &port_info->playback;
  289. param = &siu_stream->param;
  290. param->slave_id = port ? pdata->dma_slave_tx_b :
  291. pdata->dma_slave_tx_a;
  292. } else {
  293. siu_stream = &port_info->capture;
  294. param = &siu_stream->param;
  295. param->slave_id = port ? pdata->dma_slave_rx_b :
  296. pdata->dma_slave_rx_a;
  297. }
  298. param->dma_dev = pdata->dma_dev;
  299. /* Get DMA channel */
  300. siu_stream->chan = dma_request_channel(mask, filter, param);
  301. if (!siu_stream->chan) {
  302. dev_err(dev, "DMA channel allocation failed!\n");
  303. return -EBUSY;
  304. }
  305. siu_stream->substream = ss;
  306. return 0;
  307. }
  308. static int siu_pcm_close(struct snd_pcm_substream *ss)
  309. {
  310. struct siu_info *info = siu_i2s_data;
  311. struct device *dev = ss->pcm->card->dev;
  312. struct siu_port *port_info = siu_port_info(ss);
  313. struct siu_stream *siu_stream;
  314. dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id);
  315. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  316. siu_stream = &port_info->playback;
  317. else
  318. siu_stream = &port_info->capture;
  319. dma_release_channel(siu_stream->chan);
  320. siu_stream->chan = NULL;
  321. siu_stream->substream = NULL;
  322. return 0;
  323. }
  324. static int siu_pcm_prepare(struct snd_pcm_substream *ss)
  325. {
  326. struct siu_info *info = siu_i2s_data;
  327. struct siu_port *port_info = siu_port_info(ss);
  328. struct device *dev = ss->pcm->card->dev;
  329. struct snd_pcm_runtime *rt = ss->runtime;
  330. struct siu_stream *siu_stream;
  331. snd_pcm_sframes_t xfer_cnt;
  332. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  333. siu_stream = &port_info->playback;
  334. else
  335. siu_stream = &port_info->capture;
  336. rt = siu_stream->substream->runtime;
  337. siu_stream->buf_bytes = snd_pcm_lib_buffer_bytes(ss);
  338. siu_stream->period_bytes = snd_pcm_lib_period_bytes(ss);
  339. dev_dbg(dev, "%s: port=%d, %d channels, period=%u bytes\n", __func__,
  340. info->port_id, rt->channels, siu_stream->period_bytes);
  341. /* We only support buffers that are multiples of the period */
  342. if (siu_stream->buf_bytes % siu_stream->period_bytes) {
  343. dev_err(dev, "%s() - buffer=%d not multiple of period=%d\n",
  344. __func__, siu_stream->buf_bytes,
  345. siu_stream->period_bytes);
  346. return -EINVAL;
  347. }
  348. xfer_cnt = bytes_to_frames(rt, siu_stream->period_bytes);
  349. if (!xfer_cnt || xfer_cnt > 0x1000000)
  350. return -EINVAL;
  351. siu_stream->format = rt->format;
  352. siu_stream->xfer_cnt = xfer_cnt;
  353. dev_dbg(dev, "port=%d buf=%lx buf_bytes=%d period_bytes=%d "
  354. "format=%d channels=%d xfer_cnt=%d\n", info->port_id,
  355. (unsigned long)rt->dma_addr, siu_stream->buf_bytes,
  356. siu_stream->period_bytes,
  357. siu_stream->format, rt->channels, (int)xfer_cnt);
  358. return 0;
  359. }
  360. static int siu_pcm_trigger(struct snd_pcm_substream *ss, int cmd)
  361. {
  362. struct siu_info *info = siu_i2s_data;
  363. struct device *dev = ss->pcm->card->dev;
  364. struct siu_port *port_info = siu_port_info(ss);
  365. int ret;
  366. dev_dbg(dev, "%s: port=%d@%p, cmd=%d\n", __func__,
  367. info->port_id, port_info, cmd);
  368. switch (cmd) {
  369. case SNDRV_PCM_TRIGGER_START:
  370. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  371. ret = siu_pcm_stmwrite_start(port_info);
  372. else
  373. ret = siu_pcm_stmread_start(port_info);
  374. if (ret < 0)
  375. dev_warn(dev, "%s: start failed on port=%d\n",
  376. __func__, info->port_id);
  377. break;
  378. case SNDRV_PCM_TRIGGER_STOP:
  379. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  380. siu_pcm_stmwrite_stop(port_info);
  381. else
  382. siu_pcm_stmread_stop(port_info);
  383. ret = 0;
  384. break;
  385. default:
  386. dev_err(dev, "%s() unsupported cmd=%d\n", __func__, cmd);
  387. ret = -EINVAL;
  388. }
  389. return ret;
  390. }
  391. /*
  392. * So far only resolution of one period is supported, subject to extending the
  393. * dmangine API
  394. */
  395. static snd_pcm_uframes_t siu_pcm_pointer_dma(struct snd_pcm_substream *ss)
  396. {
  397. struct device *dev = ss->pcm->card->dev;
  398. struct siu_info *info = siu_i2s_data;
  399. u32 __iomem *base = info->reg;
  400. struct siu_port *port_info = siu_port_info(ss);
  401. struct snd_pcm_runtime *rt = ss->runtime;
  402. size_t ptr;
  403. struct siu_stream *siu_stream;
  404. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
  405. siu_stream = &port_info->playback;
  406. else
  407. siu_stream = &port_info->capture;
  408. /*
  409. * ptr is the offset into the buffer where the dma is currently at. We
  410. * check if the dma buffer has just wrapped.
  411. */
  412. ptr = PERIOD_OFFSET(rt->dma_addr,
  413. siu_stream->cur_period,
  414. siu_stream->period_bytes) - rt->dma_addr;
  415. dev_dbg(dev,
  416. "%s: port=%d, events %x, FSTS %x, xferred %u/%u, cookie %d\n",
  417. __func__, info->port_id, siu_read32(base + SIU_EVNTC),
  418. siu_read32(base + SIU_SBFSTS), ptr, siu_stream->buf_bytes,
  419. siu_stream->cookie);
  420. if (ptr >= siu_stream->buf_bytes)
  421. ptr = 0;
  422. return bytes_to_frames(ss->runtime, ptr);
  423. }
  424. static int siu_pcm_new(struct snd_card *card, struct snd_soc_dai *dai,
  425. struct snd_pcm *pcm)
  426. {
  427. /* card->dev == socdev->dev, see snd_soc_new_pcms() */
  428. struct siu_info *info = siu_i2s_data;
  429. struct platform_device *pdev = to_platform_device(card->dev);
  430. int ret;
  431. int i;
  432. /* pdev->id selects between SIUA and SIUB */
  433. if (pdev->id < 0 || pdev->id >= SIU_PORT_NUM)
  434. return -EINVAL;
  435. info->port_id = pdev->id;
  436. /*
  437. * While the siu has 2 ports, only one port can be on at a time (only 1
  438. * SPB). So far all the boards using the siu had only one of the ports
  439. * wired to a codec. To simplify things, we only register one port with
  440. * alsa. In case both ports are needed, it should be changed here
  441. */
  442. for (i = pdev->id; i < pdev->id + 1; i++) {
  443. struct siu_port **port_info = &siu_ports[i];
  444. ret = siu_init_port(i, port_info, card);
  445. if (ret < 0)
  446. return ret;
  447. ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
  448. SNDRV_DMA_TYPE_DEV, NULL,
  449. SIU_BUFFER_BYTES_MAX, SIU_BUFFER_BYTES_MAX);
  450. if (ret < 0) {
  451. dev_err(card->dev,
  452. "snd_pcm_lib_preallocate_pages_for_all() err=%d",
  453. ret);
  454. goto fail;
  455. }
  456. (*port_info)->pcm = pcm;
  457. /* IO tasklets */
  458. tasklet_init(&(*port_info)->playback.tasklet, siu_io_tasklet,
  459. (unsigned long)&(*port_info)->playback);
  460. tasklet_init(&(*port_info)->capture.tasklet, siu_io_tasklet,
  461. (unsigned long)&(*port_info)->capture);
  462. }
  463. dev_info(card->dev, "SuperH SIU driver initialized.\n");
  464. return 0;
  465. fail:
  466. siu_free_port(siu_ports[pdev->id]);
  467. dev_err(card->dev, "SIU: failed to initialize.\n");
  468. return ret;
  469. }
  470. static void siu_pcm_free(struct snd_pcm *pcm)
  471. {
  472. struct platform_device *pdev = to_platform_device(pcm->card->dev);
  473. struct siu_port *port_info = siu_ports[pdev->id];
  474. tasklet_kill(&port_info->capture.tasklet);
  475. tasklet_kill(&port_info->playback.tasklet);
  476. siu_free_port(port_info);
  477. snd_pcm_lib_preallocate_free_for_all(pcm);
  478. dev_dbg(pcm->card->dev, "%s\n", __func__);
  479. }
  480. static struct snd_pcm_ops siu_pcm_ops = {
  481. .open = siu_pcm_open,
  482. .close = siu_pcm_close,
  483. .ioctl = snd_pcm_lib_ioctl,
  484. .hw_params = siu_pcm_hw_params,
  485. .hw_free = siu_pcm_hw_free,
  486. .prepare = siu_pcm_prepare,
  487. .trigger = siu_pcm_trigger,
  488. .pointer = siu_pcm_pointer_dma,
  489. };
  490. struct snd_soc_platform_driver siu_platform = {
  491. .ops = &siu_pcm_ops,
  492. .pcm_new = siu_pcm_new,
  493. .pcm_free = siu_pcm_free,
  494. };
  495. EXPORT_SYMBOL_GPL(siu_platform);