diff options
author | Andy Shevchenko <andy@smile.org.ua> | 2007-12-13 11:32:26 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:33 -0500 |
commit | a8848bd6476102ff1d3bbe56662a18d6ada8674f (patch) | |
tree | 6882a1c049853bc549314a31ebbb676a36622554 | |
parent | f6a92248aef841f14a5806cc299c431e7809c733 (diff) |
[ALSA] hda-codec - Initial support of the Mitac 8252D (based on ALC883)
The attached patch adds initial support of the Mitac 8252D
(http://www.mitac-mtc.com.tw/English/products/8252Dspec.htm).
Working:
- Front speakers (volume + mute)
- Center/LFE speakers (volume + mute)
- HP out (with Front Volume)
- HP individual mute switch
- HP Jack sense
- Front Mic and its volume
Not tested:
- external mic and its volume
Not working while now:
- Mic Jack sense
Questionable:
- is Mic have Jack sense?
- one or two Mic volume controls?
- CD/Line-in: presense in the mixer
Signed-off-by: Andy Shevchenko <andy@smile.org.ua>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 107 |
2 files changed, 108 insertions, 0 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index 969ff8376333..aded3b4f0889 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -861,6 +861,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
861 | haier-w66 Haier W66 | 861 | haier-w66 Haier W66 |
862 | 6stack-hp HP machines with 6stack (Nettle boards) | 862 | 6stack-hp HP machines with 6stack (Nettle boards) |
863 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) | 863 | 3stack-hp HP machines with 3stack (Lucknow, Samba boards) |
864 | mitac Mitac 8252D | ||
864 | auto auto-config reading BIOS (default) | 865 | auto auto-config reading BIOS (default) |
865 | 866 | ||
866 | ALC861/660 | 867 | ALC861/660 |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index eba9be443857..cafdeb81d4f9 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -192,6 +192,7 @@ enum { | |||
192 | ALC883_HAIER_W66, | 192 | ALC883_HAIER_W66, |
193 | ALC888_6ST_HP, | 193 | ALC888_6ST_HP, |
194 | ALC888_3ST_HP, | 194 | ALC888_3ST_HP, |
195 | ALC883_MITAC, | ||
195 | ALC883_AUTO, | 196 | ALC883_AUTO, |
196 | ALC883_MODEL_LAST, | 197 | ALC883_MODEL_LAST, |
197 | }; | 198 | }; |
@@ -6349,6 +6350,36 @@ static struct snd_kcontrol_new alc883_base_mixer[] = { | |||
6349 | { } /* end */ | 6350 | { } /* end */ |
6350 | }; | 6351 | }; |
6351 | 6352 | ||
6353 | static struct snd_kcontrol_new alc883_mitac_mixer[] = { | ||
6354 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
6355 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | ||
6356 | HDA_CODEC_VOLUME_MONO("Center Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT), | ||
6357 | HDA_CODEC_VOLUME_MONO("LFE Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT), | ||
6358 | HDA_BIND_MUTE_MONO("Center Playback Switch", 0x0e, 1, 2, HDA_INPUT), | ||
6359 | HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x0e, 2, 2, HDA_INPUT), | ||
6360 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
6361 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), | ||
6362 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT), | ||
6363 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), | ||
6364 | HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), | ||
6365 | HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT), | ||
6366 | HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), | ||
6367 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
6368 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
6369 | HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x09, 0x0, HDA_INPUT), | ||
6370 | HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x09, 0x0, HDA_INPUT), | ||
6371 | { | ||
6372 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
6373 | /* .name = "Capture Source", */ | ||
6374 | .name = "Input Source", | ||
6375 | .count = 2, | ||
6376 | .info = alc883_mux_enum_info, | ||
6377 | .get = alc883_mux_enum_get, | ||
6378 | .put = alc883_mux_enum_put, | ||
6379 | }, | ||
6380 | { } /* end */ | ||
6381 | }; | ||
6382 | |||
6352 | static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = { | 6383 | static struct snd_kcontrol_new alc883_3ST_2ch_mixer[] = { |
6353 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | 6384 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), |
6354 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | 6385 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), |
@@ -6781,6 +6812,67 @@ static struct hda_verb alc883_init_verbs[] = { | |||
6781 | { } | 6812 | { } |
6782 | }; | 6813 | }; |
6783 | 6814 | ||
6815 | /* toggle speaker-output according to the hp-jack state */ | ||
6816 | static void alc883_mitac_hp_automute(struct hda_codec *codec) | ||
6817 | { | ||
6818 | unsigned int present; | ||
6819 | |||
6820 | present = snd_hda_codec_read(codec, 0x15, 0, | ||
6821 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
6822 | snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | ||
6823 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
6824 | snd_hda_codec_amp_stereo(codec, 0x17, HDA_OUTPUT, 0, | ||
6825 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
6826 | } | ||
6827 | |||
6828 | /* auto-toggle front mic */ | ||
6829 | /* | ||
6830 | static void alc883_mitac_mic_automute(struct hda_codec *codec) | ||
6831 | { | ||
6832 | unsigned int present; | ||
6833 | unsigned char bits; | ||
6834 | |||
6835 | present = snd_hda_codec_read(codec, 0x18, 0, | ||
6836 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
6837 | bits = present ? HDA_AMP_MUTE : 0; | ||
6838 | snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, 1, HDA_AMP_MUTE, bits); | ||
6839 | } | ||
6840 | */ | ||
6841 | |||
6842 | static void alc883_mitac_automute(struct hda_codec *codec) | ||
6843 | { | ||
6844 | alc883_mitac_hp_automute(codec); | ||
6845 | /* alc883_mitac_mic_automute(codec); */ | ||
6846 | } | ||
6847 | |||
6848 | static void alc883_mitac_unsol_event(struct hda_codec *codec, | ||
6849 | unsigned int res) | ||
6850 | { | ||
6851 | switch (res >> 26) { | ||
6852 | case ALC880_HP_EVENT: | ||
6853 | alc883_mitac_hp_automute(codec); | ||
6854 | break; | ||
6855 | case ALC880_MIC_EVENT: | ||
6856 | /* alc883_mitac_mic_automute(codec); */ | ||
6857 | break; | ||
6858 | } | ||
6859 | } | ||
6860 | |||
6861 | static struct hda_verb alc883_mitac_verbs[] = { | ||
6862 | /* HP */ | ||
6863 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
6864 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
6865 | /* Subwoofer */ | ||
6866 | {0x17, AC_VERB_SET_CONNECT_SEL, 0x02}, | ||
6867 | {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
6868 | |||
6869 | /* enable unsolicited event */ | ||
6870 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
6871 | /* {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_MIC_EVENT | AC_USRSP_EN}, */ | ||
6872 | |||
6873 | { } /* end */ | ||
6874 | }; | ||
6875 | |||
6784 | static struct hda_verb alc883_tagra_verbs[] = { | 6876 | static struct hda_verb alc883_tagra_verbs[] = { |
6785 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | 6877 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, |
6786 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | 6878 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, |
@@ -7163,6 +7255,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { | |||
7163 | [ALC883_HAIER_W66] = "haier-w66", | 7255 | [ALC883_HAIER_W66] = "haier-w66", |
7164 | [ALC888_6ST_HP] = "6stack-hp", | 7256 | [ALC888_6ST_HP] = "6stack-hp", |
7165 | [ALC888_3ST_HP] = "3stack-hp", | 7257 | [ALC888_3ST_HP] = "3stack-hp", |
7258 | [ALC883_MITAC] = "mitac", | ||
7166 | [ALC883_AUTO] = "auto", | 7259 | [ALC883_AUTO] = "auto", |
7167 | }; | 7260 | }; |
7168 | 7261 | ||
@@ -7198,6 +7291,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = { | |||
7198 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), | 7291 | SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), |
7199 | SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch), | 7292 | SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch), |
7200 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), | 7293 | SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION), |
7294 | SND_PCI_QUIRK(0x1071, 0x8253, "Mitac 8252d", ALC883_MITAC), | ||
7201 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), | 7295 | SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), |
7202 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), | 7296 | SND_PCI_QUIRK(0x8086, 0xd601, "D102GGC", ALC883_3ST_6ch), |
7203 | SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), | 7297 | SND_PCI_QUIRK(0x17aa, 0x101e, "Lenovo 101e", ALC883_LENOVO_101E_2ch), |
@@ -7445,6 +7539,19 @@ static struct alc_config_preset alc883_presets[] = { | |||
7445 | .need_dac_fix = 1, | 7539 | .need_dac_fix = 1, |
7446 | .input_mux = &alc883_capture_source, | 7540 | .input_mux = &alc883_capture_source, |
7447 | }, | 7541 | }, |
7542 | [ALC883_MITAC] = { | ||
7543 | .mixers = { alc883_mitac_mixer }, | ||
7544 | .init_verbs = { alc883_init_verbs, alc883_mitac_verbs }, | ||
7545 | .num_dacs = ARRAY_SIZE(alc883_dac_nids), | ||
7546 | .dac_nids = alc883_dac_nids, | ||
7547 | .num_adc_nids = ARRAY_SIZE(alc883_adc_nids), | ||
7548 | .adc_nids = alc883_adc_nids, | ||
7549 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), | ||
7550 | .channel_mode = alc883_3ST_2ch_modes, | ||
7551 | .input_mux = &alc883_capture_source, | ||
7552 | .unsol_event = alc883_mitac_unsol_event, | ||
7553 | .init_hook = alc883_mitac_automute, | ||
7554 | }, | ||
7448 | }; | 7555 | }; |
7449 | 7556 | ||
7450 | 7557 | ||