diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-06-21 06:57:22 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-06-21 06:59:24 -0400 |
commit | 1e11cae143e4c0a4fc77fe532e18c550d63ab02d (patch) | |
tree | 91ed42c71d9e0674e495add6eabed0e7a6a5b935 /sound/pci/hda/patch_via.c | |
parent | 0f98c24b807f024d42cf743897e2c1d95ff1e8be (diff) |
ALSA: hda - Fix the check of loopback-mixer element index in patch_via.c
Fix the check of the multiple loopback-mixer, which gave sometimes
a wrong index assigned to an element even for different names, e.g.
Mic and Front Mic. Now check the label properly for avoid duplication.
Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 785f7f5022a4..b67a5768a9de 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1875,6 +1875,7 @@ static int via_auto_create_analog_input_ctls(struct hda_codec *codec, | |||
1875 | struct via_spec *spec = codec->spec; | 1875 | struct via_spec *spec = codec->spec; |
1876 | struct hda_input_mux *imux = &spec->private_imux[0]; | 1876 | struct hda_input_mux *imux = &spec->private_imux[0]; |
1877 | int i, j, err, idx, idx2, type, type_idx = 0; | 1877 | int i, j, err, idx, idx2, type, type_idx = 0; |
1878 | const char *prev_label = NULL; | ||
1878 | hda_nid_t cap_nid; | 1879 | hda_nid_t cap_nid; |
1879 | hda_nid_t pin_idxs[8]; | 1880 | hda_nid_t pin_idxs[8]; |
1880 | int num_idxs; | 1881 | int num_idxs; |
@@ -1908,11 +1909,12 @@ static int via_auto_create_analog_input_ctls(struct hda_codec *codec, | |||
1908 | break; | 1909 | break; |
1909 | if (idx >= num_idxs) | 1910 | if (idx >= num_idxs) |
1910 | continue; | 1911 | continue; |
1911 | if (i > 0 && type == cfg->inputs[i - 1].type) | 1912 | label = hda_get_autocfg_input_label(codec, cfg, i); |
1913 | if (prev_label && !strcmp(label, prev_label)) | ||
1912 | type_idx++; | 1914 | type_idx++; |
1913 | else | 1915 | else |
1914 | type_idx = 0; | 1916 | type_idx = 0; |
1915 | label = hda_get_autocfg_input_label(codec, cfg, i); | 1917 | prev_label = label; |
1916 | idx2 = get_connection_index(codec, spec->aa_mix_nid, | 1918 | idx2 = get_connection_index(codec, spec->aa_mix_nid, |
1917 | pin_idxs[idx]); | 1919 | pin_idxs[idx]); |
1918 | if (idx2 >= 0) { | 1920 | if (idx2 >= 0) { |