diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 82 |
1 files changed, 58 insertions, 24 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 2d7d7de8498a..552a09e9211f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -10830,7 +10830,8 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
10830 | { | 10830 | { |
10831 | struct alc_spec *spec = codec->spec; | 10831 | struct alc_spec *spec = codec->spec; |
10832 | struct auto_pin_cfg *cfg = &spec->autocfg; | 10832 | struct auto_pin_cfg *cfg = &spec->autocfg; |
10833 | int i, err; | 10833 | int i, err, type; |
10834 | int type_idx = 0; | ||
10834 | hda_nid_t nid; | 10835 | hda_nid_t nid; |
10835 | 10836 | ||
10836 | for (i = 0; i < cfg->num_inputs; i++) { | 10837 | for (i = 0; i < cfg->num_inputs; i++) { |
@@ -10839,9 +10840,15 @@ static int alc_auto_add_mic_boost(struct hda_codec *codec) | |||
10839 | nid = cfg->inputs[i].pin; | 10840 | nid = cfg->inputs[i].pin; |
10840 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { | 10841 | if (get_wcaps(codec, nid) & AC_WCAP_IN_AMP) { |
10841 | char label[32]; | 10842 | char label[32]; |
10843 | type = cfg->inputs[i].type; | ||
10844 | if (i > 0 && type == cfg->inputs[i - 1].type) | ||
10845 | type_idx++; | ||
10846 | else | ||
10847 | type_idx = 0; | ||
10842 | snprintf(label, sizeof(label), "%s Boost", | 10848 | snprintf(label, sizeof(label), "%s Boost", |
10843 | hda_get_autocfg_input_label(codec, cfg, i)); | 10849 | hda_get_autocfg_input_label(codec, cfg, i)); |
10844 | err = add_control(spec, ALC_CTL_WIDGET_VOL, label, 0, | 10850 | err = add_control(spec, ALC_CTL_WIDGET_VOL, label, |
10851 | type_idx, | ||
10845 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); | 10852 | HDA_COMPOSE_AMP_VAL(nid, 3, 0, HDA_INPUT)); |
10846 | if (err < 0) | 10853 | if (err < 0) |
10847 | return err; | 10854 | return err; |
@@ -14799,7 +14806,10 @@ static int alc269_resume(struct hda_codec *codec) | |||
14799 | 14806 | ||
14800 | enum { | 14807 | enum { |
14801 | ALC269_FIXUP_SONY_VAIO, | 14808 | ALC269_FIXUP_SONY_VAIO, |
14809 | ALC275_FIX_SONY_VAIO_GPIO2, | ||
14802 | ALC269_FIXUP_DELL_M101Z, | 14810 | ALC269_FIXUP_DELL_M101Z, |
14811 | ALC269_FIXUP_SKU_IGNORE, | ||
14812 | ALC269_FIXUP_ASUS_G73JW, | ||
14803 | }; | 14813 | }; |
14804 | 14814 | ||
14805 | static const struct alc_fixup alc269_fixups[] = { | 14815 | static const struct alc_fixup alc269_fixups[] = { |
@@ -14809,6 +14819,14 @@ static const struct alc_fixup alc269_fixups[] = { | |||
14809 | {} | 14819 | {} |
14810 | } | 14820 | } |
14811 | }, | 14821 | }, |
14822 | [ALC275_FIX_SONY_VAIO_GPIO2] = { | ||
14823 | .verbs = (const struct hda_verb[]) { | ||
14824 | {0x01, AC_VERB_SET_GPIO_MASK, 0x04}, | ||
14825 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x04}, | ||
14826 | {0x01, AC_VERB_SET_GPIO_DATA, 0x00}, | ||
14827 | { } | ||
14828 | } | ||
14829 | }, | ||
14812 | [ALC269_FIXUP_DELL_M101Z] = { | 14830 | [ALC269_FIXUP_DELL_M101Z] = { |
14813 | .verbs = (const struct hda_verb[]) { | 14831 | .verbs = (const struct hda_verb[]) { |
14814 | /* Enables internal speaker */ | 14832 | /* Enables internal speaker */ |
@@ -14817,11 +14835,26 @@ static const struct alc_fixup alc269_fixups[] = { | |||
14817 | {} | 14835 | {} |
14818 | } | 14836 | } |
14819 | }, | 14837 | }, |
14838 | [ALC269_FIXUP_SKU_IGNORE] = { | ||
14839 | .sku = ALC_FIXUP_SKU_IGNORE, | ||
14840 | }, | ||
14841 | [ALC269_FIXUP_ASUS_G73JW] = { | ||
14842 | .pins = (const struct alc_pincfg[]) { | ||
14843 | { 0x17, 0x99130111 }, /* subwoofer */ | ||
14844 | { } | ||
14845 | } | ||
14846 | }, | ||
14820 | }; | 14847 | }; |
14821 | 14848 | ||
14822 | static struct snd_pci_quirk alc269_fixup_tbl[] = { | 14849 | static struct snd_pci_quirk alc269_fixup_tbl[] = { |
14850 | SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), | ||
14851 | SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), | ||
14852 | SND_PCI_QUIRK(0x104d, 0x9084, "Sony VAIO", ALC275_FIX_SONY_VAIO_GPIO2), | ||
14823 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | 14853 | SND_PCI_QUIRK_VENDOR(0x104d, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), |
14824 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | 14854 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
14855 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | ||
14856 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), | ||
14857 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | ||
14825 | {} | 14858 | {} |
14826 | }; | 14859 | }; |
14827 | 14860 | ||
@@ -15071,28 +15104,29 @@ static int patch_alc269(struct hda_codec *codec) | |||
15071 | 15104 | ||
15072 | alc_auto_parse_customize_define(codec); | 15105 | alc_auto_parse_customize_define(codec); |
15073 | 15106 | ||
15074 | coef = alc_read_coef_idx(codec, 0); | 15107 | if (codec->vendor_id == 0x10ec0269) { |
15075 | if ((coef & 0x00f0) == 0x0010) { | 15108 | coef = alc_read_coef_idx(codec, 0); |
15076 | if (codec->bus->pci->subsystem_vendor == 0x1025 && | 15109 | if ((coef & 0x00f0) == 0x0010) { |
15077 | spec->cdefine.platform_type == 1) { | 15110 | if (codec->bus->pci->subsystem_vendor == 0x1025 && |
15078 | alc_codec_rename(codec, "ALC271X"); | 15111 | spec->cdefine.platform_type == 1) { |
15079 | spec->codec_variant = ALC269_TYPE_ALC271X; | 15112 | alc_codec_rename(codec, "ALC271X"); |
15080 | } else if ((coef & 0xf000) == 0x1000) { | 15113 | spec->codec_variant = ALC269_TYPE_ALC271X; |
15081 | spec->codec_variant = ALC269_TYPE_ALC270; | 15114 | } else if ((coef & 0xf000) == 0x1000) { |
15082 | } else if ((coef & 0xf000) == 0x2000) { | 15115 | spec->codec_variant = ALC269_TYPE_ALC270; |
15083 | alc_codec_rename(codec, "ALC259"); | 15116 | } else if ((coef & 0xf000) == 0x2000) { |
15084 | spec->codec_variant = ALC269_TYPE_ALC259; | 15117 | alc_codec_rename(codec, "ALC259"); |
15085 | } else if ((coef & 0xf000) == 0x3000) { | 15118 | spec->codec_variant = ALC269_TYPE_ALC259; |
15086 | alc_codec_rename(codec, "ALC258"); | 15119 | } else if ((coef & 0xf000) == 0x3000) { |
15087 | spec->codec_variant = ALC269_TYPE_ALC258; | 15120 | alc_codec_rename(codec, "ALC258"); |
15088 | } else { | 15121 | spec->codec_variant = ALC269_TYPE_ALC258; |
15089 | alc_codec_rename(codec, "ALC269VB"); | 15122 | } else { |
15090 | spec->codec_variant = ALC269_TYPE_ALC269VB; | 15123 | alc_codec_rename(codec, "ALC269VB"); |
15091 | } | 15124 | spec->codec_variant = ALC269_TYPE_ALC269VB; |
15092 | } else | 15125 | } |
15093 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 15126 | } else |
15094 | 15127 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | |
15095 | alc269_fill_coef(codec); | 15128 | alc269_fill_coef(codec); |
15129 | } | ||
15096 | 15130 | ||
15097 | board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, | 15131 | board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, |
15098 | alc269_models, | 15132 | alc269_models, |