diff options
author | Lydia Wang <lydiawang@viatech.com.cn> | 2009-10-10 19:08:15 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-11 17:57:18 +0200 |
commit | dcf34c8cc685781cebbe1f4c75272a3269eba3a1 (patch) | |
tree | d7583b4a49434d1c799c1b3a06375562b048c8e8 /sound/pci/hda/patch_via.c | |
parent | a34df19a658170fb7125e8017ee46ba54b1ad495 (diff) |
ALSA: HDA VIA: Refresh front playback mute in via_hp_automute.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Logan Li <loganli@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index cd62c88b524..c1f4307feaa 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1351,14 +1351,25 @@ static void via_free(struct hda_codec *codec) /* mute internal speaker if HP is plugged */ static void via_hp_automute(struct hda_codec *codec) { - unsigned int present; + unsigned int present = 0; struct via_spec *spec = codec->spec; present = snd_hda_codec_read(codec, spec->autocfg.hp_pins[0], 0, AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; - snd_hda_codec_amp_stereo(codec, spec->autocfg.line_out_pins[0], - HDA_OUTPUT, 0, HDA_AMP_MUTE, - present ? HDA_AMP_MUTE : 0); + + if (!spec->hp_independent_mode) { + struct snd_ctl_elem_id id; + /* auto mute */ + snd_hda_codec_amp_stereo( + codec, spec->autocfg.line_out_pins[0], HDA_OUTPUT, 0, + HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); + /* notify change */ + memset(&id, 0, sizeof(id)); + id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; + strcpy(id.name, "Front Playback Switch"); + snd_ctl_notify(codec->bus->card, SNDRV_CTL_EVENT_MASK_VALUE, + &id); + } } static void via_gpio_control(struct hda_codec *codec) |