aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Matsuoka <cmatsuoka@gmail.com>2007-07-06 06:10:45 -0400
committerJaroslav Kysela <perex@suse.cz>2007-07-20 05:11:44 -0400
commit8341de60c76c400eaa453c91810ba6995d2fdb57 (patch)
treea910ac1b486914134883d55e4ff5fe6686e69701
parentcd1e3b40429c172b29c04a9c777be2ca1ac012e0 (diff)
[ALSA] hda-codec - Add HP Lucknow 5.1 support
Added HP Lucknow (ALC888) 5.1 surround support based on ALC883 6-channel threestack with changes in channel routing. Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/hda/patch_realtek.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 33c6fafd358f..993b503a0538 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -173,6 +173,7 @@ enum {
173 ALC883_LENOVO_NB0763, 173 ALC883_LENOVO_NB0763,
174 ALC888_LENOVO_MS7195_DIG, 174 ALC888_LENOVO_MS7195_DIG,
175 ALC888_HP_NETTLE, 175 ALC888_HP_NETTLE,
176 ALC888_HP_LUCKNOW,
176 ALC883_AUTO, 177 ALC883_AUTO,
177 ALC883_MODEL_LAST, 178 ALC883_MODEL_LAST,
178}; 179};
@@ -6065,6 +6066,44 @@ static struct snd_kcontrol_new alc888_hp_nettle_mixer[] = {
6065 { } /* end */ 6066 { } /* end */
6066}; 6067};
6067 6068
6069static struct snd_kcontrol_new alc888_hp_lucknow_mixer[] = {
6070 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6071 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
6072 HDA_CODEC_VOLUME("Surround Playback Volume", 0x0e, 0x0, HDA_OUTPUT),
6073 HDA_BIND_MUTE("Surround Playback Switch", 0x0e, 2, HDA_INPUT),
6074 HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0d, 1, 0x0, HDA_OUTPUT),
6075 HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0d, 2, 0x0, HDA_OUTPUT),
6076 HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0d, 1, 2, HDA_INPUT),
6077 HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0d, 2, 2, HDA_INPUT),
6078 HDA_CODEC_MUTE("Headphone Playback Switch", 0x1b, 0x0, HDA_OUTPUT),
6079 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
6080 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
6081 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
6082 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
6083 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
6084 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
6085 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6086 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
6087 HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
6088 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
6089 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
6090 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
6091 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
6092 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
6093 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
6094 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT),
6095 {
6096 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
6097 /* .name = "Capture Source", */
6098 .name = "Input Source",
6099 .count = 2,
6100 .info = alc883_mux_enum_info,
6101 .get = alc883_mux_enum_get,
6102 .put = alc883_mux_enum_put,
6103 },
6104 { } /* end */
6105};
6106
6068static struct snd_kcontrol_new alc883_chmode_mixer[] = { 6107static struct snd_kcontrol_new alc883_chmode_mixer[] = {
6069 { 6108 {
6070 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 6109 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -6204,6 +6243,34 @@ static struct hda_verb alc888_hp_nettle_verbs[] = {
6204 { } 6243 { }
6205}; 6244};
6206 6245
6246static struct hda_verb alc888_hp_lucknow_verbs[] = {
6247 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, /* Front: output 0 (0x0c) */
6248 {0x18, AC_VERB_SET_CONNECT_SEL, 0x01}, /* Rear : output 1 (0x0d) */
6249 {0x16, AC_VERB_SET_CONNECT_SEL, 0x02}, /* CLFE : output 2 (0x0e) */
6250 { }
6251};
6252
6253static struct hda_verb alc888_hp_lucknow_2ch_init[] = {
6254 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },
6255 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
6256 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN },
6257 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE },
6258 { }
6259};
6260
6261static struct hda_verb alc888_hp_lucknow_6ch_init[] = {
6262 { 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
6263 { 0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
6264 { 0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
6265 { 0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
6266 { }
6267};
6268
6269static struct hda_channel_mode alc888_hp_lucknow_modes[2] = {
6270 { 2, alc888_hp_lucknow_2ch_init },
6271 { 6, alc888_hp_lucknow_6ch_init },
6272};
6273
6207/* toggle front-jack and RCA according to the hp-jack state */ 6274/* toggle front-jack and RCA according to the hp-jack state */
6208static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec) 6275static void alc888_lenovo_ms7195_front_automute(struct hda_codec *codec)
6209{ 6276{
@@ -6447,6 +6514,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
6447 [ALC883_LENOVO_NB0763] = "lenovo-nb0763", 6514 [ALC883_LENOVO_NB0763] = "lenovo-nb0763",
6448 [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig", 6515 [ALC888_LENOVO_MS7195_DIG] = "lenovo-ms7195-dig",
6449 [ALC888_HP_NETTLE] = "hp-nettle", 6516 [ALC888_HP_NETTLE] = "hp-nettle",
6517 [ALC888_HP_LUCKNOW] = "hp-lucknow",
6450 [ALC883_AUTO] = "auto", 6518 [ALC883_AUTO] = "auto",
6451}; 6519};
6452 6520
@@ -6482,6 +6550,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
6482 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6550 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
6483 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763), 6551 SND_PCI_QUIRK(0x17aa, 0x2085, "Lenovo NB0763", ALC883_LENOVO_NB0763),
6484 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC888_HP_NETTLE), 6552 SND_PCI_QUIRK(0x103c, 0x2a61, "HP Nettle", ALC888_HP_NETTLE),
6553 SND_PCI_QUIRK(0x103c, 0x2a60, "HP Lucknow", ALC888_HP_LUCKNOW),
6485 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), 6554 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2),
6486 {} 6555 {}
6487}; 6556};
@@ -6679,6 +6748,18 @@ static struct alc_config_preset alc883_presets[] = {
6679 .channel_mode = alc883_sixstack_modes, 6748 .channel_mode = alc883_sixstack_modes,
6680 .input_mux = &alc883_capture_source, 6749 .input_mux = &alc883_capture_source,
6681 }, 6750 },
6751 [ALC888_HP_LUCKNOW] = {
6752 .mixers = { alc888_hp_lucknow_mixer, alc883_chmode_mixer },
6753 .init_verbs = { alc883_init_verbs, alc888_hp_lucknow_verbs },
6754 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6755 .dac_nids = alc883_dac_nids,
6756 .num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
6757 .adc_nids = alc883_adc_nids,
6758 .num_channel_mode = ARRAY_SIZE(alc888_hp_lucknow_modes),
6759 .channel_mode = alc888_hp_lucknow_modes,
6760 .need_dac_fix = 1,
6761 .input_mux = &alc883_capture_source,
6762 },
6682}; 6763};
6683 6764
6684 6765