diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-13 03:42:56 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-11-13 03:44:33 -0500 |
commit | f710a9fbd3a894be5706956cd619b369f5acc474 (patch) | |
tree | 477245d3203a1a015ec1e65550159f0de67ee506 /sound/pci | |
parent | 7a3e6107f94344e65c35bfe62de6c096a7b48965 (diff) |
ALSA: hda - Control EAPD for Master volume on Lenovo N100
Similarly as other laptops with AD1981 & co codecs, we can control
EAPD on AD1986A more safely depending on the Master switch, in order
to save some power.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index ba37116168ac..1a83559f4cbd 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -139,6 +139,18 @@ static int ad198x_suspend(struct hda_codec *codec) | |||
139 | } | 139 | } |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | /* follow EAPD via vmaster hook */ | ||
143 | static void ad_vmaster_eapd_hook(void *private_data, int enabled) | ||
144 | { | ||
145 | struct hda_codec *codec = private_data; | ||
146 | struct ad198x_spec *spec = codec->spec; | ||
147 | |||
148 | if (!spec->eapd_nid) | ||
149 | return; | ||
150 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, | ||
151 | AC_VERB_SET_EAPD_BTLENABLE, | ||
152 | enabled ? 0x02 : 0x00); | ||
153 | } | ||
142 | 154 | ||
143 | /* | 155 | /* |
144 | * Automatic parse of I/O pins from the BIOS configuration | 156 | * Automatic parse of I/O pins from the BIOS configuration |
@@ -224,6 +236,8 @@ static void ad_fixup_inv_jack_detect(struct hda_codec *codec, | |||
224 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { | 236 | if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
225 | codec->inv_jack_detect = 1; | 237 | codec->inv_jack_detect = 1; |
226 | spec->gen.keep_eapd_on = 1; | 238 | spec->gen.keep_eapd_on = 1; |
239 | spec->gen.vmaster_mute.hook = ad_vmaster_eapd_hook; | ||
240 | spec->eapd_nid = 0x1b; | ||
227 | } | 241 | } |
228 | } | 242 | } |
229 | 243 | ||
@@ -469,19 +483,6 @@ static int patch_ad1983(struct hda_codec *codec) | |||
469 | * AD1981 HD specific | 483 | * AD1981 HD specific |
470 | */ | 484 | */ |
471 | 485 | ||
472 | /* follow EAPD via vmaster hook */ | ||
473 | static void ad_vmaster_eapd_hook(void *private_data, int enabled) | ||
474 | { | ||
475 | struct hda_codec *codec = private_data; | ||
476 | struct ad198x_spec *spec = codec->spec; | ||
477 | |||
478 | if (!spec->eapd_nid) | ||
479 | return; | ||
480 | snd_hda_codec_update_cache(codec, spec->eapd_nid, 0, | ||
481 | AC_VERB_SET_EAPD_BTLENABLE, | ||
482 | enabled ? 0x02 : 0x00); | ||
483 | } | ||
484 | |||
485 | static void ad1981_fixup_hp_eapd(struct hda_codec *codec, | 486 | static void ad1981_fixup_hp_eapd(struct hda_codec *codec, |
486 | const struct hda_fixup *fix, int action) | 487 | const struct hda_fixup *fix, int action) |
487 | { | 488 | { |