ALSA: hda - Add upper-limit of mixer amp for AD1884A-laptop model, too
authorTakashi Iwai <tiwai@suse.de>
Thu, 16 Apr 2009 12:19:19 +0000 (14:19 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 16 Apr 2009 12:20:23 +0000 (14:20 +0200)
Add the upper-limit of mixer amp for AD1884A-laptop model just like
the mobile model for some HP laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_analog.c

index 38ad3f7b040f49d699ddb4641fe1d479a209619c..9bcd8ab5a27f3cf9d2f81b80235e27c9976b9b93 100644 (file)
@@ -3977,6 +3977,14 @@ static int patch_ad1884a(struct hda_codec *codec)
                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;