From: Takashi Iwai <tiwai@suse.de>
To: David Henningsson <david.henningsson@canonical.com>
Cc: alsa-devel@alsa-project.org, stable@kernel.org,
1248465@bugs.launchpad.net
Subject: Re: [PATCH] ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek)
Date: Wed, 06 Nov 2013 11:11:20 +0100 [thread overview]
Message-ID: <s5hr4atet6f.wl%tiwai@suse.de> (raw)
In-Reply-To: <1383731444-6487-1-git-send-email-david.henningsson@canonical.com>
At Wed, 6 Nov 2013 10:50:44 +0100,
David Henningsson wrote:
>
> Some HP machines with Realtek codecs have mute LEDs connected to VREF pins.
> However when these go into runtime suspend, the pin powers down and its
> pin control is disabled, thus disabling the LED too.
>
> This patch fixes that issue by making sure that the pin stays in D0 with
> correct pin control.
>
> Cc: stable@kernel.org
> BugLink: https://bugs.launchpad.net/bugs/1248465
> Tested-by: Franz Hsieh <franz.hsieh@canonical.com>
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Thanks, applied.
I do wonder, though, whether the LED survives even after turning AFG
to D3. With IDT codecs, we had to keep AFG D0 just for keeping this
VREF stuff. Maybe Realtek codecs behave differently.
Takashi
> ---
> sound/pci/hda/patch_realtek.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index a51f48c..0acbe82 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -2955,6 +2955,23 @@ static void alc269_fixup_mic_mute_hook(void *private_data, int enabled)
> snd_hda_set_pin_ctl_cache(codec, spec->mute_led_nid, pinval);
> }
>
> +/* Make sure the led works even in runtime suspend */
> +static unsigned int led_power_filter(struct hda_codec *codec,
> + hda_nid_t nid,
> + unsigned int power_state)
> +{
> + struct alc_spec *spec = codec->spec;
> +
> + if (power_state != AC_PWRST_D3 || nid != spec->mute_led_nid)
> + return power_state;
> +
> + /* Set pin ctl again, it might have just been set to 0 */
> + snd_hda_set_pin_ctl(codec, nid,
> + snd_hda_codec_get_pin_target(codec, nid));
> +
> + return AC_PWRST_D0;
> +}
> +
> static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
> const struct hda_fixup *fix, int action)
> {
> @@ -2974,6 +2991,7 @@ static void alc269_fixup_hp_mute_led(struct hda_codec *codec,
> spec->mute_led_nid = pin - 0x0a + 0x18;
> spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
> spec->gen.vmaster_mute_enum = 1;
> + codec->power_filter = led_power_filter;
> snd_printd("Detected mute LED for %x:%d\n", spec->mute_led_nid,
> spec->mute_led_polarity);
> break;
> @@ -2989,6 +3007,7 @@ static void alc269_fixup_hp_mute_led_mic1(struct hda_codec *codec,
> spec->mute_led_nid = 0x18;
> spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
> spec->gen.vmaster_mute_enum = 1;
> + codec->power_filter = led_power_filter;
> }
> }
>
> @@ -3001,6 +3020,7 @@ static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec,
> spec->mute_led_nid = 0x19;
> spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook;
> spec->gen.vmaster_mute_enum = 1;
> + codec->power_filter = led_power_filter;
> }
> }
>
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2013-11-06 10:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 9:50 [PATCH] ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek) David Henningsson
2013-11-06 10:11 ` Takashi Iwai [this message]
2013-11-06 10:17 ` David Henningsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hr4atet6f.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=1248465@bugs.launchpad.net \
--cc=alsa-devel@alsa-project.org \
--cc=david.henningsson@canonical.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.