diff options
| author | Takashi Iwai <tiwai@suse.de> | 2013-07-04 06:54:22 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2013-07-04 06:54:22 -0400 |
| commit | 8f0b3b7e222383a21f7d58bd97d5552b3a5dbced (patch) | |
| tree | ec71467915de475a3d049989f3dc483b6073381d | |
| parent | 1ba65ae4bdbd43265c51ee4c30ff21a48124b6d8 (diff) | |
ALSA: hda - Fix EAPD vmaster hook for AD1884 & co
ad1884_fixup_hp_eapd() tries to set the NID for controlling the
speaker EAPD from the pin configuration. But the current code can't
work expectedly since it sets spec->eapd_nid before calling the
generic parser where the autocfg pins are set up.
This patch changes the function to set spec->eapd_nid after the
generic parser call while it sets vmaster hook unconditionally. The
spec->eapd_nid check is moved in the hook function itself instead.
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
| -rw-r--r-- | sound/pci/hda/patch_analog.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 977b0d878dae..d97f0d61a15b 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
| @@ -2112,6 +2112,9 @@ static void ad_vmaster_eapd_hook(void *private_data, int enabled) | |||
| 2112 | { | 2112 | { |
| 2113 | struct hda_codec *codec = private_data; | 2113 | struct hda_codec *codec = private_data; |
| 2114 | struct ad198x_spec *spec = codec->spec; | 2114 | struct ad198x_spec *spec = codec->spec; |
| 2115 | |||
| 2116 | if (!spec->eapd_nid) | ||
| 2117 | return; | ||
| 2115 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, | 2118 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, |
| 2116 | AC_VERB_SET_EAPD_BTLENABLE, | 2119 | AC_VERB_SET_EAPD_BTLENABLE, |
| 2117 | enabled ? 0x02 : 0x00); | 2120 | enabled ? 0x02 : 0x00); |
| @@ -3601,13 +3604,16 @@ static void ad1884_fixup_hp_eapd(struct hda_codec *codec, | |||
| 3601 | { | 3604 | { |
| 3602 | struct ad198x_spec *spec = codec->spec; | 3605 | struct ad198x_spec *spec = codec->spec; |
| 3603 | 3606 | ||
| 3604 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 3607 | switch (action) { |
| 3608 | case HDA_FIXUP_ACT_PRE_PROBE: | ||
| 3609 | spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; | ||
| 3610 | break; | ||
| 3611 | case HDA_FIXUP_ACT_PROBE: | ||
| 3605 | if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) | 3612 | if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) |
| 3606 | spec->eapd_nid = spec->gen.autocfg.line_out_pins[0]; | 3613 | spec->eapd_nid = spec->gen.autocfg.line_out_pins[0]; |
| 3607 | else | 3614 | else |
| 3608 | spec->eapd_nid = spec->gen.autocfg.speaker_pins[0]; | 3615 | spec->eapd_nid = spec->gen.autocfg.speaker_pins[0]; |
| 3609 | if (spec->eapd_nid) | 3616 | break; |
| 3610 | spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; | ||
| 3611 | } | 3617 | } |
| 3612 | } | 3618 | } |
| 3613 | 3619 | ||
