aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com>2008-08-26 07:05:55 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-29 04:05:54 -0400
commit4e555fe5475437f5c05b9e1812959bf6d5cd50b9 (patch)
tree92f1c33668f8d473f9591f17b1ab4ff658e4d9ca /sound/pci/hda/patch_realtek.c
parent3f8783084aa03d04e7757ced337fa415744489a5 (diff)
ALSA: hda - Add support of Toshiba S06
Added the support of Toshiba S06 with ALC262 codec chip. Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c115
1 files changed, 115 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 834dae74d7ee..e558264d1f59 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -102,6 +102,7 @@ enum {
102 ALC262_ULTRA, 102 ALC262_ULTRA,
103 ALC262_LENOVO_3000, 103 ALC262_LENOVO_3000,
104 ALC262_NEC, 104 ALC262_NEC,
105 ALC262_TOSHIBA_S06,
105 ALC262_AUTO, 106 ALC262_AUTO,
106 ALC262_MODEL_LAST /* last tag */ 107 ALC262_MODEL_LAST /* last tag */
107}; 108};
@@ -8539,6 +8540,13 @@ static int patch_alc883(struct hda_codec *codec)
8539#define alc262_modes alc260_modes 8540#define alc262_modes alc260_modes
8540#define alc262_capture_source alc882_capture_source 8541#define alc262_capture_source alc882_capture_source
8541 8542
8543static hda_nid_t alc262_dmic_adc_nids[1] = {
8544 /* ADC0 */
8545 0x09
8546};
8547
8548static hda_nid_t alc262_dmic_capsrc_nids[1] = { 0x22 };
8549
8542static struct snd_kcontrol_new alc262_base_mixer[] = { 8550static struct snd_kcontrol_new alc262_base_mixer[] = {
8543 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), 8551 HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8544 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT), 8552 HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
@@ -8945,6 +8953,12 @@ static struct hda_verb alc262_init_verbs[] = {
8945 { } 8953 { }
8946}; 8954};
8947 8955
8956static struct hda_verb alc262_eapd_verbs[] = {
8957 {0x14, AC_VERB_SET_EAPD_BTLENABLE, 2},
8958 {0x15, AC_VERB_SET_EAPD_BTLENABLE, 2},
8959 { }
8960};
8961
8948static struct hda_verb alc262_hippo_unsol_verbs[] = { 8962static struct hda_verb alc262_hippo_unsol_verbs[] = {
8949 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, 8963 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
8950 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, 8964 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
@@ -8971,6 +8985,91 @@ static struct hda_verb alc262_sony_unsol_verbs[] = {
8971 {} 8985 {}
8972}; 8986};
8973 8987
8988static struct hda_input_mux alc262_dmic_capture_source = {
8989 .num_items = 2,
8990 .items = {
8991 { "Int DMic", 0x9 },
8992 { "Mic", 0x0 },
8993 },
8994};
8995
8996static struct snd_kcontrol_new alc262_toshiba_s06_mixer[] = {
8997 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
8998 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
8999 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
9000 HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
9001 HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
9002 HDA_CODEC_VOLUME("Capture Volume", 0x09, 0x0, HDA_INPUT),
9003 HDA_CODEC_MUTE("Capture Switch", 0x09, 0x0, HDA_INPUT),
9004 {
9005 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
9006 /* The multiple "Capture Source" controls confuse alsamixer
9007 * So call somewhat different..
9008 */
9009 /* .name = "Capture Source", */
9010 .name = "Input Source",
9011 .count = 1,
9012 .info = alc_mux_enum_info,
9013 .get = alc_mux_enum_get,
9014 .put = alc_mux_enum_put,
9015 },
9016 { } /* end */
9017};
9018
9019static struct hda_verb alc262_toshiba_s06_verbs[] = {
9020 {0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
9021 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
9022 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9023 {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
9024 {0x22, AC_VERB_SET_CONNECT_SEL, 0x09},
9025 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
9026 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT},
9027 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
9028 {}
9029};
9030
9031static void alc262_dmic_automute(struct hda_codec *codec)
9032{
9033 unsigned int present;
9034
9035 present = snd_hda_codec_read(codec, 0x18, 0,
9036 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
9037 snd_hda_codec_write(codec, 0x22, 0,
9038 AC_VERB_SET_CONNECT_SEL, present ? 0x0 : 0x09);
9039}
9040
9041/* toggle speaker-output according to the hp-jack state */
9042static void alc262_toshiba_s06_speaker_automute(struct hda_codec *codec)
9043{
9044 unsigned int present;
9045 unsigned char bits;
9046
9047 present = snd_hda_codec_read(codec, 0x15, 0,
9048 AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
9049 bits = present ? 0 : PIN_OUT;
9050 snd_hda_codec_write(codec, 0x14, 0,
9051 AC_VERB_SET_PIN_WIDGET_CONTROL, bits);
9052}
9053
9054
9055
9056/* unsolicited event for HP jack sensing */
9057static void alc262_toshiba_s06_unsol_event(struct hda_codec *codec,
9058 unsigned int res)
9059{
9060 if ((res >> 26) == ALC880_HP_EVENT)
9061 alc262_toshiba_s06_speaker_automute(codec);
9062 if ((res >> 26) == ALC880_MIC_EVENT)
9063 alc262_dmic_automute(codec);
9064
9065}
9066
9067static void alc262_toshiba_s06_init_hook(struct hda_codec *codec)
9068{
9069 alc262_toshiba_s06_speaker_automute(codec);
9070 alc262_dmic_automute(codec);
9071}
9072
8974/* mute/unmute internal speaker according to the hp jack and mute state */ 9073/* mute/unmute internal speaker according to the hp jack and mute state */
8975static void alc262_hippo_automute(struct hda_codec *codec) 9074static void alc262_hippo_automute(struct hda_codec *codec)
8976{ 9075{
@@ -9889,6 +9988,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
9889 SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD), 9988 SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD),
9890 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", 9989 SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
9891 ALC262_SONY_ASSAMD), 9990 ALC262_SONY_ASSAMD),
9991 SND_PCI_QUIRK(0x1179, 0x0268, "Toshiba S06", ALC262_TOSHIBA_S06),
9892 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU), 9992 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
9893 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU), 9993 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
9894 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA), 9994 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
@@ -10080,6 +10180,21 @@ static struct alc_config_preset alc262_presets[] = {
10080 .channel_mode = alc262_modes, 10180 .channel_mode = alc262_modes,
10081 .input_mux = &alc262_capture_source, 10181 .input_mux = &alc262_capture_source,
10082 }, 10182 },
10183 [ALC262_TOSHIBA_S06] = {
10184 .mixers = { alc262_toshiba_s06_mixer },
10185 .init_verbs = { alc262_init_verbs, alc262_toshiba_s06_verbs,
10186 alc262_eapd_verbs },
10187 .num_dacs = ARRAY_SIZE(alc262_dac_nids),
10188 .capsrc_nids = alc262_dmic_capsrc_nids,
10189 .dac_nids = alc262_dac_nids,
10190 .adc_nids = alc262_dmic_adc_nids, /* ADC0 */
10191 .dig_out_nid = ALC262_DIGOUT_NID,
10192 .num_channel_mode = ARRAY_SIZE(alc262_modes),
10193 .channel_mode = alc262_modes,
10194 .input_mux = &alc262_dmic_capture_source,
10195 .unsol_event = alc262_toshiba_s06_unsol_event,
10196 .init_hook = alc262_toshiba_s06_init_hook,
10197 },
10083}; 10198};
10084 10199
10085static int patch_alc262(struct hda_codec *codec) 10200static int patch_alc262(struct hda_codec *codec)