Lines Matching refs:dpcm
450 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_pcm_hw_params() local
465 hpi_handle_error(hpi_format_create(&dpcm->format, in snd_card_asihpi_pcm_hw_params()
470 if (hpi_instream_reset(dpcm->h_stream) != 0) in snd_card_asihpi_pcm_hw_params()
474 dpcm->h_stream, &dpcm->format) != 0) in snd_card_asihpi_pcm_hw_params()
478 dpcm->hpi_buffer_attached = 0; in snd_card_asihpi_pcm_hw_params()
480 err = hpi_stream_host_buffer_attach(dpcm->h_stream, in snd_card_asihpi_pcm_hw_params()
493 err = hpi_stream_get_info_ex(dpcm->h_stream, NULL, in snd_card_asihpi_pcm_hw_params()
494 &dpcm->hpi_buffer_attached, in snd_card_asihpi_pcm_hw_params()
498 dpcm->hpi_buffer_attached); in snd_card_asihpi_pcm_hw_params()
508 dpcm->bytes_per_sec = bytes_per_sec; in snd_card_asihpi_pcm_hw_params()
509 dpcm->buffer_bytes = params_buffer_bytes(params); in snd_card_asihpi_pcm_hw_params()
510 dpcm->period_bytes = params_period_bytes(params); in snd_card_asihpi_pcm_hw_params()
519 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_hw_free() local
520 if (dpcm->hpi_buffer_attached) in snd_card_asihpi_hw_free()
521 hpi_stream_host_buffer_detach(dpcm->h_stream); in snd_card_asihpi_hw_free()
529 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_runtime_free() local
530 kfree(dpcm); in snd_card_asihpi_runtime_free()
537 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_pcm_timer_start() local
543 dpcm->timer.expires = jiffies + expiry; in snd_card_asihpi_pcm_timer_start()
544 dpcm->respawn_timer = 1; in snd_card_asihpi_pcm_timer_start()
545 add_timer(&dpcm->timer); in snd_card_asihpi_pcm_timer_start()
551 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_pcm_timer_stop() local
553 dpcm->respawn_timer = 0; in snd_card_asihpi_pcm_timer_stop()
554 del_timer(&dpcm->timer); in snd_card_asihpi_pcm_timer_stop()
560 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; in snd_card_asihpi_trigger() local
603 dpcm->h_stream, in snd_card_asihpi_trigger()
619 hpi_handle_error(hpi_stream_start(dpcm->h_stream)); in snd_card_asihpi_trigger()
644 hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); in snd_card_asihpi_trigger()
647 hpi_outstream_reset(dpcm->h_stream)); in snd_card_asihpi_trigger()
650 hpi_handle_error(hpi_stream_group_reset(dpcm->h_stream)); in snd_card_asihpi_trigger()
655 hpi_handle_error(hpi_stream_start(dpcm->h_stream)); in snd_card_asihpi_trigger()
661 hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); in snd_card_asihpi_trigger()
718 struct snd_card_asihpi_pcm *dpcm = (struct snd_card_asihpi_pcm *)data; in snd_card_asihpi_timer_function() local
719 struct snd_pcm_substream *substream = dpcm->substream; in snd_card_asihpi_timer_function()
814 remdata = newdata % dpcm->period_bytes; in snd_card_asihpi_timer_function()
820 if (xfercount && (on_card_bytes > dpcm->period_bytes)) in snd_card_asihpi_timer_function()
821 next_jiffies = ((on_card_bytes - dpcm->period_bytes) * HZ / dpcm->bytes_per_sec); in snd_card_asihpi_timer_function()
823 next_jiffies = ((dpcm->period_bytes - remdata) * HZ / dpcm->bytes_per_sec); in snd_card_asihpi_timer_function()
826 dpcm->timer.expires = jiffies + next_jiffies; in snd_card_asihpi_timer_function()
901 if (dpcm->respawn_timer) in snd_card_asihpi_timer_function()
902 add_timer(&dpcm->timer); in snd_card_asihpi_timer_function()
919 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_playback_prepare() local
923 hpi_handle_error(hpi_outstream_reset(dpcm->h_stream)); in snd_card_asihpi_playback_prepare()
924 dpcm->pcm_buf_host_rw_ofs = 0; in snd_card_asihpi_playback_prepare()
925 dpcm->pcm_buf_dma_ofs = 0; in snd_card_asihpi_playback_prepare()
926 dpcm->pcm_buf_elapsed_dma_ofs = 0; in snd_card_asihpi_playback_prepare()
934 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_playback_pointer() local
939 ptr = bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); in snd_card_asihpi_playback_pointer()
980 struct snd_card_asihpi_pcm *dpcm; in snd_card_asihpi_playback_open() local
985 dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); in snd_card_asihpi_playback_open()
986 if (dpcm == NULL) in snd_card_asihpi_playback_open()
990 substream->number, &dpcm->h_stream); in snd_card_asihpi_playback_open()
993 kfree(dpcm); in snd_card_asihpi_playback_open()
1004 init_timer(&dpcm->timer); in snd_card_asihpi_playback_open()
1005 dpcm->timer.data = (unsigned long) dpcm; in snd_card_asihpi_playback_open()
1006 dpcm->timer.function = snd_card_asihpi_timer_function; in snd_card_asihpi_playback_open()
1007 dpcm->substream = substream; in snd_card_asihpi_playback_open()
1008 runtime->private_data = dpcm; in snd_card_asihpi_playback_open()
1023 snd_card_asihpi_playback_formats(card, dpcm->h_stream); in snd_card_asihpi_playback_open()
1063 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_playback_close() local
1065 hpi_handle_error(hpi_outstream_close(dpcm->h_stream)); in snd_card_asihpi_playback_close()
1087 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_capture_pointer() local
1090 substream->number, dpcm->pcm_buf_dma_ofs); in snd_card_asihpi_capture_pointer()
1095 return bytes_to_frames(runtime, dpcm->pcm_buf_dma_ofs % dpcm->buffer_bytes); in snd_card_asihpi_capture_pointer()
1107 struct snd_card_asihpi_pcm *dpcm = runtime->private_data; in snd_card_asihpi_capture_prepare() local
1109 hpi_handle_error(hpi_instream_reset(dpcm->h_stream)); in snd_card_asihpi_capture_prepare()
1110 dpcm->pcm_buf_host_rw_ofs = 0; in snd_card_asihpi_capture_prepare()
1111 dpcm->pcm_buf_dma_ofs = 0; in snd_card_asihpi_capture_prepare()
1112 dpcm->pcm_buf_elapsed_dma_ofs = 0; in snd_card_asihpi_capture_prepare()
1157 struct snd_card_asihpi_pcm *dpcm; in snd_card_asihpi_capture_open() local
1161 dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); in snd_card_asihpi_capture_open()
1162 if (dpcm == NULL) in snd_card_asihpi_capture_open()
1170 substream->number, &dpcm->h_stream)); in snd_card_asihpi_capture_open()
1172 kfree(dpcm); in snd_card_asihpi_capture_open()
1178 init_timer(&dpcm->timer); in snd_card_asihpi_capture_open()
1179 dpcm->timer.data = (unsigned long) dpcm; in snd_card_asihpi_capture_open()
1180 dpcm->timer.function = snd_card_asihpi_timer_function; in snd_card_asihpi_capture_open()
1181 dpcm->substream = substream; in snd_card_asihpi_capture_open()
1182 runtime->private_data = dpcm; in snd_card_asihpi_capture_open()
1195 snd_card_asihpi_capture_formats(card, dpcm->h_stream); in snd_card_asihpi_capture_open()
1224 struct snd_card_asihpi_pcm *dpcm = substream->runtime->private_data; in snd_card_asihpi_capture_close() local
1226 hpi_handle_error(hpi_instream_close(dpcm->h_stream)); in snd_card_asihpi_capture_close()