aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com.tw>2007-11-14 06:06:21 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:23 -0500
commit66d2a9d659ccc6ecf51d606fea9d1058d357f453 (patch)
tree9b63c5d5f1ea22d5c461ba338876f21da91c57ee /sound/pci/hda/patch_realtek.c
parent83a28a09c8d02d29c17e903ca713d9b8f4159ad4 (diff)
[ALSA] hda-codec - Add support of HP Thin Client T5735
Added the support of HP Thin Client T5735 [0x103c 0x302f] with ALC262 codec. Signed-off-by: Kailang Yang <kailang@realtek.com.tw> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 1126068b6ee4..c6c0bdef204c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -92,6 +92,7 @@ enum {
92 ALC262_HP_BPC, 92 ALC262_HP_BPC,
93 ALC262_HP_BPC_D7000_WL, 93 ALC262_HP_BPC_D7000_WL,
94 ALC262_HP_BPC_D7000_WF, 94 ALC262_HP_BPC_D7000_WF,
95 ALC262_HP_TC_T5735,
95 ALC262_BENQ_ED8, 96 ALC262_BENQ_ED8,
96 ALC262_SONY_ASSAMD, 97 ALC262_SONY_ASSAMD,
97 ALC262_BENQ_T31, 98 ALC262_BENQ_T31,
@@ -7710,6 +7711,81 @@ static struct snd_kcontrol_new alc262_HP_BPC_WildWest_option_mixer[] = {
7710 { } /* end */ 7711 { } /* end */
7711}; 7712};
7712 7713
7714static struct hda_bind_ctls alc262_hp_t5735_bind_front_vol = {
7715 .ops = &snd_hda_bind_vol,
7716 .values = {
7717 HDA_COMPOSE_AMP_VAL(0x0c, 3, 0, HDA_OUTPUT),
7718 HDA_COMPOSE_AMP_VAL(0x0d, 3, 0, HDA_OUTPUT),
7719 0
7720 },
7721};
7722
7723static struct hda_bind_ctls alc262_hp_t5735_bind_front_sw = {
7724 .ops = &snd_hda_bind_sw,
7725 .values = {
7726 HDA_COMPOSE_AMP_VAL(0x14, 3, 0, HDA_OUTPUT),
7727 HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
7728 0
7729 },
7730};
7731
7732/* mute/unmute internal speaker according to the hp jack and mute state */
7733static void alc262_hp_t5735_automute(struct hda_codec *codec, int force)
7734{
7735 struct alc_spec *spec = codec->spec;
7736 unsigned int mute;
7737
7738 if (force || !spec->sense_updated) {
7739 unsigned int present;
7740 present = snd_hda_codec_read(codec, 0x15, 0,
7741 AC_VERB_GET_PIN_SENSE, 0);
7742 spec->jack_present = (present & 0x80000000) != 0;
7743 spec->sense_updated = 1;
7744 }
7745 if (spec->jack_present)
7746 mute = (0x7080 | ((0)<<8)); /* mute internal speaker */
7747 else /* unmute internal speaker if necessary */
7748 mute = (0x7000 | ((0)<<8));
7749 snd_hda_codec_write(codec, 0x0c, 0,
7750 AC_VERB_SET_AMP_GAIN_MUTE, mute );
7751}
7752
7753static void alc262_hp_t5735_unsol_event(struct hda_codec *codec,
7754 unsigned int res)
7755{
7756 if ((res >> 26) != ALC880_HP_EVENT)
7757 return;
7758 alc262_hp_t5735_automute(codec, 1);
7759}
7760
7761static void alc262_hp_t5735_init_hook(struct hda_codec *codec)
7762{
7763 alc262_hp_t5735_automute(codec, 1);
7764}
7765
7766static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
7767 HDA_BIND_VOL("PCM Playback Volume", &alc262_hp_t5735_bind_front_vol),
7768 HDA_BIND_SW("PCM Playback Switch",&alc262_hp_t5735_bind_front_sw),
7769 HDA_CODEC_VOLUME("LineOut Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7770 HDA_CODEC_MUTE("LineOut Playback Switch", 0x14, 0x0, HDA_OUTPUT),
7771 HDA_CODEC_VOLUME("iSpeaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
7772 HDA_CODEC_MUTE("iSpeaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
7773 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
7774 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
7775 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
7776 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
7777 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
7778 { } /* end */
7779};
7780
7781static struct hda_verb alc262_hp_t5735_verbs[] = {
7782 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7783 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7784
7785 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7786 { }
7787};
7788
7713/* bind hp and internal speaker mute (with plug check) */ 7789/* bind hp and internal speaker mute (with plug check) */
7714static int alc262_sony_master_sw_put(struct snd_kcontrol *kcontrol, 7790static int alc262_sony_master_sw_put(struct snd_kcontrol *kcontrol,
7715 struct snd_ctl_elem_value *ucontrol) 7791 struct snd_ctl_elem_value *ucontrol)
@@ -8579,6 +8655,8 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
8579 SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF), 8655 SND_PCI_QUIRK(0x103c, 0x2803, "HP D7000", ALC262_HP_BPC_D7000_WF),
8580 SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF), 8656 SND_PCI_QUIRK(0x103c, 0x2805, "HP D7000", ALC262_HP_BPC_D7000_WF),
8581 SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF), 8657 SND_PCI_QUIRK(0x103c, 0x2807, "HP D7000", ALC262_HP_BPC_D7000_WF),
8658 SND_PCI_QUIRK(0x103c, 0x302f, "HP Thin Client T5735",
8659 ALC262_HP_TC_T5735),
8582 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO), 8660 SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO),
8583 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 8661 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
8584 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), 8662 SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1),
@@ -8673,6 +8751,18 @@ static struct alc_config_preset alc262_presets[] = {
8673 .channel_mode = alc262_modes, 8751 .channel_mode = alc262_modes,
8674 .input_mux = &alc262_HP_D7000_capture_source, 8752 .input_mux = &alc262_HP_D7000_capture_source,
8675 }, 8753 },
8754 [ALC262_HP_TC_T5735] = {
8755 .mixers = { alc262_hp_t5735_mixer },
8756 .init_verbs = { alc262_init_verbs, alc262_hp_t5735_verbs },
8757 .num_dacs = ARRAY_SIZE(alc262_dac_nids),
8758 .dac_nids = alc262_dac_nids,
8759 .hp_nid = 0x03,
8760 .num_channel_mode = ARRAY_SIZE(alc262_modes),
8761 .channel_mode = alc262_modes,
8762 .input_mux = &alc262_capture_source,
8763 .unsol_event = alc262_hp_t5735_unsol_event,
8764 .init_hook = alc262_hp_t5735_init_hook,
8765 },
8676 [ALC262_BENQ_ED8] = { 8766 [ALC262_BENQ_ED8] = {
8677 .mixers = { alc262_base_mixer }, 8767 .mixers = { alc262_base_mixer },
8678 .init_verbs = { alc262_init_verbs, alc262_EAPD_verbs }, 8768 .init_verbs = { alc262_init_verbs, alc262_EAPD_verbs },