History

ALSA: hda/realtek - Always immediately update mute LED with pin VREF

Some HP laptops have a mute mute LED controlled by a pin VREF. The Realtek codec driver updates the VREF via vmaster hook by calling snd_hda_set_pin_ctl_cache(). This works fine as long as the driver is running in a normal mode. However, when the VREF change happens during the codec being in runtime PM suspend, the regmap access will skip and postpone the actual register change. This ends up with the unchanged LED status until the next runtime PM resume even if you change the Master mute switch. (Interestingly, the machine keeps the LED status even after the codec goes into D3 -- but it's another story.) For improving this usability, let the driver temporarily powering up / down only during the pin VREF change. This can be achieved easily by wrapping the call with snd_hda_power_up_pm() / *_down_pm().

Takashi Iwai committed 8 years ago

Commit e40bdb01 parent db45dc91 file · +5 −1Browse files

Unified · Split

sound/pci/hda/patch_realtek.c+5−1
@@ -3596,8 +3596,12 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled) · 3595 unmodified lines
3596 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);3596 pinval = snd_hda_codec_get_pin_target(codec, spec->mute_led_nid);
3597 pinval &= ~AC_PINCTL_VREFEN;3597 pinval &= ~AC_PINCTL_VREFEN;
3598 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;3598 pinval |= enabled ? AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80;
3599 if (spec->mute_led_nid)3599 if (spec->mute_led_nid) {
3600 /* temporarily power up/down for setting VREF */
3601 snd_hda_power_up_pm(codec);
3600 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);3602 snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
3603 snd_hda_power_down_pm(codec);
3604 }
3601}3605}
3602 3606
3603/* Make sure the led works even in runtime suspend */3607/* Make sure the led works even in runtime suspend */