Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209460
b: refs/heads/master
c: f0cea79
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Aug 13, 2010
1 parent 5ddf447 commit 6d661ef
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bbbe33900d1f3c4402148ccb85234a741a6606a3
refs/heads/master: f0cea79724f03ee55e7b5933b6a6f6a3fd177710
26 changes: 18 additions & 8 deletions trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,27 +1261,37 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
}
EXPORT_SYMBOL_HDA(snd_hda_codec_setup_stream);

static void really_cleanup_stream(struct hda_codec *codec,
struct hda_cvt_setup *q);

/**
* snd_hda_codec_cleanup_stream - clean up the codec for closing
* __snd_hda_codec_cleanup_stream - clean up the codec for closing
* @codec: the CODEC to clean up
* @nid: the NID to clean up
* @do_now: really clean up the stream instead of clearing the active flag
*/
void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
int do_now)
{
struct hda_cvt_setup *p;

if (!nid)
return;

snd_printdd("hda_codec_cleanup_stream: NID=0x%x\n", nid);
/* here we just clear the active flag; actual clean-ups will be done
* in purify_inactive_streams()
*/
p = get_hda_cvt_setup(codec, nid);
if (p)
p->active = 0;
if (p) {
/* here we just clear the active flag when do_now isn't set;
* actual clean-ups will be done later in
* purify_inactive_streams() called from snd_hda_codec_prpapre()
*/
if (do_now)
really_cleanup_stream(codec, p);
else
p->active = 0;
}
}
EXPORT_SYMBOL_HDA(snd_hda_codec_cleanup_stream);
EXPORT_SYMBOL_HDA(__snd_hda_codec_cleanup_stream);

static void really_cleanup_stream(struct hda_codec *codec,
struct hda_cvt_setup *q)
Expand Down
5 changes: 4 additions & 1 deletion trunk/sound/pci/hda/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,10 @@ void snd_hda_codec_cleanup(struct hda_codec *codec,
void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
u32 stream_tag,
int channel_id, int format);
void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid);
void __snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid,
int do_now);
#define snd_hda_codec_cleanup_stream(codec, nid) \
__snd_hda_codec_cleanup_stream(codec, nid, 0)
unsigned int snd_hda_calc_stream_format(unsigned int rate,
unsigned int channels,
unsigned int format,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ static int change_cur_input(struct hda_codec *codec, unsigned int idx,
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);
__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
spec->cur_adc = spec->adc_nid[idx];
snd_hda_codec_setup_stream(codec, spec->cur_adc,
spec->cur_adc_stream_tag, 0,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ static void cxt5051_portc_automic(struct hda_codec *codec)
new_adc = spec->adc_nids[spec->cur_adc_idx];
if (spec->cur_adc && spec->cur_adc != new_adc) {
/* stream is running, let's swap the current ADC */
snd_hda_codec_cleanup_stream(codec, spec->cur_adc);
__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
spec->cur_adc = new_adc;
snd_hda_codec_setup_stream(codec, new_adc,
spec->cur_adc_stream_tag, 0,
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ static void alc_dual_mic_adc_auto_switch(struct hda_codec *codec)
new_adc = spec->adc_nids[spec->cur_adc_idx];
if (spec->cur_adc && spec->cur_adc != new_adc) {
/* stream is running, let's swap the current ADC */
snd_hda_codec_cleanup_stream(codec, spec->cur_adc);
__snd_hda_codec_cleanup_stream(codec, spec->cur_adc, 1);
spec->cur_adc = new_adc;
snd_hda_codec_setup_stream(codec, new_adc,
spec->cur_adc_stream_tag, 0,
Expand Down

0 comments on commit 6d661ef

Please sign in to comment.