aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorJiang zhe <zhe.jiang@intel.com>2008-03-06 05:07:11 -0500
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:21 -0400
commitfb97dc67397c1ee63eb0094c28fc9a5dcc0a83a6 (patch)
tree93e36f759dfddc5136c2af3279311e275cb6180c /sound/pci/hda/patch_realtek.c
parentd08cd58db9f4078bb9237fc6ff7104ed50d7804b (diff)
[ALSA] hda-codec - model for alc883 to support FUJITSU Pi2515
There is no suitable model for Pi2515. This model is to support it. ALSA bug#3800. Signed-off-by: Jiang zhe <zhe.jiang@intel.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.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d2e81d0fcd0f..41bcbfd10598 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -202,6 +202,7 @@ enum {
202 ALC888_6ST_DELL, 202 ALC888_6ST_DELL,
203 ALC883_MITAC, 203 ALC883_MITAC,
204 ALC883_CLEVO_M720R, 204 ALC883_CLEVO_M720R,
205 ALC883_FUJITSU_PI2515,
205 ALC883_AUTO, 206 ALC883_AUTO,
206 ALC883_MODEL_LAST, 207 ALC883_MODEL_LAST,
207}; 208};
@@ -6484,6 +6485,14 @@ static struct hda_input_mux alc883_lenovo_nb0763_capture_source = {
6484 }, 6485 },
6485}; 6486};
6486 6487
6488static struct hda_input_mux alc883_fujitsu_pi2515_capture_source = {
6489 .num_items = 2,
6490 .items = {
6491 { "Mic", 0x0 },
6492 { "Int Mic", 0x1 },
6493 },
6494};
6495
6487#define alc883_mux_enum_info alc_mux_enum_info 6496#define alc883_mux_enum_info alc_mux_enum_info
6488#define alc883_mux_enum_get alc_mux_enum_get 6497#define alc883_mux_enum_get alc_mux_enum_get
6489/* ALC883 has the ALC882-type input selection */ 6498/* ALC883 has the ALC882-type input selection */
@@ -6673,6 +6682,33 @@ static struct snd_kcontrol_new alc883_clevo_m720r_mixer[] = {
6673 { } /* end */ 6682 { } /* end */
6674}; 6683};
6675 6684
6685static struct snd_kcontrol_new alc883_2ch_fujitsu_pi2515_mixer[] = {
6686 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6687 HDA_BIND_MUTE("Headphone Playback Switch", 0x0c, 2, HDA_INPUT),
6688 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
6689 HDA_BIND_MUTE("Speaker Playback Switch", 0x0d, 2, HDA_INPUT),
6690 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
6691 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
6692 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6693 HDA_CODEC_VOLUME("Int Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
6694 HDA_CODEC_VOLUME("Int Mic Boost", 0x19, 0, HDA_INPUT),
6695 HDA_CODEC_MUTE("Int Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
6696 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
6697 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
6698 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
6699 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
6700 {
6701 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
6702 /* .name = "Capture Source", */
6703 .name = "Input Source",
6704 .count = 2,
6705 .info = alc883_mux_enum_info,
6706 .get = alc883_mux_enum_get,
6707 .put = alc883_mux_enum_put,
6708 },
6709 { } /* end */
6710};
6711
6676static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = { 6712static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = {
6677 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 6713 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6678 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), 6714 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -7220,6 +7256,20 @@ static struct hda_verb alc883_clevo_m720r_verbs[] = {
7220 { } /* end */ 7256 { } /* end */
7221}; 7257};
7222 7258
7259static struct hda_verb alc883_2ch_fujitsu_pi2515_verbs[] = {
7260 /* HP */
7261 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7262 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
7263 /* Subwoofer */
7264 {0x15, AC_VERB_SET_CONNECT_SEL, 0x01},
7265 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
7266
7267 /* enable unsolicited event */
7268 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
7269
7270 { } /* end */
7271};
7272
7223static struct hda_verb alc883_tagra_verbs[] = { 7273static struct hda_verb alc883_tagra_verbs[] = {
7224 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 7274 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7225 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 7275 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
@@ -7423,6 +7473,26 @@ static void alc883_clevo_m720r_unsol_event(struct hda_codec *codec,
7423 alc883_clevo_m720r_automute(codec); 7473 alc883_clevo_m720r_automute(codec);
7424} 7474}
7425 7475
7476/* toggle speaker-output according to the hp-jack state */
7477static void alc883_2ch_fujitsu_pi2515_automute(struct hda_codec *codec)
7478{
7479 unsigned int present;
7480 unsigned char bits;
7481
7482 present = snd_hda_codec_read(codec, 0x14, 0, AC_VERB_GET_PIN_SENSE, 0)
7483 & AC_PINSENSE_PRESENCE;
7484 bits = present ? HDA_AMP_MUTE : 0;
7485 snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
7486 HDA_AMP_MUTE, bits);
7487}
7488
7489static void alc883_2ch_fujitsu_pi2515_unsol_event(struct hda_codec *codec,
7490 unsigned int res)
7491{
7492 if ((res >> 26) == ALC880_HP_EVENT)
7493 alc883_2ch_fujitsu_pi2515_automute(codec);
7494}
7495
7426static void alc883_haier_w66_automute(struct hda_codec *codec) 7496static void alc883_haier_w66_automute(struct hda_codec *codec)
7427{ 7497{
7428 unsigned int present; 7498 unsigned int present;
@@ -7661,6 +7731,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
7661 [ALC888_6ST_DELL] = "6stack-dell", 7731 [ALC888_6ST_DELL] = "6stack-dell",
7662 [ALC883_MITAC] = "mitac", 7732 [ALC883_MITAC] = "mitac",
7663 [ALC883_CLEVO_M720R] = "clevo-m720r", 7733 [ALC883_CLEVO_M720R] = "clevo-m720r",
7734 [ALC883_FUJITSU_PI2515] = "fujitsu-pi2515",
7664 [ALC883_AUTO] = "auto", 7735 [ALC883_AUTO] = "auto",
7665}; 7736};
7666 7737
@@ -7706,6 +7777,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
7706 SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD), 7777 SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD),
7707 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch), 7778 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
7708 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), 7779 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
7780 SND_PCI_QUIRK(0x1734, 0x1108, "Fujitsu AMILO Pi2515", ALC883_FUJITSU_PI2515),
7709 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), 7781 SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch),
7710 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), 7782 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
7711 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), 7783 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763),
@@ -7950,6 +8022,19 @@ static struct alc_config_preset alc883_presets[] = {
7950 .unsol_event = alc883_mitac_unsol_event, 8022 .unsol_event = alc883_mitac_unsol_event,
7951 .init_hook = alc883_mitac_automute, 8023 .init_hook = alc883_mitac_automute,
7952 }, 8024 },
8025 [ALC883_FUJITSU_PI2515] = {
8026 .mixers = { alc883_2ch_fujitsu_pi2515_mixer },
8027 .init_verbs = { alc883_init_verbs,
8028 alc883_2ch_fujitsu_pi2515_verbs},
8029 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
8030 .dac_nids = alc883_dac_nids,
8031 .dig_out_nid = ALC883_DIGOUT_NID,
8032 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
8033 .channel_mode = alc883_3ST_2ch_modes,
8034 .input_mux = &alc883_fujitsu_pi2515_capture_source,
8035 .unsol_event = alc883_2ch_fujitsu_pi2515_unsol_event,
8036 .init_hook = alc883_2ch_fujitsu_pi2515_automute,
8037 },
7953}; 8038};
7954 8039
7955 8040