Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353112
b: refs/heads/master
c: 980428c
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent 4e0fed9 commit 8160cb9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 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: f3fc0b0b1fe31e0ec9a72ab85b421e74c696f00d
refs/heads/master: 980428cecc4ca767bd9dd61fc286cd4124fd34af
16 changes: 15 additions & 1 deletion trunk/sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid,
}
EXPORT_SYMBOL_HDA(snd_hda_add_new_path);

/* clear the given path as invalid so that it won't be picked up later */
static void invalidate_nid_path(struct hda_codec *codec, int idx)
{
struct nid_path *path = snd_hda_get_path_from_idx(codec, idx);
if (!path)
return;
memset(path, 0, sizeof(*path));
}

/* look for an empty DAC slot */
static hda_nid_t look_for_dac(struct hda_codec *codec, hda_nid_t pin,
bool is_digital)
Expand Down Expand Up @@ -891,10 +900,12 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,

dacs[i] = look_for_dac(codec, pin, false);
if (!dacs[i] && !i) {
/* try to steal the DAC of surrounds for the front */
for (j = 1; j < num_outs; j++) {
if (is_reachable_path(codec, dacs[j], pin)) {
dacs[0] = dacs[j];
dacs[j] = 0;
invalidate_nid_path(codec, path_idx[j]);
path_idx[j] = 0;
break;
}
Expand Down Expand Up @@ -2046,9 +2057,12 @@ static int check_dyn_adc_switch(struct hda_codec *codec)
continue;
if (n != nums) {
spec->adc_nids[nums] = spec->adc_nids[n];
for (i = 0; i < imux->num_items; i++)
for (i = 0; i < imux->num_items; i++) {
invalidate_nid_path(codec,
spec->input_paths[i][nums]);
spec->input_paths[i][nums] =
spec->input_paths[i][n];
}
}
nums++;
}
Expand Down

0 comments on commit 8160cb9

Please sign in to comment.