]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.drivers/alsa-ad1984-hp-volume-fix
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / alsa-ad1984-hp-volume-fix
1 From 13c989beba166b470b1e6b0fa117148bcbfa3dd1 Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Mon, 23 Feb 2009 11:33:34 +0100
4 Subject: ALSA: hda - Don't give over 0dB volume for AD1984A HP laptops
5 Patch-mainline:
6 References: bnc#478158
7
8 Set the upper limit 0dB to the volume of mixer amp 0x20 for
9 AD1984A HP laptops. The overloaded volume may damage the internal
10 speaker.
11
12 Update Wed Apr 1 18:33:51 EDT 2009 jeffm:
13 - Added the workaround to AD1884A_MOBILE as well.
14
15 Signed-off-by: Takashi Iwai <tiwai@suse.de>
16
17 ---
18 sound/pci/hda/patch_analog.c | 16 ++++++++++++++++
19 1 file changed, 16 insertions(+)
20
21 --- a/sound/pci/hda/patch_analog.c
22 +++ b/sound/pci/hda/patch_analog.c
23 @@ -3959,6 +3959,14 @@ static int patch_ad1884a(struct hda_code
24 spec->input_mux = &ad1884a_laptop_capture_source;
25 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event;
26 codec->patch_ops.init = ad1884a_hp_init;
27 + /* set the upper-limit for mixer amp to 0dB for avoiding the
28 + * possible damage by overloading
29 + */
30 + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT,
31 + (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
32 + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
33 + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
34 + (1 << AC_AMPCAP_MUTE_SHIFT));
35 break;
36 case AD1884A_MOBILE:
37 spec->mixers[0] = ad1884a_mobile_mixers;
38 @@ -3966,6 +3974,14 @@ static int patch_ad1884a(struct hda_code
39 spec->multiout.dig_out_nid = 0;
40 codec->patch_ops.unsol_event = ad1884a_hp_unsol_event;
41 codec->patch_ops.init = ad1884a_hp_init;
42 + /* set the upper-limit for mixer amp to 0dB for avoiding the
43 + * possible damage by overloading
44 + */
45 + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT,
46 + (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
47 + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
48 + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
49 + (1 << AC_AMPCAP_MUTE_SHIFT));
50 break;
51 case AD1884A_THINKPAD:
52 spec->mixers[0] = ad1984a_thinkpad_mixers;