From 13c989beba166b470b1e6b0fa117148bcbfa3dd1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Feb 2009 11:33:34 +0100 Subject: ALSA: hda - Don't give over 0dB volume for AD1984A HP laptops Patch-mainline: References: bnc#478158 Set the upper limit 0dB to the volume of mixer amp 0x20 for AD1984A HP laptops. The overloaded volume may damage the internal speaker. Update Wed Apr 1 18:33:51 EDT 2009 jeffm: - Added the workaround to AD1884A_MOBILE as well. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_analog.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -3959,6 +3959,14 @@ static int patch_ad1884a(struct hda_code spec->input_mux = &ad1884a_laptop_capture_source; codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; codec->patch_ops.init = ad1884a_hp_init; + /* set the upper-limit for mixer amp to 0dB for avoiding the + * possible damage by overloading + */ + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, + (0x17 << AC_AMPCAP_OFFSET_SHIFT) | + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | + (1 << AC_AMPCAP_MUTE_SHIFT)); break; case AD1884A_MOBILE: spec->mixers[0] = ad1884a_mobile_mixers; @@ -3966,6 +3974,14 @@ static int patch_ad1884a(struct hda_code spec->multiout.dig_out_nid = 0; codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; codec->patch_ops.init = ad1884a_hp_init; + /* set the upper-limit for mixer amp to 0dB for avoiding the + * possible damage by overloading + */ + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, + (0x17 << AC_AMPCAP_OFFSET_SHIFT) | + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | + (1 << AC_AMPCAP_MUTE_SHIFT)); break; case AD1884A_THINKPAD: spec->mixers[0] = ad1984a_thinkpad_mixers;