Lines Matching refs:substream

286 static void vt1724_enable_midi_irq(struct snd_rawmidi_substream *substream,
289 struct snd_ice1712 *ice = substream->rmidi->private_data;
522 static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
524 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
530 snd_pcm_group_for_each_entry(s, substream) {
535 snd_pcm_trigger_done(s, substream);
687 static int snd_vt1724_pcm_hw_params(struct snd_pcm_substream *substream,
690 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
696 if (substream == ice->playback_pro_substream) {
701 ice->pcm_reserved[i] != substream) {
705 ice->pcm_reserved[i] = substream;
708 if (ice->pcm_reserved[i] == substream)
714 if (ice->playback_con_substream_ds[i] == substream) {
716 ice->pcm_reserved[i] != substream) {
720 ice->pcm_reserved[i] = substream;
730 static int snd_vt1724_pcm_hw_free(struct snd_pcm_substream *substream)
732 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
738 if (ice->pcm_reserved[i] == substream)
744 static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream)
746 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
751 val = (8 - substream->runtime->channels) >> 1;
754 outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR));
756 size = (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1;
760 size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1;
770 substream->runtime->channels,
771 (unsigned int)substream->runtime->dma_addr,
772 snd_pcm_lib_buffer_bytes(substream),
773 snd_pcm_lib_period_bytes(substream));
778 static snd_pcm_uframes_t snd_vt1724_playback_pro_pointer(struct snd_pcm_substream *substream)
780 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
787 if (ptr < substream->runtime->dma_addr) {
791 ptr -= substream->runtime->dma_addr;
792 ptr = bytes_to_frames(substream->runtime, ptr);
793 if (ptr >= substream->runtime->buffer_size) {
795 (int)ptr, (int)substream->runtime->period_size);
801 ptr = bytes_to_frames(substream->runtime, ptr);
804 else if (ptr <= substream->runtime->buffer_size)
805 ptr = substream->runtime->buffer_size - ptr;
808 (int)ptr, (int)substream->runtime->buffer_size);
815 static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream)
817 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
818 const struct vt1724_pcm_reg *reg = substream->runtime->private_data;
821 outl(substream->runtime->dma_addr, ice->profi_port + reg->addr);
822 outw((snd_pcm_lib_buffer_bytes(substream) >> 2) - 1,
824 outw((snd_pcm_lib_period_bytes(substream) >> 2) - 1,
830 static snd_pcm_uframes_t snd_vt1724_pcm_pointer(struct snd_pcm_substream *substream)
832 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
833 const struct vt1724_pcm_reg *reg = substream->runtime->private_data;
840 ptr -= substream->runtime->dma_addr;
841 return bytes_to_frames(substream->runtime, ptr);
845 ptr = bytes_to_frames(substream->runtime, ptr);
848 else if (ptr <= substream->runtime->buffer_size)
849 ptr = substream->runtime->buffer_size - ptr;
852 (int)ptr, (int)substream->runtime->buffer_size);
968 struct snd_pcm_substream *substream)
970 struct snd_pcm_runtime *runtime = substream->runtime;
983 static void constrain_rate_if_locked(struct snd_pcm_substream *substream)
985 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
986 struct snd_pcm_runtime *runtime = substream->runtime;
1004 static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream)
1006 struct snd_pcm_runtime *runtime = substream->runtime;
1007 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1011 ice->playback_pro_substream = substream;
1013 snd_pcm_set_sync(substream);
1015 set_rate_constraints(ice, substream);
1032 constrain_rate_if_locked(substream);
1034 ice->pro_open(ice, substream);
1038 static int snd_vt1724_capture_pro_open(struct snd_pcm_substream *substream)
1040 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1041 struct snd_pcm_runtime *runtime = substream->runtime;
1044 ice->capture_pro_substream = substream;
1046 snd_pcm_set_sync(substream);
1048 set_rate_constraints(ice, substream);
1053 constrain_rate_if_locked(substream);
1055 ice->pro_open(ice, substream);
1059 static int snd_vt1724_playback_pro_close(struct snd_pcm_substream *substream)
1061 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1070 static int snd_vt1724_capture_pro_close(struct snd_pcm_substream *substream)
1072 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1174 static int snd_vt1724_playback_spdif_prepare(struct snd_pcm_substream *substream)
1176 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1178 update_spdif_rate(ice, substream->runtime->rate);
1179 return snd_vt1724_pcm_prepare(substream);
1182 static int snd_vt1724_playback_spdif_open(struct snd_pcm_substream *substream)
1184 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1185 struct snd_pcm_runtime *runtime = substream->runtime;
1188 ice->playback_con_substream = substream;
1191 set_rate_constraints(ice, substream);
1194 snd_pcm_set_sync(substream);
1200 constrain_rate_if_locked(substream);
1202 ice->spdif.ops.open(ice, substream);
1206 static int snd_vt1724_playback_spdif_close(struct snd_pcm_substream *substream)
1208 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1214 ice->spdif.ops.close(ice, substream);
1219 static int snd_vt1724_capture_spdif_open(struct snd_pcm_substream *substream)
1221 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1222 struct snd_pcm_runtime *runtime = substream->runtime;
1225 ice->capture_con_substream = substream;
1228 set_rate_constraints(ice, substream);
1231 snd_pcm_set_sync(substream);
1237 constrain_rate_if_locked(substream);
1239 ice->spdif.ops.open(ice, substream);
1243 static int snd_vt1724_capture_spdif_close(struct snd_pcm_substream *substream)
1245 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1251 ice->spdif.ops.close(ice, substream);
1352 static int snd_vt1724_playback_indep_prepare(struct snd_pcm_substream *substream)
1354 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1358 val = 3 - substream->number;
1362 return snd_vt1724_pcm_prepare(substream);
1365 static int snd_vt1724_playback_indep_open(struct snd_pcm_substream *substream)
1367 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1368 struct snd_pcm_runtime *runtime = substream->runtime;
1372 if (ice->pcm_reserved[substream->number]) {
1377 runtime->private_data = (void *)&vt1724_playback_dma_regs[substream->number];
1378 ice->playback_con_substream_ds[substream->number] = substream;
1380 snd_pcm_set_sync(substream);
1382 set_rate_constraints(ice, substream);
1386 static int snd_vt1724_playback_indep_close(struct snd_pcm_substream *substream)
1388 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
1392 ice->playback_con_substream_ds[substream->number] = NULL;
1393 ice->pcm_reserved[substream->number] = NULL;