From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932793Ab2JKAOa (ORCPT ); Wed, 10 Oct 2012 20:14:30 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45675 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932775Ab2JKAOX (ORCPT ); Wed, 10 Oct 2012 20:14:23 -0400 X-Sasl-enc: 0ur8gl3MvxwGkmP4T878AurpJuOQT0g2r8paGbntMjcT 1349914462 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , alan@lxorguk.ukuu.org.uk, David Henningsson , Takashi Iwai Subject: [ 089/133] ALSA: hda - limit internal mic boost for Asus X202E Date: Thu, 11 Oct 2012 07:51:55 +0900 Message-Id: <20121010224910.509652656@linuxfoundation.org> X-Mailer: git-send-email 1.8.0.rc0.18.gf84667d In-Reply-To: <20121010224854.313159132@linuxfoundation.org> References: <20121010224854.313159132@linuxfoundation.org> User-Agent: quilt/0.60-2.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Henningsson commit 4b527b6516ab1f0af8aaedd02dbf71ee2c1180f4 upstream. When the input gain for the internal mic is set to its maximum level, the background noise becomes so high - and any relevant signal clipped - that the setting becomes unusable. It is better to limit the amplification. BugLink: https://bugs.launchpad.net/bugs/1052460 Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_via.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -3661,6 +3661,32 @@ static void set_widgets_power_state_vt20 update_power_state(codec, 0x21, AC_PWRST_D3); } +/* + * pin fix-up + */ +enum { + VIA_FIXUP_INTMIC_BOOST, +}; + +static void via_fixup_intmic_boost(struct hda_codec *codec, + const struct hda_fixup *fix, int action) +{ + if (action == HDA_FIXUP_ACT_PRE_PROBE) + override_mic_boost(codec, 0x30, 0, 2, 40); +} + +static const struct hda_fixup via_fixups[] = { + [VIA_FIXUP_INTMIC_BOOST] = { + .type = HDA_FIXUP_FUNC, + .v.func = via_fixup_intmic_boost, + }, +}; + +static const struct snd_pci_quirk vt2002p_fixups[] = { + SND_PCI_QUIRK(0x1043, 0x8532, "Asus X202E", VIA_FIXUP_INTMIC_BOOST), + {} +}; + /* patch for vt2002P */ static int patch_vt2002P(struct hda_codec *codec) { @@ -3677,6 +3703,9 @@ static int patch_vt2002P(struct hda_code override_mic_boost(codec, 0x29, 0, 3, 40); add_secret_dac_path(codec); + snd_hda_pick_fixup(codec, NULL, vt2002p_fixups, via_fixups); + snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); + /* automatic parse from the BIOS config */ err = via_parse_auto_config(codec); if (err < 0) {