diff options
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 0c81d92c3d75..bd9ef3363890 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -103,6 +103,7 @@ enum { | |||
103 | ALC262_NEC, | 103 | ALC262_NEC, |
104 | ALC262_TOSHIBA_S06, | 104 | ALC262_TOSHIBA_S06, |
105 | ALC262_TOSHIBA_RX1, | 105 | ALC262_TOSHIBA_RX1, |
106 | ALC262_TYAN, | ||
106 | ALC262_AUTO, | 107 | ALC262_AUTO, |
107 | ALC262_MODEL_LAST /* last tag */ | 108 | ALC262_MODEL_LAST /* last tag */ |
108 | }; | 109 | }; |
@@ -9509,6 +9510,67 @@ static struct snd_kcontrol_new alc262_benq_t31_mixer[] = { | |||
9509 | { } /* end */ | 9510 | { } /* end */ |
9510 | }; | 9511 | }; |
9511 | 9512 | ||
9513 | static struct snd_kcontrol_new alc262_tyan_mixer[] = { | ||
9514 | HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
9515 | HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT), | ||
9516 | HDA_CODEC_VOLUME("Aux Playback Volume", 0x0b, 0x06, HDA_INPUT), | ||
9517 | HDA_CODEC_MUTE("Aux Playback Switch", 0x0b, 0x06, HDA_INPUT), | ||
9518 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
9519 | HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
9520 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
9521 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
9522 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), | ||
9523 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | ||
9524 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), | ||
9525 | HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), | ||
9526 | { } /* end */ | ||
9527 | }; | ||
9528 | |||
9529 | static struct hda_verb alc262_tyan_verbs[] = { | ||
9530 | /* Headphone automute */ | ||
9531 | {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
9532 | {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
9533 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
9534 | |||
9535 | /* P11 AUX_IN, white 4-pin connector */ | ||
9536 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
9537 | {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, 0xe1}, | ||
9538 | {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, 0x93}, | ||
9539 | {0x14, AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, 0x19}, | ||
9540 | |||
9541 | {} | ||
9542 | }; | ||
9543 | |||
9544 | /* unsolicited event for HP jack sensing */ | ||
9545 | static void alc262_tyan_automute(struct hda_codec *codec) | ||
9546 | { | ||
9547 | unsigned int mute; | ||
9548 | unsigned int present; | ||
9549 | |||
9550 | snd_hda_codec_read(codec, 0x1b, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
9551 | present = snd_hda_codec_read(codec, 0x1b, 0, | ||
9552 | AC_VERB_GET_PIN_SENSE, 0); | ||
9553 | present = (present & 0x80000000) != 0; | ||
9554 | if (present) { | ||
9555 | /* mute line output on ATX panel */ | ||
9556 | snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, | ||
9557 | HDA_AMP_MUTE, HDA_AMP_MUTE); | ||
9558 | } else { | ||
9559 | /* unmute line output if necessary */ | ||
9560 | mute = snd_hda_codec_amp_read(codec, 0x1b, 0, HDA_OUTPUT, 0); | ||
9561 | snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0, | ||
9562 | HDA_AMP_MUTE, mute); | ||
9563 | } | ||
9564 | } | ||
9565 | |||
9566 | static void alc262_tyan_unsol_event(struct hda_codec *codec, | ||
9567 | unsigned int res) | ||
9568 | { | ||
9569 | if ((res >> 26) != ALC880_HP_EVENT) | ||
9570 | return; | ||
9571 | alc262_tyan_automute(codec); | ||
9572 | } | ||
9573 | |||
9512 | #define alc262_capture_mixer alc882_capture_mixer | 9574 | #define alc262_capture_mixer alc882_capture_mixer |
9513 | #define alc262_capture_alt_mixer alc882_capture_alt_mixer | 9575 | #define alc262_capture_alt_mixer alc882_capture_alt_mixer |
9514 | 9576 | ||
@@ -10626,6 +10688,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = { | |||
10626 | [ALC262_ULTRA] = "ultra", | 10688 | [ALC262_ULTRA] = "ultra", |
10627 | [ALC262_LENOVO_3000] = "lenovo-3000", | 10689 | [ALC262_LENOVO_3000] = "lenovo-3000", |
10628 | [ALC262_NEC] = "nec", | 10690 | [ALC262_NEC] = "nec", |
10691 | [ALC262_TYAN] = "tyan", | ||
10629 | [ALC262_AUTO] = "auto", | 10692 | [ALC262_AUTO] = "auto", |
10630 | }; | 10693 | }; |
10631 | 10694 | ||
@@ -10666,6 +10729,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
10666 | SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06), | 10729 | SND_PCI_QUIRK(0x1179, 0xff7b, "Toshiba S06", ALC262_TOSHIBA_S06), |
10667 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), | 10730 | SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), |
10668 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), | 10731 | SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), |
10732 | SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_TYAN), | ||
10669 | SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), | 10733 | SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), |
10670 | SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), | 10734 | SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA), |
10671 | SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO), | 10735 | SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO), |
@@ -10884,6 +10948,19 @@ static struct alc_config_preset alc262_presets[] = { | |||
10884 | .unsol_event = alc262_hippo_unsol_event, | 10948 | .unsol_event = alc262_hippo_unsol_event, |
10885 | .init_hook = alc262_hippo_automute, | 10949 | .init_hook = alc262_hippo_automute, |
10886 | }, | 10950 | }, |
10951 | [ALC262_TYAN] = { | ||
10952 | .mixers = { alc262_tyan_mixer }, | ||
10953 | .init_verbs = { alc262_init_verbs, alc262_tyan_verbs}, | ||
10954 | .num_dacs = ARRAY_SIZE(alc262_dac_nids), | ||
10955 | .dac_nids = alc262_dac_nids, | ||
10956 | .hp_nid = 0x02, | ||
10957 | .dig_out_nid = ALC262_DIGOUT_NID, | ||
10958 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | ||
10959 | .channel_mode = alc262_modes, | ||
10960 | .input_mux = &alc262_capture_source, | ||
10961 | .unsol_event = alc262_tyan_unsol_event, | ||
10962 | .init_hook = alc262_tyan_automute, | ||
10963 | }, | ||
10887 | }; | 10964 | }; |
10888 | 10965 | ||
10889 | static int patch_alc262(struct hda_codec *codec) | 10966 | static int patch_alc262(struct hda_codec *codec) |