diff options
author | Kacper Szczesniak <kacper@qwe.pl> | 2009-06-01 18:55:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-01 18:55:19 -0400 |
commit | 92b9de8342c6ad0d930333851190ed25b88b190c (patch) | |
tree | 3bc56775c16f5d1fd28e28420fee689b5f945471 | |
parent | 0e4835c198e7dd9d814de25a17a1d6682107c394 (diff) |
ALSA: hda - Macbook[Pro] 5 6ch support
this is a patch against current snapshot that adds:
6 channels support for the MB5 model
Signed-off-by: Kacper Szczesniak <kacper@qwe.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 80 |
1 files changed, 65 insertions, 15 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d0786e9c3310..12d6015e07fc 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -6266,6 +6266,34 @@ static struct hda_channel_mode alc885_mbp_6ch_modes[2] = { | |||
6266 | { 6, alc885_mbp_ch6_init }, | 6266 | { 6, alc885_mbp_ch6_init }, |
6267 | }; | 6267 | }; |
6268 | 6268 | ||
6269 | /* | ||
6270 | * 2ch | ||
6271 | * Speakers/Woofer/HP = Front | ||
6272 | * LineIn = Input | ||
6273 | */ | ||
6274 | static struct hda_verb alc885_mb5_ch2_init[] = { | ||
6275 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
6276 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
6277 | { } /* end */ | ||
6278 | }; | ||
6279 | |||
6280 | /* | ||
6281 | * 6ch mode | ||
6282 | * Speakers/HP = Front | ||
6283 | * Woofer = LFE | ||
6284 | * LineIn = Surround | ||
6285 | */ | ||
6286 | static struct hda_verb alc885_mb5_ch6_init[] = { | ||
6287 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
6288 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6289 | {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
6290 | { } /* end */ | ||
6291 | }; | ||
6292 | |||
6293 | static struct hda_channel_mode alc885_mb5_6ch_modes[2] = { | ||
6294 | { 2, alc885_mb5_ch2_init }, | ||
6295 | { 6, alc885_mb5_ch6_init }, | ||
6296 | }; | ||
6269 | 6297 | ||
6270 | /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17 | 6298 | /* Pin assignment: Front=0x14, Rear=0x15, CLFE=0x16, Side=0x17 |
6271 | * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b | 6299 | * Mic=0x18, Front Mic=0x19, Line-In=0x1a, HP=0x1b |
@@ -6310,10 +6338,14 @@ static struct snd_kcontrol_new alc885_mbp3_mixer[] = { | |||
6310 | }; | 6338 | }; |
6311 | 6339 | ||
6312 | static struct snd_kcontrol_new alc885_mb5_mixer[] = { | 6340 | static struct snd_kcontrol_new alc885_mb5_mixer[] = { |
6313 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0d, 0x00, HDA_OUTPUT), | 6341 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x00, HDA_OUTPUT), |
6314 | HDA_BIND_MUTE ("Front Playback Switch", 0x0d, 0x02, HDA_INPUT), | 6342 | HDA_BIND_MUTE ("Front Playback Switch", 0x0c, 0x02, HDA_INPUT), |
6315 | HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0c, 0x00, HDA_OUTPUT), | 6343 | HDA_CODEC_VOLUME("Surround Playback Volume", 0x0d, 0x00, HDA_OUTPUT), |
6316 | HDA_BIND_MUTE ("Line-Out Playback Switch", 0x0c, 0x02, HDA_INPUT), | 6344 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), |
6345 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), | ||
6346 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), | ||
6347 | HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT), | ||
6348 | HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT), | ||
6317 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | 6349 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), |
6318 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | 6350 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), |
6319 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | 6351 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), |
@@ -6322,6 +6354,7 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = { | |||
6322 | HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT), | 6354 | HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT), |
6323 | { } /* end */ | 6355 | { } /* end */ |
6324 | }; | 6356 | }; |
6357 | |||
6325 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { | 6358 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { |
6326 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | 6359 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), |
6327 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | 6360 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), |
@@ -6551,22 +6584,39 @@ static struct hda_verb alc882_macpro_init_verbs[] = { | |||
6551 | 6584 | ||
6552 | /* Macbook 5,1 */ | 6585 | /* Macbook 5,1 */ |
6553 | static struct hda_verb alc885_mb5_init_verbs[] = { | 6586 | static struct hda_verb alc885_mb5_init_verbs[] = { |
6587 | /* DACs */ | ||
6588 | {0x02, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6589 | {0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6590 | {0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6591 | {0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6554 | /* Front mixer */ | 6592 | /* Front mixer */ |
6555 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6556 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6557 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6558 | /* LineOut mixer */ | ||
6559 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 6593 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
6560 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | 6594 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, |
6561 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | 6595 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, |
6562 | /* Front Pin: output 0 (0x0d) */ | 6596 | /* Surround mixer */ |
6597 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6598 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6599 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6600 | /* LFE mixer */ | ||
6601 | {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6602 | {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6603 | {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6604 | /* HP mixer */ | ||
6605 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6606 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6607 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6608 | /* Front Pin (0x0c) */ | ||
6563 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, | 6609 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, |
6564 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 6610 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
6565 | {0x18, AC_VERB_SET_CONNECT_SEL, 0x01}, | 6611 | {0x18, AC_VERB_SET_CONNECT_SEL, 0x00}, |
6566 | /* HP Pin: output 0 (0x0c) */ | 6612 | /* LFE Pin (0x0e) */ |
6613 | {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, | ||
6614 | {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6615 | {0x1a, AC_VERB_SET_CONNECT_SEL, 0x02}, | ||
6616 | /* HP Pin (0x0f) */ | ||
6567 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 6617 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
6568 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 6618 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
6569 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, | 6619 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, |
6570 | /* Front Mic pin: input vref at 80% */ | 6620 | /* Front Mic pin: input vref at 80% */ |
6571 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 6621 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
6572 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 6622 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
@@ -6986,13 +7036,13 @@ static struct alc_config_preset alc882_presets[] = { | |||
6986 | .init_hook = alc885_mbp3_init_hook, | 7036 | .init_hook = alc885_mbp3_init_hook, |
6987 | }, | 7037 | }, |
6988 | [ALC885_MB5] = { | 7038 | [ALC885_MB5] = { |
6989 | .mixers = { alc885_mb5_mixer }, | 7039 | .mixers = { alc885_mb5_mixer, alc882_chmode_mixer }, |
6990 | .init_verbs = { alc885_mb5_init_verbs, | 7040 | .init_verbs = { alc885_mb5_init_verbs, |
6991 | alc880_gpio1_init_verbs }, | 7041 | alc880_gpio1_init_verbs }, |
6992 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), | 7042 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), |
6993 | .dac_nids = alc882_dac_nids, | 7043 | .dac_nids = alc882_dac_nids, |
6994 | .channel_mode = alc885_mbp_6ch_modes, | 7044 | .channel_mode = alc885_mb5_6ch_modes, |
6995 | .num_channel_mode = ARRAY_SIZE(alc885_mbp_6ch_modes), | 7045 | .num_channel_mode = ARRAY_SIZE(alc885_mb5_6ch_modes), |
6996 | .input_mux = &mb5_capture_source, | 7046 | .input_mux = &mb5_capture_source, |
6997 | .dig_out_nid = ALC882_DIGOUT_NID, | 7047 | .dig_out_nid = ALC882_DIGOUT_NID, |
6998 | .dig_in_nid = ALC882_DIGIN_NID, | 7048 | .dig_in_nid = ALC882_DIGIN_NID, |