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_dai.private_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_dai.private_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_dai.private_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_dai.private_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_dai.private_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_dai.private_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 siu_info *info = siu_i2s_dai.private_data;
  274. struct siu_port *port_info = siu_port_info(ss);
  275. struct siu_stream *siu_stream;
  276. u32 port = info->port_id;
  277. struct siu_platform *pdata = siu_i2s_dai.dev->platform_data;
  278. struct device *dev = ss->pcm->card->dev;
  279. dma_cap_mask_t mask;
  280. struct sh_dmae_slave *param;
  281. dma_cap_zero(mask);
  282. dma_cap_set(DMA_SLAVE, mask);
  283. dev_dbg(dev, "%s, port=%d@%p\n", __func__, port, port_info);
  284. if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) {
  285. siu_stream = &port_info->playback;
  286. param = &siu_stream->param;
  287. param->slave_id = port ? pdata->dma_slave_tx_b :
  288. pdata->dma_slave_tx_a;
  289. } else {
  290. siu_stream = &port_info->capture;
  291. param = &siu_stream->param;
  292. param->slave_id = port ? pdata->dma_slave_rx_b :
  293. pdata->dma_slave_rx_a;
  294. }
  295. param->dma_dev = pdata->dma_dev;
  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_dai.private_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_dai.private_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_dai.private_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_dai.private_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_card *card, struct snd_soc_dai *dai,
  422. struct snd_pcm *pcm)
  423. {
  424. /* card->dev == socdev->dev, see snd_soc_new_pcms() */
  425. struct siu_info *info = siu_i2s_dai.private_data;
  426. struct platform_device *pdev = to_platform_device(card->dev);
  427. int ret;
  428. int i;
  429. /* pdev->id selects between SIUA and SIUB */
  430. if (pdev->id < 0 || pdev->id >= SIU_PORT_NUM)
  431. return -EINVAL;
  432. info->port_id = pdev->id;
  433. /*
  434. * While the siu has 2 ports, only one port can be on at a time (only 1
  435. * SPB). So far all the boards using the siu had only one of the ports
  436. * wired to a codec. To simplify things, we only register one port with
  437. * alsa. In case both ports are needed, it should be changed here
  438. */
  439. for (i = pdev->id; i < pdev->id + 1; i++) {
  440. struct siu_port **port_info = &siu_ports[i];
  441. ret = siu_init_port(i, port_info, card);
  442. if (ret < 0)
  443. return ret;
  444. ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
  445. SNDRV_DMA_TYPE_DEV, NULL,
  446. SIU_BUFFER_BYTES_MAX, SIU_BUFFER_BYTES_MAX);
  447. if (ret < 0) {
  448. dev_err(card->dev,
  449. "snd_pcm_lib_preallocate_pages_for_all() err=%d",
  450. ret);
  451. goto fail;
  452. }
  453. (*port_info)->pcm = pcm;
  454. /* IO tasklets */
  455. tasklet_init(&(*port_info)->playback.tasklet, siu_io_tasklet,
  456. (unsigned long)&(*port_info)->playback);
  457. tasklet_init(&(*port_info)->capture.tasklet, siu_io_tasklet,
  458. (unsigned long)&(*port_info)->capture);
  459. }
  460. dev_info(card->dev, "SuperH SIU driver initialized.\n");
  461. return 0;
  462. fail:
  463. siu_free_port(siu_ports[pdev->id]);
  464. dev_err(card->dev, "SIU: failed to initialize.\n");
  465. return ret;
  466. }
  467. static void siu_pcm_free(struct snd_pcm *pcm)
  468. {
  469. struct platform_device *pdev = to_platform_device(pcm->card->dev);
  470. struct siu_port *port_info = siu_ports[pdev->id];
  471. tasklet_kill(&port_info->capture.tasklet);
  472. tasklet_kill(&port_info->playback.tasklet);
  473. siu_free_port(port_info);
  474. snd_pcm_lib_preallocate_free_for_all(pcm);
  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 siu_platform = {
  488. .name = "siu-audio",
  489. .pcm_ops = &siu_pcm_ops,
  490. .pcm_new = siu_pcm_new,
  491. .pcm_free = siu_pcm_free,
  492. };
  493. EXPORT_SYMBOL_GPL(siu_platform);