Lines Matching refs:substream

878 static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream,  in snd_cs46xx_pb_trans_copy()  argument
881 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_pb_trans_copy()
886 static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream) in snd_cs46xx_playback_transfer() argument
888 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_playback_transfer()
890 snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec, snd_cs46xx_pb_trans_copy); in snd_cs46xx_playback_transfer()
894 static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream, in snd_cs46xx_cp_trans_copy() argument
897 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_cp_trans_copy()
898 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_cp_trans_copy()
903 static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream) in snd_cs46xx_capture_transfer() argument
905 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_transfer()
906 snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec, snd_cs46xx_cp_trans_copy); in snd_cs46xx_capture_transfer()
910 static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream) in snd_cs46xx_playback_direct_pointer() argument
912 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_direct_pointer()
914 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_direct_pointer()
928 static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream) in snd_cs46xx_playback_indirect_pointer() argument
930 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_indirect_pointer()
932 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_indirect_pointer()
942 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr); in snd_cs46xx_playback_indirect_pointer()
945 static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream) in snd_cs46xx_capture_direct_pointer() argument
947 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_direct_pointer()
952 static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream) in snd_cs46xx_capture_indirect_pointer() argument
954 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_indirect_pointer()
956 return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr); in snd_cs46xx_capture_indirect_pointer()
959 static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream, in snd_cs46xx_playback_trigger() argument
962 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_trigger()
967 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data; in snd_cs46xx_playback_trigger()
983 if (substream->runtime->periods != CS46XX_FRAGS) in snd_cs46xx_playback_trigger()
984 snd_cs46xx_playback_transfer(substream); in snd_cs46xx_playback_trigger()
987 if (substream->runtime->periods != CS46XX_FRAGS) in snd_cs46xx_playback_trigger()
988 snd_cs46xx_playback_transfer(substream); in snd_cs46xx_playback_trigger()
1024 static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream, in snd_cs46xx_capture_trigger() argument
1027 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_trigger()
1092 static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream, in snd_cs46xx_playback_hw_params() argument
1095 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_playback_hw_params()
1099 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_hw_params()
1136 snd_pcm_lib_free_pages(substream); in snd_cs46xx_playback_hw_params()
1144 substream->ops = &snd_cs46xx_playback_ops; in snd_cs46xx_playback_hw_params()
1146 substream->ops = &snd_cs46xx_playback_rear_ops; in snd_cs46xx_playback_hw_params()
1148 substream->ops = &snd_cs46xx_playback_clfe_ops; in snd_cs46xx_playback_hw_params()
1150 substream->ops = &snd_cs46xx_playback_iec958_ops; in snd_cs46xx_playback_hw_params()
1155 substream->ops = &snd_cs46xx_playback_ops; in snd_cs46xx_playback_hw_params()
1164 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) { in snd_cs46xx_playback_hw_params()
1173 substream->ops = &snd_cs46xx_playback_indirect_ops; in snd_cs46xx_playback_hw_params()
1175 substream->ops = &snd_cs46xx_playback_indirect_rear_ops; in snd_cs46xx_playback_hw_params()
1177 substream->ops = &snd_cs46xx_playback_indirect_clfe_ops; in snd_cs46xx_playback_hw_params()
1179 substream->ops = &snd_cs46xx_playback_indirect_iec958_ops; in snd_cs46xx_playback_hw_params()
1184 substream->ops = &snd_cs46xx_playback_indirect_ops; in snd_cs46xx_playback_hw_params()
1196 static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream) in snd_cs46xx_playback_hw_free() argument
1199 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_playback_hw_free()
1209 snd_pcm_lib_free_pages(substream); in snd_cs46xx_playback_hw_free()
1218 static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream) in snd_cs46xx_playback_prepare() argument
1222 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_prepare()
1223 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_playback_prepare()
1263 cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); in snd_cs46xx_playback_prepare()
1289 static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream, in snd_cs46xx_capture_hw_params() argument
1292 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_hw_params()
1293 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_capture_hw_params()
1301 snd_pcm_lib_free_pages(substream); in snd_cs46xx_capture_hw_params()
1305 substream->ops = &snd_cs46xx_capture_ops; in snd_cs46xx_capture_hw_params()
1312 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) in snd_cs46xx_capture_hw_params()
1314 substream->ops = &snd_cs46xx_capture_indirect_ops; in snd_cs46xx_capture_hw_params()
1320 static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream) in snd_cs46xx_capture_hw_free() argument
1322 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_hw_free()
1323 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_capture_hw_free()
1326 snd_pcm_lib_free_pages(substream); in snd_cs46xx_capture_hw_free()
1334 static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream) in snd_cs46xx_capture_prepare() argument
1336 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_prepare()
1337 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_capture_prepare()
1342 chip->capt.pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream); in snd_cs46xx_capture_prepare()
1376 if (chip->capt.substream) in snd_cs46xx_interrupt()
1377 snd_pcm_period_elapsed(chip->capt.substream); in snd_cs46xx_interrupt()
1383 snd_pcm_period_elapsed(cpcm->substream); in snd_cs46xx_interrupt()
1393 snd_pcm_period_elapsed(cpcm->substream); in snd_cs46xx_interrupt()
1402 if (chip->playback_pcm->substream) in snd_cs46xx_interrupt()
1403 snd_pcm_period_elapsed(chip->playback_pcm->substream); in snd_cs46xx_interrupt()
1406 if (chip->capt.substream) in snd_cs46xx_interrupt()
1407 snd_pcm_period_elapsed(chip->capt.substream); in snd_cs46xx_interrupt()
1500 static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id) in _cs46xx_playback_open_channel() argument
1502 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in _cs46xx_playback_open_channel()
1504 struct snd_pcm_runtime *runtime = substream->runtime; in _cs46xx_playback_open_channel()
1519 cpcm->substream = substream; in _cs46xx_playback_open_channel()
1536 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; in _cs46xx_playback_open_channel()
1542 static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream) in snd_cs46xx_playback_open() argument
1544 dev_dbg(substream->pcm->card->dev, "open front channel\n"); in snd_cs46xx_playback_open()
1545 return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL); in snd_cs46xx_playback_open()
1549 static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream) in snd_cs46xx_playback_open_rear() argument
1551 dev_dbg(substream->pcm->card->dev, "open rear channel\n"); in snd_cs46xx_playback_open_rear()
1552 return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL); in snd_cs46xx_playback_open_rear()
1555 static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream) in snd_cs46xx_playback_open_clfe() argument
1557 dev_dbg(substream->pcm->card->dev, "open center - LFE channel\n"); in snd_cs46xx_playback_open_clfe()
1558 return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL); in snd_cs46xx_playback_open_clfe()
1561 static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream) in snd_cs46xx_playback_open_iec958() argument
1563 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_open_iec958()
1571 return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL); in snd_cs46xx_playback_open_iec958()
1574 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream);
1576 static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream) in snd_cs46xx_playback_close_iec958() argument
1579 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_close_iec958()
1583 err = snd_cs46xx_playback_close(substream); in snd_cs46xx_playback_close_iec958()
1593 static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream) in snd_cs46xx_capture_open() argument
1595 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_open()
1600 chip->capt.substream = substream; in snd_cs46xx_capture_open()
1601 substream->runtime->hw = snd_cs46xx_capture; in snd_cs46xx_capture_open()
1604 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID; in snd_cs46xx_capture_open()
1609 snd_pcm_hw_constraint_list(substream->runtime, 0, in snd_cs46xx_capture_open()
1616 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream) in snd_cs46xx_playback_close() argument
1618 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_playback_close()
1619 struct snd_pcm_runtime *runtime = substream->runtime; in snd_cs46xx_playback_close()
1638 cpcm->substream = NULL; in snd_cs46xx_playback_close()
1645 static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream) in snd_cs46xx_capture_close() argument
1647 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream); in snd_cs46xx_capture_close()
1649 chip->capt.substream = NULL; in snd_cs46xx_capture_close()
2563 static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream) in snd_cs46xx_midi_input_open() argument
2565 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_input_open()
2571 chip->midi_input = substream; in snd_cs46xx_midi_input_open()
2581 static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream) in snd_cs46xx_midi_input_close() argument
2583 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_input_close()
2599 static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream) in snd_cs46xx_midi_output_open() argument
2601 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_output_open()
2608 chip->midi_output = substream; in snd_cs46xx_midi_output_open()
2618 static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream) in snd_cs46xx_midi_output_close() argument
2620 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_output_close()
2636 static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up) in snd_cs46xx_midi_input_trigger() argument
2639 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_input_trigger()
2656 static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up) in snd_cs46xx_midi_output_trigger() argument
2659 struct snd_cs46xx *chip = substream->rmidi->private_data; in snd_cs46xx_midi_output_trigger()
2669 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) { in snd_cs46xx_midi_output_trigger()