diff options
author | Tobin Davis <tdavis@dsl-only.net> | 2006-10-17 06:00:28 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:01:01 -0500 |
commit | a53d1aece388d940831846f642810e47526883e8 (patch) | |
tree | f7bbd213d7272aca0b5279ab394ccbdf4ecd744b /sound/pci/hda/patch_realtek.c | |
parent | 12e74f7d430655f541b85018ea62bcd669094bd7 (diff) |
[ALSA] hda-codec - Add toshiba model to ALC861 codec
This patch adds support for Toshiba laptops. Code is from
RealTek's alsa-driver-1.0.12-4.05b tree.
Signed-off-by: Tobin Davis <tdavis@dsl-only.net>
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.c | 77 |
1 files changed, 75 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1420db43423a..62c75388457e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -91,6 +91,7 @@ enum { | |||
91 | ALC861_3ST_DIG, | 91 | ALC861_3ST_DIG, |
92 | ALC861_6ST_DIG, | 92 | ALC861_6ST_DIG, |
93 | ALC861_UNIWILL_M31, | 93 | ALC861_UNIWILL_M31, |
94 | ALC861_TOSHIBA, | ||
94 | ALC861_AUTO, | 95 | ALC861_AUTO, |
95 | ALC861_MODEL_LAST, | 96 | ALC861_MODEL_LAST, |
96 | }; | 97 | }; |
@@ -6206,7 +6207,29 @@ static struct snd_kcontrol_new alc861_3ST_mixer[] = { | |||
6206 | .private_value = ARRAY_SIZE(alc861_threestack_modes), | 6207 | .private_value = ARRAY_SIZE(alc861_threestack_modes), |
6207 | }, | 6208 | }, |
6208 | { } /* end */ | 6209 | { } /* end */ |
6209 | }; | 6210 | }; |
6211 | |||
6212 | static snd_kcontrol_new_t alc861_toshiba_mixer[] = { | ||
6213 | /* output mixer control */ | ||
6214 | HDA_CODEC_MUTE("Master Playback Switch", 0x03, 0x0, HDA_OUTPUT), | ||
6215 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x15, 0x01, HDA_INPUT), | ||
6216 | HDA_CODEC_MUTE("Mic Playback Switch", 0x15, 0x01, HDA_INPUT), | ||
6217 | |||
6218 | /*Capture mixer control */ | ||
6219 | HDA_CODEC_VOLUME("Capture Volume", 0x08, 0x0, HDA_INPUT), | ||
6220 | HDA_CODEC_MUTE("Capture Switch", 0x08, 0x0, HDA_INPUT), | ||
6221 | { | ||
6222 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
6223 | .name = "Capture Source", | ||
6224 | .count = 1, | ||
6225 | .info = alc_mux_enum_info, | ||
6226 | .get = alc_mux_enum_get, | ||
6227 | .put = alc_mux_enum_put, | ||
6228 | }, | ||
6229 | |||
6230 | { } /* end */ | ||
6231 | }; | ||
6232 | |||
6210 | static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = { | 6233 | static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = { |
6211 | /* output mixer control */ | 6234 | /* output mixer control */ |
6212 | HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT), | 6235 | HDA_CODEC_MUTE("Front Playback Switch", 0x03, 0x0, HDA_OUTPUT), |
@@ -6489,6 +6512,39 @@ static struct hda_verb alc861_auto_init_verbs[] = { | |||
6489 | { } | 6512 | { } |
6490 | }; | 6513 | }; |
6491 | 6514 | ||
6515 | static struct hda_verb alc861_toshiba_init_verbs[] = { | ||
6516 | {0x0f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, | ||
6517 | |||
6518 | { } | ||
6519 | }; | ||
6520 | |||
6521 | /* toggle speaker-output according to the hp-jack state */ | ||
6522 | static void alc861_toshiba_automute(struct hda_codec *codec) | ||
6523 | { | ||
6524 | unsigned int present; | ||
6525 | |||
6526 | present = snd_hda_codec_read(codec, 0x0f, 0, | ||
6527 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
6528 | snd_hda_codec_amp_update(codec, 0x16, 0, HDA_INPUT, 0, | ||
6529 | 0x80, present ? 0x80 : 0); | ||
6530 | snd_hda_codec_amp_update(codec, 0x16, 1, HDA_INPUT, 0, | ||
6531 | 0x80, present ? 0x80 : 0); | ||
6532 | snd_hda_codec_amp_update(codec, 0x1a, 0, HDA_INPUT, 3, | ||
6533 | 0x80, present ? 0 : 0x80); | ||
6534 | snd_hda_codec_amp_update(codec, 0x1a, 1, HDA_INPUT, 3, | ||
6535 | 0x80, present ? 0 : 0x80); | ||
6536 | } | ||
6537 | |||
6538 | static void alc861_toshiba_unsol_event(struct hda_codec *codec, | ||
6539 | unsigned int res) | ||
6540 | { | ||
6541 | /* Looks like the unsol event is incompatible with the standard | ||
6542 | * definition. 6bit tag is placed at 26 bit! | ||
6543 | */ | ||
6544 | if ((res >> 26) == ALC880_HP_EVENT) | ||
6545 | alc861_toshiba_automute(codec); | ||
6546 | } | ||
6547 | |||
6492 | /* pcm configuration: identiacal with ALC880 */ | 6548 | /* pcm configuration: identiacal with ALC880 */ |
6493 | #define alc861_pcm_analog_playback alc880_pcm_analog_playback | 6549 | #define alc861_pcm_analog_playback alc880_pcm_analog_playback |
6494 | #define alc861_pcm_analog_capture alc880_pcm_analog_capture | 6550 | #define alc861_pcm_analog_capture alc880_pcm_analog_capture |
@@ -6774,6 +6830,11 @@ static struct hda_board_config alc861_cfg_tbl[] = { | |||
6774 | { .modelname = "uniwill-m31", .config = ALC861_UNIWILL_M31}, | 6830 | { .modelname = "uniwill-m31", .config = ALC861_UNIWILL_M31}, |
6775 | { .pci_subvendor = 0x1584, .pci_subdevice = 0x9072, | 6831 | { .pci_subvendor = 0x1584, .pci_subdevice = 0x9072, |
6776 | .config = ALC861_UNIWILL_M31 }, | 6832 | .config = ALC861_UNIWILL_M31 }, |
6833 | { .modelname = "toshiba", .config = ALC861_TOSHIBA }, | ||
6834 | { .pci_subvendor = 0x1043, .pci_subdevice = 0x1338, | ||
6835 | .config = ALC861_TOSHIBA }, | ||
6836 | { .pci_subvendor = 0x1179, .pci_subdevice = 0xff10, | ||
6837 | .config = ALC861_TOSHIBA }, | ||
6777 | { .modelname = "auto", .config = ALC861_AUTO }, | 6838 | { .modelname = "auto", .config = ALC861_AUTO }, |
6778 | {} | 6839 | {} |
6779 | }; | 6840 | }; |
@@ -6841,7 +6902,19 @@ static struct alc_config_preset alc861_presets[] = { | |||
6841 | .adc_nids = alc861_adc_nids, | 6902 | .adc_nids = alc861_adc_nids, |
6842 | .input_mux = &alc861_capture_source, | 6903 | .input_mux = &alc861_capture_source, |
6843 | }, | 6904 | }, |
6844 | 6905 | [ALC861_TOSHIBA] = { | |
6906 | .mixers = { alc861_toshiba_mixer }, | ||
6907 | .init_verbs = { alc861_base_init_verbs, alc861_toshiba_init_verbs }, | ||
6908 | .num_dacs = ARRAY_SIZE(alc861_dac_nids), | ||
6909 | .dac_nids = alc861_dac_nids, | ||
6910 | .num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes), | ||
6911 | .channel_mode = alc883_3ST_2ch_modes, | ||
6912 | .num_adc_nids = ARRAY_SIZE(alc861_adc_nids), | ||
6913 | .adc_nids = alc861_adc_nids, | ||
6914 | .input_mux = &alc861_capture_source, | ||
6915 | .unsol_event = alc861_toshiba_unsol_event, | ||
6916 | .init_hook = alc861_toshiba_automute, | ||
6917 | }, | ||
6845 | }; | 6918 | }; |
6846 | 6919 | ||
6847 | 6920 | ||