diff options
author | David Henningsson <david.henningsson@canonical.com> | 2013-04-22 08:30:14 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-04-22 08:50:41 -0400 |
commit | 3e0d611b2045b230c3acfb05c3b5ce53b09f6cdd (patch) | |
tree | c83bdf5ea98abb72637a7185165127457ee7e26d /sound/pci/hda/patch_realtek.c | |
parent | b5f035dbca2895cd253141706b47b6cb8afc2ed5 (diff) |
ALSA: hda - Limit internal mic boost for a few Asus machines
These are being reported as being so noisy at high mic boost levels,
so they are unusable in practice.
Therefore artificially limit the boosts.
BugLink: https://bugs.launchpad.net/bugs/1089795
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 28b3f5ac76dc..6e5d3831601b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -3156,6 +3156,38 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec, | |||
3156 | } | 3156 | } |
3157 | } | 3157 | } |
3158 | 3158 | ||
3159 | static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec, | ||
3160 | const struct hda_fixup *fix, | ||
3161 | int action) | ||
3162 | { | ||
3163 | struct alc_spec *spec = codec->spec; | ||
3164 | struct auto_pin_cfg *cfg = &spec->gen.autocfg; | ||
3165 | int i; | ||
3166 | |||
3167 | /* The mic boosts on level 2 and 3 are too noisy | ||
3168 | on the internal mic input. | ||
3169 | Therefore limit the boost to 0 or 1. */ | ||
3170 | |||
3171 | if (action != HDA_FIXUP_ACT_PROBE) | ||
3172 | return; | ||
3173 | |||
3174 | for (i = 0; i < cfg->num_inputs; i++) { | ||
3175 | hda_nid_t nid = cfg->inputs[i].pin; | ||
3176 | unsigned int defcfg; | ||
3177 | if (cfg->inputs[i].type != AUTO_PIN_MIC) | ||
3178 | continue; | ||
3179 | defcfg = snd_hda_codec_get_pincfg(codec, nid); | ||
3180 | if (snd_hda_get_input_pin_attr(defcfg) != INPUT_PIN_ATTR_INT) | ||
3181 | continue; | ||
3182 | |||
3183 | snd_hda_override_amp_caps(codec, nid, HDA_INPUT, | ||
3184 | (0x00 << AC_AMPCAP_OFFSET_SHIFT) | | ||
3185 | (0x01 << AC_AMPCAP_NUM_STEPS_SHIFT) | | ||
3186 | (0x2f << AC_AMPCAP_STEP_SIZE_SHIFT) | | ||
3187 | (0 << AC_AMPCAP_MUTE_SHIFT)); | ||
3188 | } | ||
3189 | } | ||
3190 | |||
3159 | enum { | 3191 | enum { |
3160 | ALC269_FIXUP_SONY_VAIO, | 3192 | ALC269_FIXUP_SONY_VAIO, |
3161 | ALC275_FIXUP_SONY_VAIO_GPIO2, | 3193 | ALC275_FIXUP_SONY_VAIO_GPIO2, |
@@ -3190,6 +3222,7 @@ enum { | |||
3190 | ALC271_FIXUP_AMIC_MIC2, | 3222 | ALC271_FIXUP_AMIC_MIC2, |
3191 | ALC271_FIXUP_HP_GATE_MIC_JACK, | 3223 | ALC271_FIXUP_HP_GATE_MIC_JACK, |
3192 | ALC269_FIXUP_ACER_AC700, | 3224 | ALC269_FIXUP_ACER_AC700, |
3225 | ALC269_FIXUP_LIMIT_INT_MIC_BOOST, | ||
3193 | }; | 3226 | }; |
3194 | 3227 | ||
3195 | static const struct hda_fixup alc269_fixups[] = { | 3228 | static const struct hda_fixup alc269_fixups[] = { |
@@ -3428,6 +3461,10 @@ static const struct hda_fixup alc269_fixups[] = { | |||
3428 | .chained = true, | 3461 | .chained = true, |
3429 | .chain_id = ALC271_FIXUP_DMIC, | 3462 | .chain_id = ALC271_FIXUP_DMIC, |
3430 | }, | 3463 | }, |
3464 | [ALC269_FIXUP_LIMIT_INT_MIC_BOOST] = { | ||
3465 | .type = HDA_FIXUP_FUNC, | ||
3466 | .v.func = alc269_fixup_limit_int_mic_boost, | ||
3467 | }, | ||
3431 | }; | 3468 | }; |
3432 | 3469 | ||
3433 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 3470 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -3458,11 +3495,14 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
3458 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 3495 | SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
3459 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 3496 | SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
3460 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), | 3497 | SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), |
3498 | SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | ||
3499 | SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | ||
3461 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), | 3500 | SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), |
3462 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), | 3501 | SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC), |
3502 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), | ||
3463 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | 3503 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
3464 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), | 3504 | SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
3465 | SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), | 3505 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
3466 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), | 3506 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), |
3467 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | 3507 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), |
3468 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), | 3508 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), |