Lines Matching defs:substream

864 static void snd_cs46xx_pb_trans_copy(struct snd_pcm_substream *substream,
867 struct snd_pcm_runtime *runtime = substream->runtime;
872 static int snd_cs46xx_playback_transfer(struct snd_pcm_substream *substream)
874 struct snd_pcm_runtime *runtime = substream->runtime;
876 return snd_pcm_indirect_playback_transfer(substream, &cpcm->pcm_rec,
880 static void snd_cs46xx_cp_trans_copy(struct snd_pcm_substream *substream,
883 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
884 struct snd_pcm_runtime *runtime = substream->runtime;
889 static int snd_cs46xx_capture_transfer(struct snd_pcm_substream *substream)
891 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
892 return snd_pcm_indirect_capture_transfer(substream, &chip->capt.pcm_rec,
896 static snd_pcm_uframes_t snd_cs46xx_playback_direct_pointer(struct snd_pcm_substream *substream)
898 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
900 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
914 static snd_pcm_uframes_t snd_cs46xx_playback_indirect_pointer(struct snd_pcm_substream *substream)
916 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
918 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
928 return snd_pcm_indirect_playback_pointer(substream, &cpcm->pcm_rec, ptr);
931 static snd_pcm_uframes_t snd_cs46xx_capture_direct_pointer(struct snd_pcm_substream *substream)
933 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
938 static snd_pcm_uframes_t snd_cs46xx_capture_indirect_pointer(struct snd_pcm_substream *substream)
940 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
942 return snd_pcm_indirect_capture_pointer(substream, &chip->capt.pcm_rec, ptr);
945 static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
948 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
949 /*struct snd_pcm_runtime *runtime = substream->runtime;*/
953 struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
969 if (substream->runtime->periods != CS46XX_FRAGS)
970 snd_cs46xx_playback_transfer(substream);
973 if (substream->runtime->periods != CS46XX_FRAGS)
974 snd_cs46xx_playback_transfer(substream);
1010 static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream,
1013 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1078 static int snd_cs46xx_playback_hw_params(struct snd_pcm_substream *substream,
1081 struct snd_pcm_runtime *runtime = substream->runtime;
1085 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1122 snd_pcm_lib_free_pages(substream);
1130 substream->ops = &snd_cs46xx_playback_ops;
1132 substream->ops = &snd_cs46xx_playback_rear_ops;
1134 substream->ops = &snd_cs46xx_playback_clfe_ops;
1136 substream->ops = &snd_cs46xx_playback_iec958_ops;
1141 substream->ops = &snd_cs46xx_playback_ops;
1150 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0) {
1159 substream->ops = &snd_cs46xx_playback_indirect_ops;
1161 substream->ops = &snd_cs46xx_playback_indirect_rear_ops;
1163 substream->ops = &snd_cs46xx_playback_indirect_clfe_ops;
1165 substream->ops = &snd_cs46xx_playback_indirect_iec958_ops;
1170 substream->ops = &snd_cs46xx_playback_indirect_ops;
1182 static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)
1184 /*struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);*/
1185 struct snd_pcm_runtime *runtime = substream->runtime;
1195 snd_pcm_lib_free_pages(substream);
1204 static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
1208 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1209 struct snd_pcm_runtime *runtime = substream->runtime;
1249 cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
1275 static int snd_cs46xx_capture_hw_params(struct snd_pcm_substream *substream,
1278 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1279 struct snd_pcm_runtime *runtime = substream->runtime;
1287 snd_pcm_lib_free_pages(substream);
1291 substream->ops = &snd_cs46xx_capture_ops;
1298 if ((err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params))) < 0)
1300 substream->ops = &snd_cs46xx_capture_indirect_ops;
1306 static int snd_cs46xx_capture_hw_free(struct snd_pcm_substream *substream)
1308 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1309 struct snd_pcm_runtime *runtime = substream->runtime;
1312 snd_pcm_lib_free_pages(substream);
1320 static int snd_cs46xx_capture_prepare(struct snd_pcm_substream *substream)
1322 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1323 struct snd_pcm_runtime *runtime = substream->runtime;
1328 chip->capt.pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
1362 if (chip->capt.substream)
1363 snd_pcm_period_elapsed(chip->capt.substream);
1369 snd_pcm_period_elapsed(cpcm->substream);
1379 snd_pcm_period_elapsed(cpcm->substream);
1388 if (chip->playback_pcm->substream)
1389 snd_pcm_period_elapsed(chip->playback_pcm->substream);
1392 if (chip->capt.substream)
1393 snd_pcm_period_elapsed(chip->capt.substream);
1488 static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id)
1490 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1492 struct snd_pcm_runtime *runtime = substream->runtime;
1507 cpcm->substream = substream;
1524 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID;
1530 static int snd_cs46xx_playback_open(struct snd_pcm_substream *substream)
1532 dev_dbg(substream->pcm->card->dev, "open front channel\n");
1533 return _cs46xx_playback_open_channel(substream,DSP_PCM_MAIN_CHANNEL);
1537 static int snd_cs46xx_playback_open_rear(struct snd_pcm_substream *substream)
1539 dev_dbg(substream->pcm->card->dev, "open rear channel\n");
1540 return _cs46xx_playback_open_channel(substream,DSP_PCM_REAR_CHANNEL);
1543 static int snd_cs46xx_playback_open_clfe(struct snd_pcm_substream *substream)
1545 dev_dbg(substream->pcm->card->dev, "open center - LFE channel\n");
1546 return _cs46xx_playback_open_channel(substream,DSP_PCM_CENTER_LFE_CHANNEL);
1549 static int snd_cs46xx_playback_open_iec958(struct snd_pcm_substream *substream)
1551 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1559 return _cs46xx_playback_open_channel(substream,DSP_IEC958_CHANNEL);
1562 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream);
1564 static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream)
1567 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1571 err = snd_cs46xx_playback_close(substream);
1581 static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
1583 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1588 chip->capt.substream = substream;
1589 substream->runtime->hw = snd_cs46xx_capture;
1592 substream->runtime->hw.info |= SNDRV_PCM_INFO_MMAP_VALID;
1597 snd_pcm_hw_constraint_list(substream->runtime, 0,
1604 static int snd_cs46xx_playback_close(struct snd_pcm_substream *substream)
1606 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1607 struct snd_pcm_runtime *runtime = substream->runtime;
1626 cpcm->substream = NULL;
1633 static int snd_cs46xx_capture_close(struct snd_pcm_substream *substream)
1635 struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
1637 chip->capt.substream = NULL;
2545 static int snd_cs46xx_midi_input_open(struct snd_rawmidi_substream *substream)
2547 struct snd_cs46xx *chip = substream->rmidi->private_data;
2553 chip->midi_input = substream;
2563 static int snd_cs46xx_midi_input_close(struct snd_rawmidi_substream *substream)
2565 struct snd_cs46xx *chip = substream->rmidi->private_data;
2581 static int snd_cs46xx_midi_output_open(struct snd_rawmidi_substream *substream)
2583 struct snd_cs46xx *chip = substream->rmidi->private_data;
2590 chip->midi_output = substream;
2600 static int snd_cs46xx_midi_output_close(struct snd_rawmidi_substream *substream)
2602 struct snd_cs46xx *chip = substream->rmidi->private_data;
2618 static void snd_cs46xx_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
2621 struct snd_cs46xx *chip = substream->rmidi->private_data;
2638 static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
2641 struct snd_cs46xx *chip = substream->rmidi->private_data;
2651 if (snd_rawmidi_transmit(substream, &byte, 1) != 1) {