aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt1
-rw-r--r--sound/pci/hda/patch_realtek.c77
2 files changed, 76 insertions, 2 deletions
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
index 08f63ee53742..a16dd34817d2 100644
--- a/Documentation/sound/alsa/ALSA-Configuration.txt
+++ b/Documentation/sound/alsa/ALSA-Configuration.txt
@@ -826,6 +826,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
826 6stack-dig 6-jack with SPDIF I/O 826 6stack-dig 6-jack with SPDIF I/O
827 3stack-660 3-jack (for ALC660) 827 3stack-660 3-jack (for ALC660)
828 uniwill-m31 Uniwill M31 laptop 828 uniwill-m31 Uniwill M31 laptop
829 toshiba Toshiba laptop support
829 auto auto-config reading BIOS (default) 830 auto auto-config reading BIOS (default)
830 831
831 CMI9880 832 CMI9880
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
6212static 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
6210static struct snd_kcontrol_new alc861_uniwill_m31_mixer[] = { 6233static 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
6515static 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 */
6522static 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
6538static 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