Lines Matching full:pi
19 struct pcm_info **pi, struct pcm_info **other)
22 if (pi)
23 *pi = &i2sdev->in;
27 if (pi)
28 *pi = &i2sdev->out;
74 struct pcm_info *pi, *other;
87 get_pcm_info(i2sdev, in, &pi, &other);
89 hw = &pi->substream->runtime->hw;
92 if (pi->active) {
191 err = snd_pcm_hw_constraint_integer(pi->substream->runtime,
197 err = cii->codec->open(cii, pi->substream);
205 pi->substream);
223 struct pcm_info *pi;
228 get_pcm_info(i2sdev, in, &pi, NULL);
232 tmp = cii->codec->close(cii, pi->substream);
238 pi->substream = NULL;
239 pi->active = 0;
244 struct pcm_info *pi)
251 if (pi->dbdma_ring.stopping) {
252 pi->stop_completion = &done;
256 pi->stop_completion = NULL;
261 out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
262 pi->dbdma_ring.stopping = 0;
264 while (in_le32(&pi->dbdma->status) & ACTIVE) {
277 struct pcm_info *pi;
279 get_pcm_info(i2sdev, 0, &pi, NULL);
280 i2sbus_wait_for_stop(i2sdev, pi);
281 get_pcm_info(i2sdev, 1, &pi, NULL);
282 i2sbus_wait_for_stop(i2sdev, pi);
289 struct pcm_info *pi;
291 get_pcm_info(i2sdev, in, &pi, NULL);
292 if (pi->dbdma_ring.stopping)
293 i2sbus_wait_for_stop(i2sdev, pi);
321 struct pcm_info *pi, *other;
327 get_pcm_info(i2sdev, in, &pi, &other);
329 if (pi->dbdma_ring.running)
331 if (pi->dbdma_ring.stopping)
332 i2sbus_wait_for_stop(i2sdev, pi);
334 if (!pi->substream || !pi->substream->runtime)
337 runtime = pi->substream->runtime;
338 pi->active = 1;
347 periodsize = snd_pcm_lib_period_bytes(pi->substream);
348 nperiods = pi->substream->runtime->periods;
349 pi->current_period = 0;
352 command = pi->dbdma_ring.cmds;
369 stopaddr = pi->dbdma_ring.bus_cmd_start +
380 command->cmd_dep = cpu_to_le32(pi->dbdma_ring.bus_cmd_start);
437 err = cii->codec->prepare(cii, &bi, pi->substream);
507 struct pcm_info *pi;
511 get_pcm_info(i2sdev, in, &pi, NULL);
516 if (pi->dbdma_ring.running)
520 cii->codec->start(cii, pi->substream);
521 pi->dbdma_ring.running = 1;
523 if (pi->dbdma_ring.stopping) {
525 out_le32(&pi->dbdma->control, 1 << 16);
526 if (in_le32(&pi->dbdma->status) & ACTIVE) {
529 if (in_le32(&pi->dbdma->status) & ACTIVE) {
530 pi->dbdma_ring.stopping = 0;
537 out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
540 out_le32(&pi->dbdma->br_sel, (1 << 16) | 1);
543 out_le32(&pi->dbdma->cmdptr, pi->dbdma_ring.bus_cmd_start);
546 pi->current_period = 0;
547 pi->frame_count = in_le32(&i2sdev->intfregs->frame_count);
550 out_le32(&pi->dbdma->control, (RUN << 16) | RUN);
557 if (!pi->dbdma_ring.running)
559 pi->dbdma_ring.running = 0;
562 out_le32(&pi->dbdma->control, (1 << 16) | 1);
563 pi->dbdma_ring.stopping = 1;
567 cii->codec->stop(cii, pi->substream);
578 struct pcm_info *pi;
581 get_pcm_info(i2sdev, in, &pi, NULL);
584 fc = fc - pi->frame_count;
586 if (fc >= pi->substream->runtime->buffer_size)
587 fc %= pi->substream->runtime->buffer_size;
593 struct pcm_info *pi;
601 get_pcm_info(i2sdev, in, &pi, NULL);
602 if (!pi->dbdma_ring.running && !pi->dbdma_ring.stopping)
605 i = pi->current_period;
606 runtime = pi->substream->runtime;
607 while (pi->dbdma_ring.cmds[i].xfer_status) {
608 if (le16_to_cpu(pi->dbdma_ring.cmds[i].xfer_status) & BT)
615 pi->dbdma_ring.cmds[i].xfer_status = 0;
619 pi->frame_count += runtime->buffer_size;
621 pi->current_period = i;
629 if (fc < pi->frame_count + nframes)
630 pi->frame_count = fc - nframes;
636 status = in_le32(&pi->dbdma->status);
648 out_le32(&pi->dbdma->control, (RUN | PAUSE | 1) << 16);
650 pi->dbdma_ring.stopping = 0;
651 if (pi->stop_completion)
652 complete(pi->stop_completion);
655 if (!pi->dbdma_ring.running)
660 snd_pcm_period_elapsed(pi->substream);