Lines Matching refs:stream

42 	struct audio_stream stream[2];	/* playback & capture */
45 static void au1000_release_dma_link(struct audio_stream *stream)
50 stream->period_size = 0;
51 stream->periods = 0;
52 pointer = stream->buffer;
59 } while (pointer != stream->buffer);
60 stream->buffer = NULL;
63 static int au1000_setup_dma_link(struct audio_stream *stream,
67 struct snd_pcm_substream *substream = stream->substream;
75 if (stream->period_size == period_bytes &&
76 stream->periods == periods)
79 au1000_release_dma_link(stream);
81 stream->period_size = period_bytes;
82 stream->periods = periods;
84 stream->buffer = kmalloc(sizeof(struct pcm_period), GFP_KERNEL);
85 if (!stream->buffer)
87 pointer = stream->buffer;
95 au1000_release_dma_link(stream);
101 pointer->next = stream->buffer;
105 static void au1000_dma_stop(struct audio_stream *stream)
107 if (stream->buffer)
108 disable_dma(stream->dma);
111 static void au1000_dma_start(struct audio_stream *stream)
113 if (!stream->buffer)
116 init_dma(stream->dma);
117 if (get_dma_active_buffer(stream->dma) == 0) {
118 clear_dma_done0(stream->dma);
119 set_dma_addr0(stream->dma, stream->buffer->start);
120 set_dma_count0(stream->dma, stream->period_size >> 1);
121 set_dma_addr1(stream->dma, stream->buffer->next->start);
122 set_dma_count1(stream->dma, stream->period_size >> 1);
124 clear_dma_done1(stream->dma);
125 set_dma_addr1(stream->dma, stream->buffer->start);
126 set_dma_count1(stream->dma, stream->period_size >> 1);
127 set_dma_addr0(stream->dma, stream->buffer->next->start);
128 set_dma_count0(stream->dma, stream->period_size >> 1);
130 enable_dma_buffers(stream->dma);
131 start_dma(stream->dma);
136 struct audio_stream *stream = (struct audio_stream *)ptr;
137 struct snd_pcm_substream *substream = stream->substream;
139 switch (get_dma_buffer_done(stream->dma)) {
141 stream->buffer = stream->buffer->next;
142 clear_dma_done0(stream->dma);
143 set_dma_addr0(stream->dma, stream->buffer->next->start);
144 set_dma_count0(stream->dma, stream->period_size >> 1);
145 enable_dma_buffer0(stream->dma);
148 stream->buffer = stream->buffer->next;
149 clear_dma_done1(stream->dma);
150 set_dma_addr1(stream->dma, stream->buffer->next->start);
151 set_dma_count1(stream->dma, stream->period_size >> 1);
152 enable_dma_buffer1(stream->dma);
155 pr_debug("DMA %d missed interrupt.\n", stream->dma);
156 au1000_dma_stop(stream);
157 au1000_dma_start(stream);
160 pr_debug("DMA %d empty irq.\n", stream->dma);
187 return &(ctx->stream[ss->stream]);
195 int *dmaids, s = substream->stream;
204 ctx->stream[s].dma = request_au1000_dma(dmaids[s], name,
206 &ctx->stream[s]);
207 set_dma_mode(ctx->stream[s].dma,
208 get_dma_mode(ctx->stream[s].dma) & ~DMA_NC);
210 ctx->stream[s].substream = substream;
211 ctx->stream[s].buffer = NULL;
221 int stype = substream->stream;
223 ctx->stream[stype].substream = NULL;
224 free_au1000_dma(ctx->stream[stype].dma);
233 struct audio_stream *stream = ss_to_as(substream, component);
235 return au1000_setup_dma_link(stream,
243 struct audio_stream *stream = ss_to_as(substream, component);
244 au1000_release_dma_link(stream);
251 struct audio_stream *stream = ss_to_as(substream, component);
256 au1000_dma_start(stream);
259 au1000_dma_stop(stream);
271 struct audio_stream *stream = ss_to_as(ss, component);
274 location = get_dma_residue(stream->dma);
275 location = stream->buffer->relative_end - location;