aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2013-08-22 04:15:24 -0400
committerTakashi Iwai <tiwai@suse.de>2013-08-22 05:55:33 -0400
commitcd217a6395ae1b14cd70908e190f566b8bbd282f (patch)
tree9818cb16d1115c637d7967a28fab5a5532d6ab37 /sound/pci
parent2af02be71a8ae28ae4e3b82a2866b1aa1f43d8fb (diff)
ALSA: hda - Add workarounds for pop-noise on Chromebook with ALC283
The headphone automute on this machine triggers annoying pop noises. It seems that only the first DAC can be used, the secondary DAC always results in this problem. This patch disables the secondary DAC with a few additional workarounds. Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4bdccd1a415c..134fbe86d8c3 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3394,6 +3394,45 @@ static void alc269_fixup_limit_int_mic_boost(struct hda_codec *codec,
3394 } 3394 }
3395} 3395}
3396 3396
3397static void alc283_hp_automute_hook(struct hda_codec *codec,
3398 struct hda_jack_tbl *jack)
3399{
3400 struct alc_spec *spec = codec->spec;
3401 int vref;
3402
3403 msleep(200);
3404 snd_hda_gen_hp_automute(codec, jack);
3405
3406 vref = spec->gen.hp_jack_present ? PIN_VREF80 : 0;
3407
3408 msleep(600);
3409 snd_hda_codec_write(codec, 0x19, 0, AC_VERB_SET_PIN_WIDGET_CONTROL,
3410 vref);
3411}
3412
3413static void alc283_chromebook_caps(struct hda_codec *codec)
3414{
3415 snd_hda_override_wcaps(codec, 0x03, 0);
3416}
3417
3418static void alc283_fixup_chromebook(struct hda_codec *codec,
3419 const struct hda_fixup *fix, int action)
3420{
3421 struct alc_spec *spec = codec->spec;
3422 int val;
3423
3424 switch (action) {
3425 case HDA_FIXUP_ACT_PRE_PROBE:
3426 alc283_chromebook_caps(codec);
3427 spec->gen.hp_automute_hook = alc283_hp_automute_hook;
3428 /* MIC2-VREF control */
3429 /* Set to manual mode */
3430 val = alc_read_coef_idx(codec, 0x06);
3431 alc_write_coef_idx(codec, 0x06, val & ~0x000c);
3432 break;
3433 }
3434}
3435
3397enum { 3436enum {
3398 ALC269_FIXUP_SONY_VAIO, 3437 ALC269_FIXUP_SONY_VAIO,
3399 ALC275_FIXUP_SONY_VAIO_GPIO2, 3438 ALC275_FIXUP_SONY_VAIO_GPIO2,
@@ -3430,6 +3469,7 @@ enum {
3430 ALC269_FIXUP_ACER_AC700, 3469 ALC269_FIXUP_ACER_AC700,
3431 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 3470 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
3432 ALC269VB_FIXUP_ORDISSIMO_EVE2, 3471 ALC269VB_FIXUP_ORDISSIMO_EVE2,
3472 ALC283_FIXUP_CHROME_BOOK,
3433}; 3473};
3434 3474
3435static const struct hda_fixup alc269_fixups[] = { 3475static const struct hda_fixup alc269_fixups[] = {
@@ -3681,6 +3721,10 @@ static const struct hda_fixup alc269_fixups[] = {
3681 { } 3721 { }
3682 }, 3722 },
3683 }, 3723 },
3724 [ALC283_FIXUP_CHROME_BOOK] = {
3725 .type = HDA_FIXUP_FUNC,
3726 .v.func = alc283_fixup_chromebook,
3727 },
3684}; 3728};
3685 3729
3686static const struct snd_pci_quirk alc269_fixup_tbl[] = { 3730static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -3728,6 +3772,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3728 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED), 3772 SND_PCI_QUIRK(0x103c, 0x18e6, "HP", ALC269_FIXUP_HP_GPIO_LED),
3729 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 3773 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
3730 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 3774 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
3775 SND_PCI_QUIRK(0x103c, 0x21ed, "HP Falco Chromebook", ALC283_FIXUP_CHROME_BOOK),
3731 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 3776 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
3732 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3777 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
3733 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 3778 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),