diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-23 11:00:31 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-23 11:00:31 -0500 |
commit | e4a395e7819b1e666b2e9da22234059f403dbc11 (patch) | |
tree | ef81eb2798030b1f8d141d2a430c46bb1cf01b13 /sound | |
parent | 0db75790e282dd1c8752b2472a9485940dd92c70 (diff) |
ALSA: hda - Fix missing path between aamix and outputs in AD codecs
AD1988 family and AD1882 codecs have another mixer widget (0x21)
between the analog-loopback mixer widget (0x20) and the actual
outputs. Due to this hole, the analog-loopbacks aren't sent properly
to the output pins.
As a band-aid fix, introduce another fields holding the aamix merge
path, and activate it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 23 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 758dcc1a07b0..06e203df4059 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -688,7 +688,7 @@ static void activate_amp_in(struct hda_codec *codec, struct nid_path *path, | |||
688 | * when aa-mixer is available, we need to enable the path as well | 688 | * when aa-mixer is available, we need to enable the path as well |
689 | */ | 689 | */ |
690 | for (n = 0; n < nums; n++) { | 690 | for (n = 0; n < nums; n++) { |
691 | if (n != idx && (!add_aamix || conn[n] != spec->mixer_nid)) | 691 | if (n != idx && (!add_aamix || conn[n] != spec->mixer_merge_nid)) |
692 | continue; | 692 | continue; |
693 | activate_amp(codec, nid, HDA_INPUT, n, idx, enable); | 693 | activate_amp(codec, nid, HDA_INPUT, n, idx, enable); |
694 | } | 694 | } |
@@ -2492,6 +2492,19 @@ static int new_analog_input(struct hda_codec *codec, int input_idx, | |||
2492 | 2492 | ||
2493 | path->active = true; | 2493 | path->active = true; |
2494 | add_loopback_list(spec, mix_nid, idx); | 2494 | add_loopback_list(spec, mix_nid, idx); |
2495 | |||
2496 | if (spec->mixer_nid != spec->mixer_merge_nid && | ||
2497 | !spec->loopback_merge_path) { | ||
2498 | path = snd_hda_add_new_path(codec, spec->mixer_nid, | ||
2499 | spec->mixer_merge_nid, 0); | ||
2500 | if (path) { | ||
2501 | print_nid_path("loopback-merge", path); | ||
2502 | path->active = true; | ||
2503 | spec->loopback_merge_path = | ||
2504 | snd_hda_get_path_idx(codec, path); | ||
2505 | } | ||
2506 | } | ||
2507 | |||
2495 | return 0; | 2508 | return 0; |
2496 | } | 2509 | } |
2497 | 2510 | ||
@@ -3847,6 +3860,9 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec, | |||
3847 | 3860 | ||
3848 | parse_user_hints(codec); | 3861 | parse_user_hints(codec); |
3849 | 3862 | ||
3863 | if (spec->mixer_nid && !spec->mixer_merge_nid) | ||
3864 | spec->mixer_merge_nid = spec->mixer_nid; | ||
3865 | |||
3850 | if (cfg != &spec->autocfg) { | 3866 | if (cfg != &spec->autocfg) { |
3851 | spec->autocfg = *cfg; | 3867 | spec->autocfg = *cfg; |
3852 | cfg = &spec->autocfg; | 3868 | cfg = &spec->autocfg; |
@@ -4673,6 +4689,11 @@ static void init_analog_input(struct hda_codec *codec) | |||
4673 | if (path) | 4689 | if (path) |
4674 | snd_hda_activate_path(codec, path, | 4690 | snd_hda_activate_path(codec, path, |
4675 | path->active, false); | 4691 | path->active, false); |
4692 | path = snd_hda_get_path_from_idx(codec, | ||
4693 | spec->loopback_merge_path); | ||
4694 | if (path) | ||
4695 | snd_hda_activate_path(codec, path, path->active, | ||
4696 | false); | ||
4676 | } | 4697 | } |
4677 | } | 4698 | } |
4678 | } | 4699 | } |
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index 980707fcd30a..d226856b2dfa 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h | |||
@@ -107,6 +107,7 @@ struct hda_gen_spec { | |||
107 | hda_nid_t adc_nids[AUTO_CFG_MAX_INS]; | 107 | hda_nid_t adc_nids[AUTO_CFG_MAX_INS]; |
108 | hda_nid_t dig_in_nid; /* digital-in NID; optional */ | 108 | hda_nid_t dig_in_nid; /* digital-in NID; optional */ |
109 | hda_nid_t mixer_nid; /* analog-mixer NID */ | 109 | hda_nid_t mixer_nid; /* analog-mixer NID */ |
110 | hda_nid_t mixer_merge_nid; /* aamix merge-point NID (optional) */ | ||
110 | const char *input_labels[HDA_MAX_NUM_INPUTS]; | 111 | const char *input_labels[HDA_MAX_NUM_INPUTS]; |
111 | int input_label_idxs[HDA_MAX_NUM_INPUTS]; | 112 | int input_label_idxs[HDA_MAX_NUM_INPUTS]; |
112 | 113 | ||
@@ -163,6 +164,7 @@ struct hda_gen_spec { | |||
163 | int digout_paths[AUTO_CFG_MAX_OUTS]; | 164 | int digout_paths[AUTO_CFG_MAX_OUTS]; |
164 | int input_paths[HDA_MAX_NUM_INPUTS][AUTO_CFG_MAX_INS]; | 165 | int input_paths[HDA_MAX_NUM_INPUTS][AUTO_CFG_MAX_INS]; |
165 | int loopback_paths[HDA_MAX_NUM_INPUTS]; | 166 | int loopback_paths[HDA_MAX_NUM_INPUTS]; |
167 | int loopback_merge_path; | ||
166 | int digin_path; | 168 | int digin_path; |
167 | 169 | ||
168 | /* auto-mic stuff */ | 170 | /* auto-mic stuff */ |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 9d82aab1e512..df8014b27596 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -3235,6 +3235,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec) | |||
3235 | spec = codec->spec; | 3235 | spec = codec->spec; |
3236 | 3236 | ||
3237 | spec->gen.mixer_nid = 0x20; | 3237 | spec->gen.mixer_nid = 0x20; |
3238 | spec->gen.mixer_merge_nid = 0x21; | ||
3238 | spec->beep_dev_nid = 0x10; | 3239 | spec->beep_dev_nid = 0x10; |
3239 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); | 3240 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); |
3240 | err = ad198x_parse_auto_config(codec); | 3241 | err = ad198x_parse_auto_config(codec); |
@@ -5153,6 +5154,7 @@ static int ad1882_parse_auto_config(struct hda_codec *codec) | |||
5153 | spec = codec->spec; | 5154 | spec = codec->spec; |
5154 | 5155 | ||
5155 | spec->gen.mixer_nid = 0x20; | 5156 | spec->gen.mixer_nid = 0x20; |
5157 | spec->gen.mixer_merge_nid = 0x21; | ||
5156 | spec->beep_dev_nid = 0x10; | 5158 | spec->beep_dev_nid = 0x10; |
5157 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); | 5159 | set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); |
5158 | err = ad198x_parse_auto_config(codec); | 5160 | err = ad198x_parse_auto_config(codec); |