aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-01-15 06:37:42 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:29:59 -0500
commit3866f0b0c2df3d179b2901d084670d3cf711b1da (patch)
tree200cb9dab403667f033e35f90ae4b13a58922a58 /sound/pci/hda/patch_realtek.c
parentf0747ee6c12d218c1ccfd90b5413034f043894bb (diff)
[ALSA] hda-codec - Add the support of Dell OEM laptops with ALC268
Added the support of Dell OEM laptops (Vostro 1200) with ALC268 codec. The new model=dell is provided. 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.c97
1 files changed, 76 insertions, 21 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 3b34bb677963..6f652afd3cbe 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -106,6 +106,7 @@ enum {
106 ALC268_3ST, 106 ALC268_3ST,
107 ALC268_TOSHIBA, 107 ALC268_TOSHIBA,
108 ALC268_ACER, 108 ALC268_ACER,
109 ALC268_DELL,
109#ifdef CONFIG_SND_DEBUG 110#ifdef CONFIG_SND_DEBUG
110 ALC268_TEST, 111 ALC268_TEST,
111#endif 112#endif
@@ -9424,6 +9425,49 @@ static void alc268_acer_init_hook(struct hda_codec *codec)
9424 alc268_acer_automute(codec, 1); 9425 alc268_acer_automute(codec, 1);
9425} 9426}
9426 9427
9428static struct snd_kcontrol_new alc268_dell_mixer[] = {
9429 /* output mixer control */
9430 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x02, 0x0, HDA_OUTPUT),
9431 HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT),
9432 HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
9433 HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
9434 HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
9435 HDA_CODEC_VOLUME("Internal Mic Boost", 0x19, 0, HDA_INPUT),
9436 { }
9437};
9438
9439static struct hda_verb alc268_dell_verbs[] = {
9440 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9441 {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
9442 {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
9443 { }
9444};
9445
9446/* mute/unmute internal speaker according to the hp jack and mute state */
9447static void alc268_dell_automute(struct hda_codec *codec)
9448{
9449 unsigned int present;
9450 unsigned int mute;
9451
9452 present = snd_hda_codec_read(codec, 0x15, 0, AC_VERB_GET_PIN_SENSE, 0);
9453 if (present & 0x80000000)
9454 mute = HDA_AMP_MUTE;
9455 else
9456 mute = snd_hda_codec_amp_read(codec, 0x15, 0, HDA_OUTPUT, 0);
9457 snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
9458 HDA_AMP_MUTE, mute);
9459}
9460
9461static void alc268_dell_unsol_event(struct hda_codec *codec,
9462 unsigned int res)
9463{
9464 if ((res >> 26) != ALC880_HP_EVENT)
9465 return;
9466 alc268_dell_automute(codec);
9467}
9468
9469#define alc268_dell_init_hook alc268_dell_automute
9470
9427/* 9471/*
9428 * generic initialization of ADC, input mixers and output mixers 9472 * generic initialization of ADC, input mixers and output mixers
9429 */ 9473 */
@@ -9842,6 +9886,7 @@ static const char *alc268_models[ALC268_MODEL_LAST] = {
9842 [ALC268_3ST] = "3stack", 9886 [ALC268_3ST] = "3stack",
9843 [ALC268_TOSHIBA] = "toshiba", 9887 [ALC268_TOSHIBA] = "toshiba",
9844 [ALC268_ACER] = "acer", 9888 [ALC268_ACER] = "acer",
9889 [ALC268_DELL] = "dell",
9845#ifdef CONFIG_SND_DEBUG 9890#ifdef CONFIG_SND_DEBUG
9846 [ALC268_TEST] = "test", 9891 [ALC268_TEST] = "test",
9847#endif 9892#endif
@@ -9851,6 +9896,7 @@ static const char *alc268_models[ALC268_MODEL_LAST] = {
9851static struct snd_pci_quirk alc268_cfg_tbl[] = { 9896static struct snd_pci_quirk alc268_cfg_tbl[] = {
9852 SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER), 9897 SND_PCI_QUIRK(0x1025, 0x0126, "Acer", ALC268_ACER),
9853 SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER), 9898 SND_PCI_QUIRK(0x1025, 0x0130, "Acer Extensa 5210", ALC268_ACER),
9899 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
9854 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA), 9900 SND_PCI_QUIRK(0x103c, 0x30cc, "TOSHIBA", ALC268_TOSHIBA),
9855 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 9901 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
9856 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA), 9902 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
@@ -9903,6 +9949,19 @@ static struct alc_config_preset alc268_presets[] = {
9903 .unsol_event = alc268_acer_unsol_event, 9949 .unsol_event = alc268_acer_unsol_event,
9904 .init_hook = alc268_acer_init_hook, 9950 .init_hook = alc268_acer_init_hook,
9905 }, 9951 },
9952 [ALC268_DELL] = {
9953 .mixers = { alc268_dell_mixer },
9954 .init_verbs = { alc268_base_init_verbs, alc268_eapd_verbs,
9955 alc268_dell_verbs },
9956 .num_dacs = ARRAY_SIZE(alc268_dac_nids),
9957 .dac_nids = alc268_dac_nids,
9958 .hp_nid = 0x02,
9959 .num_channel_mode = ARRAY_SIZE(alc268_modes),
9960 .channel_mode = alc268_modes,
9961 .unsol_event = alc268_dell_unsol_event,
9962 .init_hook = alc268_dell_init_hook,
9963 .input_mux = &alc268_capture_source,
9964 },
9906#ifdef CONFIG_SND_DEBUG 9965#ifdef CONFIG_SND_DEBUG
9907 [ALC268_TEST] = { 9966 [ALC268_TEST] = {
9908 .mixers = { alc268_test_mixer, alc268_capture_mixer }, 9967 .mixers = { alc268_test_mixer, alc268_capture_mixer },
@@ -9967,28 +10026,24 @@ static int patch_alc268(struct hda_codec *codec)
9967 spec->stream_name_digital = "ALC268 Digital"; 10026 spec->stream_name_digital = "ALC268 Digital";
9968 spec->stream_digital_playback = &alc268_pcm_digital_playback; 10027 spec->stream_digital_playback = &alc268_pcm_digital_playback;
9969 10028
9970 if (board_config == ALC268_AUTO) { 10029 if (!spec->adc_nids && spec->input_mux) {
9971 if (!spec->adc_nids && spec->input_mux) { 10030 /* check whether NID 0x07 is valid */
9972 /* check whether NID 0x07 is valid */ 10031 unsigned int wcap = get_wcaps(codec, 0x07);
9973 unsigned int wcap = get_wcaps(codec, 0x07); 10032
9974 10033 /* get type */
9975 /* get type */ 10034 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
9976 wcap = (wcap & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 10035 if (wcap != AC_WID_AUD_IN) {
9977 if (wcap != AC_WID_AUD_IN) { 10036 spec->adc_nids = alc268_adc_nids_alt;
9978 spec->adc_nids = alc268_adc_nids_alt; 10037 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids_alt);
9979 spec->num_adc_nids = 10038 spec->mixers[spec->num_mixers] =
9980 ARRAY_SIZE(alc268_adc_nids_alt);
9981 spec->mixers[spec->num_mixers] =
9982 alc268_capture_alt_mixer; 10039 alc268_capture_alt_mixer;
9983 spec->num_mixers++; 10040 spec->num_mixers++;
9984 } else { 10041 } else {
9985 spec->adc_nids = alc268_adc_nids; 10042 spec->adc_nids = alc268_adc_nids;
9986 spec->num_adc_nids = 10043 spec->num_adc_nids = ARRAY_SIZE(alc268_adc_nids);
9987 ARRAY_SIZE(alc268_adc_nids); 10044 spec->mixers[spec->num_mixers] =
9988 spec->mixers[spec->num_mixers] = 10045 alc268_capture_mixer;
9989 alc268_capture_mixer; 10046 spec->num_mixers++;
9990 spec->num_mixers++;
9991 }
9992 } 10047 }
9993 } 10048 }
9994 10049