static int ad198x_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, struct snd_pcm_substream *substream) { struct ad198x_spec *spec = codec->spec; snd_hda_codec_cleanup_stream(codec, spec->adc_nids[substream->number]); return 0; }
static int cs_capture_pcm_cleanup(struct hda_pcm_stream *hinfo, struct hda_codec *codec, struct snd_pcm_substream *substream) { struct cs_spec *spec = codec->spec; snd_hda_codec_cleanup_stream(codec, spec->cur_adc); spec->cur_adc = 0; return 0; }
static int change_cur_input(struct hda_codec *codec, unsigned int idx, int force) { struct cs_spec *spec = codec->spec; if (spec->cur_input == idx && !force) return 0; if (spec->cur_adc && spec->cur_adc != spec->adc_nid[idx]) { /* stream is running, let's swap the current ADC */ snd_hda_codec_cleanup_stream(codec, spec->cur_adc); spec->cur_adc = spec->adc_nid[idx]; snd_hda_codec_setup_stream(codec, spec->cur_adc, spec->cur_adc_stream_tag, 0, spec->cur_adc_format); } snd_hda_codec_write(codec, spec->cur_adc, 0, AC_VERB_SET_CONNECT_SEL, spec->adc_idx[idx]); spec->cur_input = idx; return 1; }