Lines Matching refs:cobsc
96 static void cobalt_alsa_announce_pcm_data(struct snd_cobalt_card *cobsc, in cobalt_alsa_announce_pcm_data() argument
110 dprintk("cobalt alsa announce ptr=%p data=%p num_bytes=%zd\n", cobsc, in cobalt_alsa_announce_pcm_data()
113 substream = cobsc->capture_pcm_substream; in cobalt_alsa_announce_pcm_data()
142 oldptr = cobsc->hwptr_done_capture; in cobalt_alsa_announce_pcm_data()
164 cobsc->hwptr_done_capture += length; in cobalt_alsa_announce_pcm_data()
165 if (cobsc->hwptr_done_capture >= in cobalt_alsa_announce_pcm_data()
167 cobsc->hwptr_done_capture -= in cobalt_alsa_announce_pcm_data()
170 cobsc->capture_transfer_done += length; in cobalt_alsa_announce_pcm_data()
171 if (cobsc->capture_transfer_done >= in cobalt_alsa_announce_pcm_data()
173 cobsc->capture_transfer_done -= in cobalt_alsa_announce_pcm_data()
209 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_capture_open() local
210 struct cobalt_stream *s = cobsc->s; in snd_cobalt_pcm_capture_open()
214 cobsc->capture_pcm_substream = substream; in snd_cobalt_pcm_capture_open()
216 cobsc->alsa_record_cnt++; in snd_cobalt_pcm_capture_open()
217 if (cobsc->alsa_record_cnt == 1) { in snd_cobalt_pcm_capture_open()
222 cobsc->alsa_record_cnt--; in snd_cobalt_pcm_capture_open()
231 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_capture_close() local
232 struct cobalt_stream *s = cobsc->s; in snd_cobalt_pcm_capture_close()
234 cobsc->alsa_record_cnt--; in snd_cobalt_pcm_capture_close()
235 if (cobsc->alsa_record_cnt == 0) in snd_cobalt_pcm_capture_close()
242 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_prepare() local
244 cobsc->hwptr_done_capture = 0; in snd_cobalt_pcm_prepare()
245 cobsc->capture_transfer_done = 0; in snd_cobalt_pcm_prepare()
266 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_pointer() local
268 hwptr_done = cobsc->hwptr_done_capture; in snd_cobalt_pcm_pointer()
296 static void cobalt_alsa_pb_pcm_data(struct snd_cobalt_card *cobsc, in cobalt_alsa_pb_pcm_data() argument
309 dprintk("cobalt alsa pb ptr=%p data=%p samples=%zd\n", cobsc, in cobalt_alsa_pb_pcm_data()
312 substream = cobsc->playback_pcm_substream; in cobalt_alsa_pb_pcm_data()
341 pos = cobsc->pb_pos % cobsc->pb_size; in cobalt_alsa_pb_pcm_data()
342 for (i = 0; i < cobsc->pb_count / (8 * 4); i++) in cobalt_alsa_pb_pcm_data()
348 cobsc->pb_pos += i * stride; in cobalt_alsa_pb_pcm_data()
351 if (cobsc->pb_pos % cobsc->pb_count == 0) in cobalt_alsa_pb_pcm_data()
369 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_playback_open() local
371 struct cobalt_stream *s = cobsc->s; in snd_cobalt_pcm_playback_open()
375 cobsc->playback_pcm_substream = substream; in snd_cobalt_pcm_playback_open()
377 cobsc->alsa_playback_cnt++; in snd_cobalt_pcm_playback_open()
378 if (cobsc->alsa_playback_cnt == 1) { in snd_cobalt_pcm_playback_open()
383 cobsc->alsa_playback_cnt--; in snd_cobalt_pcm_playback_open()
393 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_playback_close() local
394 struct cobalt_stream *s = cobsc->s; in snd_cobalt_pcm_playback_close()
396 cobsc->alsa_playback_cnt--; in snd_cobalt_pcm_playback_close()
397 if (cobsc->alsa_playback_cnt == 0) in snd_cobalt_pcm_playback_close()
404 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_pb_prepare() local
406 cobsc->pb_size = snd_pcm_lib_buffer_bytes(substream); in snd_cobalt_pcm_pb_prepare()
407 cobsc->pb_count = snd_pcm_lib_period_bytes(substream); in snd_cobalt_pcm_pb_prepare()
408 cobsc->pb_pos = 0; in snd_cobalt_pcm_pb_prepare()
416 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_pb_trigger() local
420 if (cobsc->alsa_pb_channel) in snd_cobalt_pcm_pb_trigger()
422 cobsc->alsa_pb_channel = true; in snd_cobalt_pcm_pb_trigger()
425 cobsc->alsa_pb_channel = false; in snd_cobalt_pcm_pb_trigger()
435 struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream); in snd_cobalt_pcm_pb_pointer() local
438 ptr = cobsc->pb_pos; in snd_cobalt_pcm_pb_pointer()
460 int snd_cobalt_pcm_create(struct snd_cobalt_card *cobsc) in snd_cobalt_pcm_create() argument
463 struct snd_card *sc = cobsc->sc; in snd_cobalt_pcm_create()
464 struct cobalt_stream *s = cobsc->s; in snd_cobalt_pcm_create()
496 sp->private_data = cobsc; in snd_cobalt_pcm_create()
522 sp->private_data = cobsc; in snd_cobalt_pcm_create()