aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com.tw>2007-08-15 10:21:59 -0400
committerJaroslav Kysela <perex@perex.cz>2007-10-16 09:58:57 -0400
commitd1a991a682f6718db6c611ccfd36d903732d946c (patch)
tree85cca8b551b6e3c912e075b980bf4888d6658de5 /sound/pci/hda/patch_realtek.c
parent765c24efa55752b715d9122f36eee485d4903839 (diff)
[ALSA] hda-codec - Update realtek codec support
1. Support Acer Aspire 9810 2. Support TOSHIBA A205 3. Support HP TX1000 Signed-off-by: Kailang Yang <kailang@realtek.com.tw> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c125
1 files changed, 93 insertions, 32 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 171f64192dc8..778853c0de8c 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -102,6 +102,7 @@ enum {
102/* ALC268 models */ 102/* ALC268 models */
103enum { 103enum {
104 ALC268_3ST, 104 ALC268_3ST,
105 ALC268_TOSHIBA,
105 ALC268_AUTO, 106 ALC268_AUTO,
106 ALC268_MODEL_LAST /* last tag */ 107 ALC268_MODEL_LAST /* last tag */
107}; 108};
@@ -129,6 +130,7 @@ enum {
129 ALC861VD_6ST_DIG, 130 ALC861VD_6ST_DIG,
130 ALC861VD_LENOVO, 131 ALC861VD_LENOVO,
131 ALC861VD_DALLAS, 132 ALC861VD_DALLAS,
133 ALC861VD_HP,
132 ALC861VD_AUTO, 134 ALC861VD_AUTO,
133 ALC861VD_MODEL_LAST, 135 ALC861VD_MODEL_LAST,
134}; 136};
@@ -6253,16 +6255,14 @@ static struct snd_kcontrol_new alc888_3st_hp_mixer[] = {
6253}; 6255};
6254 6256
6255static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = { 6257static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
6256 HDA_CODEC_VOLUME("Front Playback Volume", 0x0d, 0x0, HDA_OUTPUT), 6258 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6257 HDA_CODEC_MUTE("Front Playback Switch", 0x15, 0x0, HDA_OUTPUT), 6259 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
6258 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
6259 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT), 6260 HDA_CODEC_MUTE("Headphone Playback Switch", 0x14, 0x0, HDA_OUTPUT),
6260 HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT),
6261 HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT),
6262 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
6263 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6264 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), 6261 HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT),
6265 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), 6262 HDA_CODEC_MUTE("Line Playback Switch", 0x0b, 0x02, HDA_INPUT),
6263 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
6264 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
6265 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
6266 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), 6266 HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT),
6267 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), 6267 HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT),
6268 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), 6268 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT),
@@ -6277,7 +6277,7 @@ static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
6277 .put = alc883_mux_enum_put, 6277 .put = alc883_mux_enum_put,
6278 }, 6278 },
6279 { } /* end */ 6279 { } /* end */
6280}; 6280};
6281 6281
6282static struct snd_kcontrol_new alc883_chmode_mixer[] = { 6282static struct snd_kcontrol_new alc883_chmode_mixer[] = {
6283 { 6283 {
@@ -6490,18 +6490,6 @@ static struct hda_verb alc883_medion_md2_verbs[] = {
6490 { } /* end */ 6490 { } /* end */
6491}; 6491};
6492 6492
6493static struct hda_verb alc883_acer_aspire_verbs[] = {
6494 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6495 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6496 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
6497 {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
6498
6499 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6500
6501 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
6502 { } /* end */
6503};
6504
6505/* toggle speaker-output according to the hp-jack state */ 6493/* toggle speaker-output according to the hp-jack state */
6506static void alc883_medion_md2_automute(struct hda_codec *codec) 6494static void alc883_medion_md2_automute(struct hda_codec *codec)
6507{ 6495{
@@ -6576,6 +6564,21 @@ static void alc883_lenovo_101e_unsol_event(struct hda_codec *codec,
6576 alc883_lenovo_101e_ispeaker_automute(codec); 6564 alc883_lenovo_101e_ispeaker_automute(codec);
6577} 6565}
6578 6566
6567static struct hda_verb alc883_acer_eapd_verbs[] = {
6568 /* HP Pin: output 0 (0x0c) */
6569 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
6570 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6571 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
6572 /* Front Pin: output 0 (0x0c) */
6573 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
6574 {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
6575 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
6576 /* eanable EAPD on medion laptop */
6577 {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
6578 {0x20, AC_VERB_SET_PROC_COEF, 0x3050},
6579 { }
6580};
6581
6579/* 6582/*
6580 * generic initialization of ADC, input mixers and output mixers 6583 * generic initialization of ADC, input mixers and output mixers
6581 */ 6584 */
@@ -6718,6 +6721,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
6718 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG), 6721 SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
6719 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG), 6722 SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
6720 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG), 6723 SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
6724 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
6721 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), 6725 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
6722 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), 6726 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER),
6723 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch), 6727 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
@@ -6834,8 +6838,13 @@ static struct alc_config_preset alc883_presets[] = {
6834 .input_mux = &alc883_capture_source, 6838 .input_mux = &alc883_capture_source,
6835 }, 6839 },
6836 [ALC883_ACER_ASPIRE] = { 6840 [ALC883_ACER_ASPIRE] = {
6837 .mixers = { alc883_acer_aspire_mixer}, 6841 .mixers = { alc883_acer_aspire_mixer, alc883_chmode_mixer },
6838 .init_verbs = { alc883_init_verbs, alc883_acer_aspire_verbs}, 6842 /* On TravelMate laptops, GPIO 0 enables the internal speaker
6843 * and the headphone jack. Turn this on and rely on the
6844 * standard mute methods whenever the user wants to turn
6845 * these outputs off.
6846 */
6847 .init_verbs = { alc883_init_verbs, alc883_acer_eapd_verbs },
6839 .num_dacs = ARRAY_SIZE(alc883_dac_nids), 6848 .num_dacs = ARRAY_SIZE(alc883_dac_nids),
6840 .dac_nids = alc883_dac_nids, 6849 .dac_nids = alc883_dac_nids,
6841 .dig_out_nid = ALC883_DIGOUT_NID, 6850 .dig_out_nid = ALC883_DIGOUT_NID,
@@ -6844,9 +6853,7 @@ static struct alc_config_preset alc883_presets[] = {
6844 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), 6853 .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
6845 .channel_mode = alc883_3ST_2ch_modes, 6854 .channel_mode = alc883_3ST_2ch_modes,
6846 .input_mux = &alc883_capture_source, 6855 .input_mux = &alc883_capture_source,
6847 .unsol_event = alc883_medion_md2_unsol_event, 6856 },
6848 .init_hook = alc883_medion_md2_automute,
6849 },
6850 [ALC883_MEDION] = { 6857 [ALC883_MEDION] = {
6851 .mixers = { alc883_fivestack_mixer, 6858 .mixers = { alc883_fivestack_mixer,
6852 alc883_chmode_mixer }, 6859 alc883_chmode_mixer },
@@ -8221,6 +8228,12 @@ static struct snd_kcontrol_new alc268_base_mixer[] = {
8221 { } 8228 { }
8222}; 8229};
8223 8230
8231static struct hda_verb alc268_eapd_verbs[] = {
8232 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
8233 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
8234 { }
8235};
8236
8224/* 8237/*
8225 * generic initialization of ADC, input mixers and output mixers 8238 * generic initialization of ADC, input mixers and output mixers
8226 */ 8239 */
@@ -8610,6 +8623,7 @@ static const char *alc268_models[ALC268_MODEL_LAST] = {
8610 8623
8611static struct snd_pci_quirk alc268_cfg_tbl[] = { 8624static struct snd_pci_quirk alc268_cfg_tbl[] = {
8612 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 8625 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
8626 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
8613 {} 8627 {}
8614}; 8628};
8615 8629
@@ -8627,6 +8641,18 @@ static struct alc_config_preset alc268_presets[] = {
8627 .channel_mode = alc268_modes, 8641 .channel_mode = alc268_modes,
8628 .input_mux = &alc268_capture_source, 8642 .input_mux = &alc268_capture_source,
8629 }, 8643 },
8644 [ALC268_TOSHIBA] = {
8645 .mixers = { alc268_base_mixer, alc268_capture_alt_mixer },
8646 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs },
8647 .num_dacs = ARRAY_SIZE(alc268_dac_nids),
8648 .dac_nids = alc268_dac_nids,
8649 .num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt),
8650 .adc_nids = alc268_adc_nids_alt,
8651 .hp_nid = 0x03,
8652 .num_channel_mode = ARRAY_SIZE(alc268_modes),
8653 .channel_mode = alc268_modes,
8654 .input_mux = &alc268_capture_source,
8655 },
8630}; 8656};
8631 8657
8632static int patch_alc268(struct hda_codec *codec) 8658static int patch_alc268(struct hda_codec *codec)
@@ -9916,6 +9942,14 @@ static struct hda_input_mux alc861vd_dallas_capture_source = {
9916 }, 9942 },
9917}; 9943};
9918 9944
9945static struct hda_input_mux alc861vd_hp_capture_source = {
9946 .num_items = 2,
9947 .items = {
9948 { "Front Mic", 0x0 },
9949 { "ATAPI Mic", 0x1 },
9950 },
9951};
9952
9919#define alc861vd_mux_enum_info alc_mux_enum_info 9953#define alc861vd_mux_enum_info alc_mux_enum_info
9920#define alc861vd_mux_enum_get alc_mux_enum_get 9954#define alc861vd_mux_enum_get alc_mux_enum_get
9921 9955
@@ -10117,6 +10151,22 @@ static struct snd_kcontrol_new alc861vd_dallas_mixer[] = {
10117 { } /* end */ 10151 { } /* end */
10118}; 10152};
10119 10153
10154/* Pin assignment: Speaker=0x14, Line-out = 0x15,
10155 * Front Mic=0x18, ATAPI Mic = 0x19,
10156 */
10157static struct snd_kcontrol_new alc861vd_hp_mixer[] = {
10158 HDA_CODEC_VOLUME("Front Playback Volume", 0x02, 0x0, HDA_OUTPUT),
10159 HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
10160 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
10161 HDA_BIND_MUTE("Headphone Playback Switch", 0x0d, 2, HDA_INPUT),
10162 HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
10163 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
10164 HDA_CODEC_VOLUME("ATAPI Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
10165 HDA_CODEC_MUTE("ATAPI Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
10166
10167 { } /* end */
10168};
10169
10120/* 10170/*
10121 * generic initialization of ADC, input mixers and output mixers 10171 * generic initialization of ADC, input mixers and output mixers
10122 */ 10172 */
@@ -10399,6 +10449,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = {
10399 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO), 10449 SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo", ALC861VD_LENOVO),
10400 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO), 10450 SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba A135", ALC861VD_LENOVO),
10401 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG), 10451 SND_PCI_QUIRK(0x1849, 0x0862, "ASRock K8NF6G-VSTA", ALC861VD_6ST_DIG),
10452 SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP),
10402 {} 10453 {}
10403}; 10454};
10404 10455
@@ -10488,7 +10539,21 @@ static struct alc_config_preset alc861vd_presets[] = {
10488 .input_mux = &alc861vd_dallas_capture_source, 10539 .input_mux = &alc861vd_dallas_capture_source,
10489 .unsol_event = alc861vd_dallas_unsol_event, 10540 .unsol_event = alc861vd_dallas_unsol_event,
10490 .init_hook = alc861vd_dallas_automute, 10541 .init_hook = alc861vd_dallas_automute,
10491 }, 10542 },
10543 [ALC861VD_HP] = {
10544 .mixers = { alc861vd_hp_mixer },
10545 .init_verbs = { alc861vd_dallas_verbs, alc861vd_eapd_verbs },
10546 .num_dacs = ARRAY_SIZE(alc861vd_dac_nids),
10547 .dac_nids = alc861vd_dac_nids,
10548 .num_adc_nids = ARRAY_SIZE(alc861vd_adc_nids),
10549 .dig_out_nid = ALC861VD_DIGOUT_NID,
10550 .adc_nids = alc861vd_adc_nids,
10551 .num_channel_mode = ARRAY_SIZE(alc861vd_3stack_2ch_modes),
10552 .channel_mode = alc861vd_3stack_2ch_modes,
10553 .input_mux = &alc861vd_hp_capture_source,
10554 .unsol_event = alc861vd_dallas_unsol_event,
10555 .init_hook = alc861vd_dallas_automute,
10556 },
10492}; 10557};
10493 10558
10494/* 10559/*
@@ -10849,7 +10914,7 @@ static int alc662_mux_enum_put(struct snd_kcontrol *kcontrol,
10849 struct alc_spec *spec = codec->spec; 10914 struct alc_spec *spec = codec->spec;
10850 const struct hda_input_mux *imux = spec->input_mux; 10915 const struct hda_input_mux *imux = spec->input_mux;
10851 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 10916 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
10852 static hda_nid_t capture_mixers[3] = { 0x24, 0x23, 0x22 }; 10917 static hda_nid_t capture_mixers[2] = { 0x23, 0x22 };
10853 hda_nid_t nid = capture_mixers[adc_idx]; 10918 hda_nid_t nid = capture_mixers[adc_idx];
10854 unsigned int *cur_val = &spec->cur_mux[adc_idx]; 10919 unsigned int *cur_val = &spec->cur_mux[adc_idx];
10855 unsigned int i, idx; 10920 unsigned int i, idx;
@@ -11173,11 +11238,7 @@ static struct hda_verb alc662_auto_init_verbs[] = {
11173 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */ 11238 /* Mixer elements: 0x18, 19, 1a, 1b, 1c, 1d, 14, 15, 16, 17, 0b */
11174 /* Input mixer */ 11239 /* Input mixer */
11175 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 11240 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11176 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 11241 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
11177 {0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(2)},
11178 /*{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3)},*/
11179 {0x23, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(4)},
11180
11181 { } 11242 { }
11182}; 11243};
11183 11244