Lines Matching refs:pipe

97 	struct audiopipe *pipe = runtime->private_data;
99 if (pipe->sgpage.area)
100 snd_dma_free_pages(&pipe->sgpage);
101 kfree(pipe);
270 struct audiopipe *pipe;
279 pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
280 if (!pipe)
282 pipe->index = -1; /* Not configured yet */
285 memcpy(&pipe->hw, &pcm_hardware_skel, sizeof(struct snd_pcm_hardware));
287 pipe->constr.list = channels_list;
288 pipe->constr.mask = 0;
290 pipe->constr.count = i;
291 if (pipe->hw.channels_max > max_channels)
292 pipe->hw.channels_max = max_channels;
294 pipe->hw.rate_max = 48000;
295 pipe->hw.rates &= SNDRV_PCM_RATE_8000_48000;
298 runtime->hw = pipe->hw;
299 runtime->private_data = pipe;
306 &pipe->constr);
338 PAGE_SIZE, &pipe->sgpage);
508 /* Nothing to do here. Audio is already off and pipe will be
542 struct audiopipe *pipe;
545 pipe = (struct audiopipe *) substream->runtime->private_data;
551 if (pipe->index >= 0) {
552 dev_dbg(chip->card->dev, "hwp_ie free(%d)\n", pipe->index);
553 err = free_pipes(chip, pipe);
555 chip->substream[pipe->index] = NULL;
558 err = allocate_pipes(chip, pipe, pipe_index, interleave);
573 sglist_init(chip, pipe);
584 sglist_add_mapping(chip, pipe, addr, rest);
585 sglist_add_irq(chip, pipe);
589 sglist_add_mapping(chip, pipe, addr,
602 sglist_wrap(chip, pipe);
607 pipe->last_period = 0;
608 pipe->last_counter = 0;
609 pipe->position = 0;
672 struct audiopipe *pipe;
675 pipe = (struct audiopipe *) substream->runtime->private_data;
678 if (pipe->index >= 0) {
679 dev_dbg(chip->card->dev, "pcm_hw_free(%d)\n", pipe->index);
680 free_pipes(chip, pipe);
681 chip->substream[pipe->index] = NULL;
682 pipe->index = -1;
752 struct audiopipe *pipe;
773 pipe = chip->substream[i]->runtime->private_data;
774 switch (pipe->state) {
776 pipe->last_period = 0;
777 pipe->last_counter = 0;
778 pipe->position = 0;
779 *pipe->dma_counter = 0;
782 pipe->state = PIPE_STATE_STARTED;
796 pipe = chip->substream[i]->runtime->private_data;
797 pipe->state = PIPE_STATE_STOPPED;
805 pipe = chip->substream[i]->runtime->private_data;
806 pipe->state = PIPE_STATE_PAUSED;
823 struct audiopipe *pipe = runtime->private_data;
831 counter = le32_to_cpu(*pipe->dma_counter); /* presumed atomic */
833 step = counter - pipe->last_counter; /* handles wrapping */
834 pipe->last_counter = counter;
840 pipe->position += step;
841 pipe->position %= frames_to_bytes(runtime, runtime->buffer_size); /* wrap */
843 return bytes_to_frames(runtime, pipe->position);
1823 struct audiopipe *pipe = runtime->private_data;
1827 if (pipe->state != PIPE_STATE_STARTED)
1832 counter = le32_to_cpu(*pipe->dma_counter); /* presumed atomic */
1834 step = counter - pipe->last_period; /* handles wrapping */
1840 pipe->last_period += step; /* used exclusively by us */