diff options
author | Tobin Davis <tdavis@dsl-only.net> | 2007-10-26 06:40:47 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:10 -0500 |
commit | f651b50b9d1ab44f7b09d1ef28ba702903732fd3 (patch) | |
tree | 9ee825c5238db44f7e513ebc3c45442762411d54 /sound/pci | |
parent | 9674513d60e7f3bdde1e4739ed81b2daaee74df7 (diff) |
[ALSA] HDA: Add support for Samsung Q1 Ultra Vista edition
This patch adds full record and playback support for the Samsung Q1
Ultra - Vista model (different codec than the earlier Q1 Ultra models).
Signed-off-by: Tobin Davis <tdavis@dsl-only.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b78f6fcc27a0..8de41c370c3e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -95,6 +95,7 @@ enum { | |||
95 | ALC262_BENQ_ED8, | 95 | ALC262_BENQ_ED8, |
96 | ALC262_SONY_ASSAMD, | 96 | ALC262_SONY_ASSAMD, |
97 | ALC262_BENQ_T31, | 97 | ALC262_BENQ_T31, |
98 | ALC262_ULTRA, | ||
98 | ALC262_AUTO, | 99 | ALC262_AUTO, |
99 | ALC262_MODEL_LAST /* last tag */ | 100 | ALC262_MODEL_LAST /* last tag */ |
100 | }; | 101 | }; |
@@ -8082,6 +8083,72 @@ static struct hda_verb alc262_benq_t31_EAPD_verbs[] = { | |||
8082 | {} | 8083 | {} |
8083 | }; | 8084 | }; |
8084 | 8085 | ||
8086 | /* Samsung Q1 Ultra Vista model setup */ | ||
8087 | static struct snd_kcontrol_new alc262_ultra_mixer[] = { | ||
8088 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | ||
8089 | HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), | ||
8090 | HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), | ||
8091 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | ||
8092 | HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), | ||
8093 | HDA_CODEC_VOLUME("Mic Boost", 0x19, 0, HDA_INPUT), | ||
8094 | { } /* end */ | ||
8095 | }; | ||
8096 | |||
8097 | static struct hda_verb alc262_ultra_verbs[] = { | ||
8098 | {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
8099 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | ||
8100 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40}, | ||
8101 | /* Mic is on Node 0x19 */ | ||
8102 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, | ||
8103 | {0x22, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
8104 | {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, | ||
8105 | {0x23, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
8106 | {0x23, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, | ||
8107 | {0x24, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
8108 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, | ||
8109 | {} | ||
8110 | }; | ||
8111 | |||
8112 | static struct hda_input_mux alc262_ultra_capture_source = { | ||
8113 | .num_items = 1, | ||
8114 | .items = { | ||
8115 | { "Mic", 0x1 }, | ||
8116 | }, | ||
8117 | }; | ||
8118 | |||
8119 | /* mute/unmute internal speaker according to the hp jack and mute state */ | ||
8120 | static void alc262_ultra_automute(struct hda_codec *codec) | ||
8121 | { | ||
8122 | struct alc_spec *spec = codec->spec; | ||
8123 | unsigned int mute; | ||
8124 | unsigned int present; | ||
8125 | |||
8126 | /* need to execute and sync at first */ | ||
8127 | snd_hda_codec_read(codec, 0x15, 0, AC_VERB_SET_PIN_SENSE, 0); | ||
8128 | present = snd_hda_codec_read(codec, 0x15, 0, | ||
8129 | AC_VERB_GET_PIN_SENSE, 0); | ||
8130 | spec->jack_present = (present & 0x80000000) != 0; | ||
8131 | if (spec->jack_present) { | ||
8132 | /* mute internal speaker */ | ||
8133 | snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | ||
8134 | HDA_AMP_MUTE, HDA_AMP_MUTE); | ||
8135 | } else { | ||
8136 | /* unmute internal speaker if necessary */ | ||
8137 | mute = snd_hda_codec_amp_read(codec, 0x15, 0, HDA_OUTPUT, 0); | ||
8138 | snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, | ||
8139 | HDA_AMP_MUTE, mute); | ||
8140 | } | ||
8141 | } | ||
8142 | |||
8143 | /* unsolicited event for HP jack sensing */ | ||
8144 | static void alc262_ultra_unsol_event(struct hda_codec *codec, | ||
8145 | unsigned int res) | ||
8146 | { | ||
8147 | if ((res >> 26) != ALC880_HP_EVENT) | ||
8148 | return; | ||
8149 | alc262_ultra_automute(codec); | ||
8150 | } | ||
8151 | |||
8085 | /* add playback controls from the parsed DAC table */ | 8152 | /* add playback controls from the parsed DAC table */ |
8086 | static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, | 8153 | static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, |
8087 | const struct auto_pin_cfg *cfg) | 8154 | const struct auto_pin_cfg *cfg) |
@@ -8487,6 +8554,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = { | |||
8487 | [ALC262_BENQ_ED8] = "benq", | 8554 | [ALC262_BENQ_ED8] = "benq", |
8488 | [ALC262_BENQ_T31] = "benq-t31", | 8555 | [ALC262_BENQ_T31] = "benq-t31", |
8489 | [ALC262_SONY_ASSAMD] = "sony-assamd", | 8556 | [ALC262_SONY_ASSAMD] = "sony-assamd", |
8557 | [ALC262_ULTRA] = "ultra", | ||
8490 | [ALC262_AUTO] = "auto", | 8558 | [ALC262_AUTO] = "auto", |
8491 | }; | 8559 | }; |
8492 | 8560 | ||
@@ -8517,6 +8585,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
8517 | SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), | 8585 | SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), |
8518 | SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), | 8586 | SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD), |
8519 | SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), | 8587 | SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), |
8588 | SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), | ||
8520 | {} | 8589 | {} |
8521 | }; | 8590 | }; |
8522 | 8591 | ||
@@ -8635,6 +8704,19 @@ static struct alc_config_preset alc262_presets[] = { | |||
8635 | .unsol_event = alc262_hippo_unsol_event, | 8704 | .unsol_event = alc262_hippo_unsol_event, |
8636 | .init_hook = alc262_hippo_automute, | 8705 | .init_hook = alc262_hippo_automute, |
8637 | }, | 8706 | }, |
8707 | [ALC262_ULTRA] = { | ||
8708 | .mixers = { alc262_ultra_mixer }, | ||
8709 | .init_verbs = { alc262_init_verbs, alc262_ultra_verbs }, | ||
8710 | .num_dacs = ARRAY_SIZE(alc262_dac_nids), | ||
8711 | .dac_nids = alc262_dac_nids, | ||
8712 | .hp_nid = 0x03, | ||
8713 | .dig_out_nid = ALC262_DIGOUT_NID, | ||
8714 | .num_channel_mode = ARRAY_SIZE(alc262_modes), | ||
8715 | .channel_mode = alc262_modes, | ||
8716 | .input_mux = &alc262_ultra_capture_source, | ||
8717 | .unsol_event = alc262_ultra_unsol_event, | ||
8718 | .init_hook = alc262_ultra_automute, | ||
8719 | }, | ||
8638 | }; | 8720 | }; |
8639 | 8721 | ||
8640 | static int patch_alc262(struct hda_codec *codec) | 8722 | static int patch_alc262(struct hda_codec *codec) |