Lines Matching refs:pipe

98 	struct audiopipe *pipe = runtime->private_data;
100 if (pipe->sgpage.area)
101 snd_dma_free_pages(&pipe->sgpage);
102 kfree(pipe);
271 struct audiopipe *pipe;
280 pipe = kzalloc(sizeof(struct audiopipe), GFP_KERNEL);
281 if (!pipe)
283 pipe->index = -1; /* Not configured yet */
286 memcpy(&pipe->hw, &pcm_hardware_skel, sizeof(struct snd_pcm_hardware));
288 pipe->constr.list = channels_list;
289 pipe->constr.mask = 0;
291 pipe->constr.count = i;
292 if (pipe->hw.channels_max > max_channels)
293 pipe->hw.channels_max = max_channels;
295 pipe->hw.rate_max = 48000;
296 pipe->hw.rates &= SNDRV_PCM_RATE_8000_48000;
299 runtime->hw = pipe->hw;
300 runtime->private_data = pipe;
307 &pipe->constr)) < 0)
336 PAGE_SIZE, &pipe->sgpage)) < 0) {
495 /* Nothing to do here. Audio is already off and pipe will be
529 struct audiopipe *pipe;
532 pipe = (struct audiopipe *) substream->runtime->private_data;
538 if (pipe->index >= 0) {
539 dev_dbg(chip->card->dev, "hwp_ie free(%d)\n", pipe->index);
540 err = free_pipes(chip, pipe);
542 chip->substream[pipe->index] = NULL;
545 err = allocate_pipes(chip, pipe, pipe_index, interleave);
560 sglist_init(chip, pipe);
571 sglist_add_mapping(chip, pipe, addr, rest);
572 sglist_add_irq(chip, pipe);
576 sglist_add_mapping(chip, pipe, addr,
589 sglist_wrap(chip, pipe);
594 pipe->last_period = 0;
595 pipe->last_counter = 0;
596 pipe->position = 0;
659 struct audiopipe *pipe;
662 pipe = (struct audiopipe *) substream->runtime->private_data;
665 if (pipe->index >= 0) {
666 dev_dbg(chip->card->dev, "pcm_hw_free(%d)\n", pipe->index);
667 free_pipes(chip, pipe);
668 chip->substream[pipe->index] = NULL;
669 pipe->index = -1;
739 struct audiopipe *pipe;
760 pipe = chip->substream[i]->runtime->private_data;
761 switch (pipe->state) {
763 pipe->last_period = 0;
764 pipe->last_counter = 0;
765 pipe->position = 0;
766 *pipe->dma_counter = 0;
769 pipe->state = PIPE_STATE_STARTED;
783 pipe = chip->substream[i]->runtime->private_data;
784 pipe->state = PIPE_STATE_STOPPED;
792 pipe = chip->substream[i]->runtime->private_data;
793 pipe->state = PIPE_STATE_PAUSED;
810 struct audiopipe *pipe = runtime->private_data;
818 counter = le32_to_cpu(*pipe->dma_counter); /* presumed atomic */
820 step = counter - pipe->last_counter; /* handles wrapping */
821 pipe->last_counter = counter;
827 pipe->position += step;
828 pipe->position %= frames_to_bytes(runtime, runtime->buffer_size); /* wrap */
830 return bytes_to_frames(runtime, pipe->position);
1805 struct audiopipe *pipe = runtime->private_data;
1809 if (pipe->state != PIPE_STATE_STARTED)
1814 counter = le32_to_cpu(*pipe->dma_counter); /* presumed atomic */
1816 step = counter - pipe->last_period; /* handles wrapping */
1822 pipe->last_period += step; /* used exclusively by us */