aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-03-30 12:00:59 -0400
committerTakashi Iwai <tiwai@suse.de>2010-03-30 12:03:11 -0400
commitad35879aa192e783db2d41c196f48f3fc059ce22 (patch)
tree4fde262ed6d02dce5abbdd6237afe2b785247fa6 /sound/pci
parentc35c9d5d3f03c203168e816f6f735d23f92fd6f1 (diff)
ALSA: hda - Add mute LED support for HP laptop with ALC269
Some HP laptops have a mute LED that is controlled over the unused MIC2 VREF pin. Implement the LED updater like patch_sigmatel.c for this model. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1694f60631a1..9a361c2c7336 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3467,6 +3467,10 @@ static int alc_init(struct hda_codec *codec)
3467 if (spec->init_hook) 3467 if (spec->init_hook)
3468 spec->init_hook(codec); 3468 spec->init_hook(codec);
3469 3469
3470#ifdef CONFIG_SND_HDA_POWER_SAVE
3471 if (codec->patch_ops.check_power_status)
3472 codec->patch_ops.check_power_status(codec, 0x01);
3473#endif
3470 return 0; 3474 return 0;
3471} 3475}
3472 3476
@@ -3827,6 +3831,10 @@ static int alc_resume(struct hda_codec *codec)
3827 codec->patch_ops.init(codec); 3831 codec->patch_ops.init(codec);
3828 snd_hda_codec_resume_amp(codec); 3832 snd_hda_codec_resume_amp(codec);
3829 snd_hda_codec_resume_cache(codec); 3833 snd_hda_codec_resume_cache(codec);
3834#ifdef CONFIG_SND_HDA_POWER_SAVE
3835 if (codec->patch_ops.check_power_status)
3836 codec->patch_ops.check_power_status(codec, 0x01);
3837#endif
3830 return 0; 3838 return 0;
3831} 3839}
3832#endif 3840#endif
@@ -13983,6 +13991,34 @@ static struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
13983 /* NID is set in alc_build_pcms */ 13991 /* NID is set in alc_build_pcms */
13984}; 13992};
13985 13993
13994#ifdef CONFIG_SND_HDA_POWER_SAVE
13995static int alc269_mic2_for_mute_led(struct hda_codec *codec)
13996{
13997 switch (codec->subsystem_id) {
13998 case 0x103c1586:
13999 return 1;
14000 }
14001 return 0;
14002}
14003
14004static int alc269_mic2_mute_check_ps(struct hda_codec *codec, hda_nid_t nid)
14005{
14006 /* update mute-LED according to the speaker mute state */
14007 if (nid == 0x01 || nid == 0x14) {
14008 int pinval;
14009 if (snd_hda_codec_amp_read(codec, 0x14, 0, HDA_OUTPUT, 0) &
14010 HDA_AMP_MUTE)
14011 pinval = 0x24;
14012 else
14013 pinval = 0x20;
14014 /* mic2 vref pin is used for mute LED control */
14015 snd_hda_codec_write(codec, 0x19, 0,
14016 AC_VERB_SET_PIN_WIDGET_CONTROL, pinval);
14017 }
14018 return alc_check_power_status(codec, nid);
14019}
14020#endif /* CONFIG_SND_HDA_POWER_SAVE */
14021
13986/* 14022/*
13987 * BIOS auto configuration 14023 * BIOS auto configuration
13988 */ 14024 */
@@ -14330,6 +14366,8 @@ static int patch_alc269(struct hda_codec *codec)
14330#ifdef CONFIG_SND_HDA_POWER_SAVE 14366#ifdef CONFIG_SND_HDA_POWER_SAVE
14331 if (!spec->loopback.amplist) 14367 if (!spec->loopback.amplist)
14332 spec->loopback.amplist = alc269_loopbacks; 14368 spec->loopback.amplist = alc269_loopbacks;
14369 if (alc269_mic2_for_mute_led(codec))
14370 codec->patch_ops.check_power_status = alc269_mic2_mute_check_ps;
14333#endif 14371#endif
14334 14372
14335 return 0; 14373 return 0;