diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-03 10:33:02 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-12 02:43:28 -0500 |
commit | e1284af730792344f96e1428a6199e19699dfccc (patch) | |
tree | 8faf134c6e59d1aaa1830fd38780fe7b6d4d0633 /sound/pci | |
parent | 985803ca91c3039afd15a2fd32a9ef5771652cee (diff) |
ALSA: hda - Initialize output paths with current active states
Set path->active flag at the path creation time and let the paths
initialized according to the current path->active state in
set_output_and_unmute(). This allows to modify the active flag of
some output paths dynamically, e.g. switching the front output route
with or without aamix like patch_via.c.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 9228175f0806..3507448c8b0d 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -873,8 +873,10 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, | |||
873 | } | 873 | } |
874 | if (!path) | 874 | if (!path) |
875 | dac = dacs[i] = 0; | 875 | dac = dacs[i] = 0; |
876 | else | 876 | else { |
877 | print_nid_path("output", path); | 877 | print_nid_path("output", path); |
878 | path->active = true; | ||
879 | } | ||
878 | if (dac) | 880 | if (dac) |
879 | badness += assign_out_path_ctls(codec, pin, dac); | 881 | badness += assign_out_path_ctls(codec, pin, dac); |
880 | } | 882 | } |
@@ -1045,6 +1047,7 @@ static bool map_singles(struct hda_codec *codec, int outs, | |||
1045 | dacs[i] = dac; | 1047 | dacs[i] = dac; |
1046 | found = true; | 1048 | found = true; |
1047 | print_nid_path("output", path); | 1049 | print_nid_path("output", path); |
1050 | path->active = true; | ||
1048 | } | 1051 | } |
1049 | } | 1052 | } |
1050 | return found; | 1053 | return found; |
@@ -2418,6 +2421,7 @@ static void parse_digital(struct hda_codec *codec) | |||
2418 | if (!path) | 2421 | if (!path) |
2419 | continue; | 2422 | continue; |
2420 | print_nid_path("digout", path); | 2423 | print_nid_path("digout", path); |
2424 | path->active = true; | ||
2421 | if (!nums) { | 2425 | if (!nums) { |
2422 | spec->multiout.dig_out_nid = dig_nid; | 2426 | spec->multiout.dig_out_nid = dig_nid; |
2423 | spec->dig_out_type = spec->autocfg.dig_out_type[0]; | 2427 | spec->dig_out_type = spec->autocfg.dig_out_type[0]; |
@@ -3556,10 +3560,8 @@ static void set_output_and_unmute(struct hda_codec *codec, hda_nid_t pin, | |||
3556 | path = snd_hda_get_nid_path(codec, dac, pin); | 3560 | path = snd_hda_get_nid_path(codec, dac, pin); |
3557 | if (!path) | 3561 | if (!path) |
3558 | return; | 3562 | return; |
3559 | if (path->active) | 3563 | snd_hda_activate_path(codec, path, path->active, true); |
3560 | return; | 3564 | set_pin_eapd(codec, pin, path->active); |
3561 | snd_hda_activate_path(codec, path, true, true); | ||
3562 | set_pin_eapd(codec, pin, true); | ||
3563 | } | 3565 | } |
3564 | 3566 | ||
3565 | /* initialize primary output paths */ | 3567 | /* initialize primary output paths */ |