Lines Matching refs:substream
319 static void vt1724_enable_midi_irq(struct snd_rawmidi_substream *substream, in vt1724_enable_midi_irq() argument
322 struct snd_ice1712 *ice = substream->rmidi->private_data; in vt1724_enable_midi_irq()
555 static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd) in snd_vt1724_pcm_trigger() argument
557 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_pcm_trigger()
563 snd_pcm_group_for_each_entry(s, substream) { in snd_vt1724_pcm_trigger()
568 snd_pcm_trigger_done(s, substream); in snd_vt1724_pcm_trigger()
719 static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream, in snd_vt1724_pcm_hw_params() argument
722 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_pcm_hw_params()
728 if (substream == ice->playback_pro_substream) { in snd_vt1724_pcm_hw_params()
733 ice->pcm_reserved[i] != substream) { in snd_vt1724_pcm_hw_params()
737 ice->pcm_reserved[i] = substream; in snd_vt1724_pcm_hw_params()
740 if (ice->pcm_reserved[i] == substream) in snd_vt1724_pcm_hw_params()
746 if (ice->playback_con_substream_ds[i] == substream) { in snd_vt1724_pcm_hw_params()
748 ice->pcm_reserved[i] != substream) { in snd_vt1724_pcm_hw_params()
752 ice->pcm_reserved[i] = substream; in snd_vt1724_pcm_hw_params()
763 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); in snd_vt1724_pcm_hw_params()
766 static int snd_vt1724_pcm_hw_free(struct snd_pcm_substream *substream) in snd_vt1724_pcm_hw_free() argument
768 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_pcm_hw_free()
774 if (ice->pcm_reserved[i] == substream) in snd_vt1724_pcm_hw_free()
777 return snd_pcm_lib_free_pages(substream); in snd_vt1724_pcm_hw_free()
780 static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream) in snd_vt1724_playback_pro_prepare() argument
782 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_pro_prepare()
787 val = (8 - substream->runtime->channels) >> 1; in snd_vt1724_playback_pro_prepare()
790 outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR)); in snd_vt1724_playback_pro_prepare()
792 size = (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1; in snd_vt1724_playback_pro_prepare()
796 size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1; in snd_vt1724_playback_pro_prepare()
814 static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substream *substream) in snd_vt1724_playback_pro_pointer() argument
816 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_pro_pointer()
823 if (ptr < substream->runtime->dma_addr) { in snd_vt1724_playback_pro_pointer()
827 ptr -= substream->runtime->dma_addr; in snd_vt1724_playback_pro_pointer()
828 ptr = bytes_to_frames(substream->runtime, ptr); in snd_vt1724_playback_pro_pointer()
829 if (ptr >= substream->runtime->buffer_size) { in snd_vt1724_playback_pro_pointer()
831 (int)ptr, (int)substream->runtime->period_size); in snd_vt1724_playback_pro_pointer()
837 ptr = bytes_to_frames(substream->runtime, ptr); in snd_vt1724_playback_pro_pointer()
840 else if (ptr <= substream->runtime->buffer_size) in snd_vt1724_playback_pro_pointer()
841 ptr = substream->runtime->buffer_size - ptr; in snd_vt1724_playback_pro_pointer()
844 (int)ptr, (int)substream->runtime->buffer_size); in snd_vt1724_playback_pro_pointer()
851 static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream) in snd_vt1724_pcm_prepare() argument
853 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_pcm_prepare()
854 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; in snd_vt1724_pcm_prepare()
857 outl(substream->runtime->dma_addr, ice->profi_port + reg->addr); in snd_vt1724_pcm_prepare()
858 outw((snd_pcm_lib_buffer_bytes(substream) >> 2) - 1, in snd_vt1724_pcm_prepare()
860 outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1, in snd_vt1724_pcm_prepare()
866 static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substream) in snd_vt1724_pcm_pointer() argument
868 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_pcm_pointer()
869 const struct vt1724_pcm_reg *reg = substream->runtime->private_data; in snd_vt1724_pcm_pointer()
876 ptr -= substream->runtime->dma_addr; in snd_vt1724_pcm_pointer()
877 return bytes_to_frames(substream->runtime, ptr); in snd_vt1724_pcm_pointer()
881 ptr = bytes_to_frames(substream->runtime, ptr); in snd_vt1724_pcm_pointer()
884 else if (ptr <= substream->runtime->buffer_size) in snd_vt1724_pcm_pointer()
885 ptr = substream->runtime->buffer_size - ptr; in snd_vt1724_pcm_pointer()
888 (int)ptr, (int)substream->runtime->buffer_size); in snd_vt1724_pcm_pointer()
1004 struct snd_pcm_substream *substream) in set_rate_constraints() argument
1006 struct snd_pcm_runtime *runtime = substream->runtime; in set_rate_constraints()
1019 static void constrain_rate_if_locked(struct snd_pcm_substream *substream) in constrain_rate_if_locked() argument
1021 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in constrain_rate_if_locked()
1022 struct snd_pcm_runtime *runtime = substream->runtime; in constrain_rate_if_locked()
1040 static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream) in snd_vt1724_playback_pro_open() argument
1042 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vt1724_playback_pro_open()
1043 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_pro_open()
1047 ice->playback_pro_substream = substream; in snd_vt1724_playback_pro_open()
1049 snd_pcm_set_sync(substream); in snd_vt1724_playback_pro_open()
1051 set_rate_constraints(ice, substream); in snd_vt1724_playback_pro_open()
1068 constrain_rate_if_locked(substream); in snd_vt1724_playback_pro_open()
1070 ice->pro_open(ice, substream); in snd_vt1724_playback_pro_open()
1074 static int snd_vt1724_capture_pro_open(struct snd_pcm_substream *substream) in snd_vt1724_capture_pro_open() argument
1076 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_capture_pro_open()
1077 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vt1724_capture_pro_open()
1080 ice->capture_pro_substream = substream; in snd_vt1724_capture_pro_open()
1082 snd_pcm_set_sync(substream); in snd_vt1724_capture_pro_open()
1084 set_rate_constraints(ice, substream); in snd_vt1724_capture_pro_open()
1089 constrain_rate_if_locked(substream); in snd_vt1724_capture_pro_open()
1091 ice->pro_open(ice, substream); in snd_vt1724_capture_pro_open()
1095 static int snd_vt1724_playback_pro_close(struct snd_pcm_substream *substream) in snd_vt1724_playback_pro_close() argument
1097 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_pro_close()
1106 static int snd_vt1724_capture_pro_close(struct snd_pcm_substream *substream) in snd_vt1724_capture_pro_close() argument
1108 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_capture_pro_close()
1213 static int snd_vt1724_playback_spdif_prepare(struct snd_pcm_substream *substream) in snd_vt1724_playback_spdif_prepare() argument
1215 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_spdif_prepare()
1217 update_spdif_rate(ice, substream->runtime->rate); in snd_vt1724_playback_spdif_prepare()
1218 return snd_vt1724_pcm_prepare(substream); in snd_vt1724_playback_spdif_prepare()
1221 static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream) in snd_vt1724_playback_spdif_open() argument
1223 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_spdif_open()
1224 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vt1724_playback_spdif_open()
1227 ice->playback_con_substream = substream; in snd_vt1724_playback_spdif_open()
1230 set_rate_constraints(ice, substream); in snd_vt1724_playback_spdif_open()
1233 snd_pcm_set_sync(substream); in snd_vt1724_playback_spdif_open()
1239 constrain_rate_if_locked(substream); in snd_vt1724_playback_spdif_open()
1241 ice->spdif.ops.open(ice, substream); in snd_vt1724_playback_spdif_open()
1245 static int snd_vt1724_playback_spdif_close(struct snd_pcm_substream *substream) in snd_vt1724_playback_spdif_close() argument
1247 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_spdif_close()
1253 ice->spdif.ops.close(ice, substream); in snd_vt1724_playback_spdif_close()
1258 static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream) in snd_vt1724_capture_spdif_open() argument
1260 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_capture_spdif_open()
1261 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vt1724_capture_spdif_open()
1264 ice->capture_con_substream = substream; in snd_vt1724_capture_spdif_open()
1267 set_rate_constraints(ice, substream); in snd_vt1724_capture_spdif_open()
1270 snd_pcm_set_sync(substream); in snd_vt1724_capture_spdif_open()
1276 constrain_rate_if_locked(substream); in snd_vt1724_capture_spdif_open()
1278 ice->spdif.ops.open(ice, substream); in snd_vt1724_capture_spdif_open()
1282 static int snd_vt1724_capture_spdif_close(struct snd_pcm_substream *substream) in snd_vt1724_capture_spdif_close() argument
1284 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_capture_spdif_close()
1290 ice->spdif.ops.close(ice, substream); in snd_vt1724_capture_spdif_close()
1394 static int snd_vt1724_playback_indep_prepare(struct snd_pcm_substream *substream) in snd_vt1724_playback_indep_prepare() argument
1396 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_indep_prepare()
1400 val = 3 - substream->number; in snd_vt1724_playback_indep_prepare()
1404 return snd_vt1724_pcm_prepare(substream); in snd_vt1724_playback_indep_prepare()
1407 static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream) in snd_vt1724_playback_indep_open() argument
1409 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_indep_open()
1410 struct snd_pcm_runtime *runtime = substream->runtime; in snd_vt1724_playback_indep_open()
1414 if (ice->pcm_reserved[substream->number]) { in snd_vt1724_playback_indep_open()
1419 runtime->private_data = (void *)&vt1724_playback_dma_regs[substream->number]; in snd_vt1724_playback_indep_open()
1420 ice->playback_con_substream_ds[substream->number] = substream; in snd_vt1724_playback_indep_open()
1422 snd_pcm_set_sync(substream); in snd_vt1724_playback_indep_open()
1424 set_rate_constraints(ice, substream); in snd_vt1724_playback_indep_open()
1428 static int snd_vt1724_playback_indep_close(struct snd_pcm_substream *substream) in snd_vt1724_playback_indep_close() argument
1430 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); in snd_vt1724_playback_indep_close()
1434 ice->playback_con_substream_ds[substream->number] = NULL; in snd_vt1724_playback_indep_close()
1435 ice->pcm_reserved[substream->number] = NULL; in snd_vt1724_playback_indep_close()