diff options
author | Kacper Szczesniak <kacper@qwe.pl> | 2009-05-07 06:47:43 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-07 06:52:59 -0400 |
commit | 41d5545d23d2ccf4d34725094dccebd37f15c1c4 (patch) | |
tree | d3bd675c2b785d5797989a1f737a12e8319e5581 /sound/pci/hda/patch_realtek.c | |
parent | 514bf54cd8c7f172816d3c003a6d022e9165a29b (diff) |
ALSA: hda - Add support for MacBook 5.1 (Aluminium)
Signed-off-by: Kacper Szczesniak <kacper@qwe.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3e7207b927c8..b9495342c921 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -205,6 +205,7 @@ enum { | |||
205 | ALC882_ASUS_A7M, | 205 | ALC882_ASUS_A7M, |
206 | ALC885_MACPRO, | 206 | ALC885_MACPRO, |
207 | ALC885_MBP3, | 207 | ALC885_MBP3, |
208 | ALC885_MB5, | ||
208 | ALC885_IMAC24, | 209 | ALC885_IMAC24, |
209 | ALC882_AUTO, | 210 | ALC882_AUTO, |
210 | ALC882_MODEL_LAST, | 211 | ALC882_MODEL_LAST, |
@@ -6164,6 +6165,16 @@ static struct hda_input_mux alc882_capture_source = { | |||
6164 | { "CD", 0x4 }, | 6165 | { "CD", 0x4 }, |
6165 | }, | 6166 | }, |
6166 | }; | 6167 | }; |
6168 | |||
6169 | static struct hda_input_mux mb5_capture_source = { | ||
6170 | .num_items = 3, | ||
6171 | .items = { | ||
6172 | { "Mic", 0x1 }, | ||
6173 | { "Line", 0x2 }, | ||
6174 | { "CD", 0x4 }, | ||
6175 | }, | ||
6176 | }; | ||
6177 | |||
6167 | /* | 6178 | /* |
6168 | * 2ch mode | 6179 | * 2ch mode |
6169 | */ | 6180 | */ |
@@ -6293,6 +6304,20 @@ static struct snd_kcontrol_new alc885_mbp3_mixer[] = { | |||
6293 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT), | 6304 | HDA_CODEC_VOLUME("Mic Boost", 0x18, 0x00, HDA_INPUT), |
6294 | { } /* end */ | 6305 | { } /* end */ |
6295 | }; | 6306 | }; |
6307 | |||
6308 | static struct snd_kcontrol_new alc885_mb5_mixer[] = { | ||
6309 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0d, 0x00, HDA_OUTPUT), | ||
6310 | HDA_BIND_MUTE ("Front Playback Switch", 0x0d, 0x02, HDA_INPUT), | ||
6311 | HDA_CODEC_VOLUME("Line-Out Playback Volume", 0x0c, 0x00, HDA_OUTPUT), | ||
6312 | HDA_BIND_MUTE ("Line-Out Playback Switch", 0x0c, 0x02, HDA_INPUT), | ||
6313 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | ||
6314 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | ||
6315 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | ||
6316 | HDA_CODEC_MUTE ("Mic Playback Switch", 0x0b, 0x01, HDA_INPUT), | ||
6317 | HDA_CODEC_VOLUME("Line Boost", 0x15, 0x00, HDA_INPUT), | ||
6318 | HDA_CODEC_VOLUME("Mic Boost", 0x19, 0x00, HDA_INPUT), | ||
6319 | { } /* end */ | ||
6320 | }; | ||
6296 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { | 6321 | static struct snd_kcontrol_new alc882_w2jc_mixer[] = { |
6297 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), | 6322 | HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT), |
6298 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), | 6323 | HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT), |
@@ -6520,6 +6545,38 @@ static struct hda_verb alc882_macpro_init_verbs[] = { | |||
6520 | { } | 6545 | { } |
6521 | }; | 6546 | }; |
6522 | 6547 | ||
6548 | /* Macbook 5,1 */ | ||
6549 | static struct hda_verb alc885_mb5_init_verbs[] = { | ||
6550 | /* Front mixer */ | ||
6551 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6552 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6553 | {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6554 | /* LineOut mixer */ | ||
6555 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | ||
6556 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, | ||
6557 | {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, | ||
6558 | /* Front Pin: output 0 (0x0d) */ | ||
6559 | {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT | 0x01}, | ||
6560 | {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6561 | {0x18, AC_VERB_SET_CONNECT_SEL, 0x01}, | ||
6562 | /* HP Pin: output 0 (0x0c) */ | ||
6563 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | ||
6564 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | ||
6565 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x00}, | ||
6566 | /* Front Mic pin: input vref at 80% */ | ||
6567 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | ||
6568 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
6569 | /* Line In pin */ | ||
6570 | {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN}, | ||
6571 | {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | ||
6572 | |||
6573 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
6574 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, | ||
6575 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, | ||
6576 | {0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | ||
6577 | { } | ||
6578 | }; | ||
6579 | |||
6523 | /* Macbook Pro rev3 */ | 6580 | /* Macbook Pro rev3 */ |
6524 | static struct hda_verb alc885_mbp3_init_verbs[] = { | 6581 | static struct hda_verb alc885_mbp3_init_verbs[] = { |
6525 | /* Front mixer: unmute input/output amp left and right (volume = 0) */ | 6582 | /* Front mixer: unmute input/output amp left and right (volume = 0) */ |
@@ -6864,6 +6921,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = { | |||
6864 | [ALC882_ASUS_A7J] = "asus-a7j", | 6921 | [ALC882_ASUS_A7J] = "asus-a7j", |
6865 | [ALC882_ASUS_A7M] = "asus-a7m", | 6922 | [ALC882_ASUS_A7M] = "asus-a7m", |
6866 | [ALC885_MACPRO] = "macpro", | 6923 | [ALC885_MACPRO] = "macpro", |
6924 | [ALC885_MB5] = "mb5", | ||
6867 | [ALC885_MBP3] = "mbp3", | 6925 | [ALC885_MBP3] = "mbp3", |
6868 | [ALC885_IMAC24] = "imac24", | 6926 | [ALC885_IMAC24] = "imac24", |
6869 | [ALC882_AUTO] = "auto", | 6927 | [ALC882_AUTO] = "auto", |
@@ -6944,6 +7002,18 @@ static struct alc_config_preset alc882_presets[] = { | |||
6944 | .unsol_event = alc885_mbp3_unsol_event, | 7002 | .unsol_event = alc885_mbp3_unsol_event, |
6945 | .init_hook = alc885_mbp3_automute, | 7003 | .init_hook = alc885_mbp3_automute, |
6946 | }, | 7004 | }, |
7005 | [ALC885_MB5] = { | ||
7006 | .mixers = { alc885_mb5_mixer }, | ||
7007 | .init_verbs = { alc885_mb5_init_verbs, | ||
7008 | alc880_gpio1_init_verbs }, | ||
7009 | .num_dacs = ARRAY_SIZE(alc882_dac_nids), | ||
7010 | .dac_nids = alc882_dac_nids, | ||
7011 | .channel_mode = alc885_mbp_6ch_modes, | ||
7012 | .num_channel_mode = ARRAY_SIZE(alc885_mbp_6ch_modes), | ||
7013 | .input_mux = &mb5_capture_source, | ||
7014 | .dig_out_nid = ALC882_DIGOUT_NID, | ||
7015 | .dig_in_nid = ALC882_DIGIN_NID, | ||
7016 | }, | ||
6947 | [ALC885_MACPRO] = { | 7017 | [ALC885_MACPRO] = { |
6948 | .mixers = { alc882_macpro_mixer }, | 7018 | .mixers = { alc882_macpro_mixer }, |
6949 | .init_verbs = { alc882_macpro_init_verbs }, | 7019 | .init_verbs = { alc882_macpro_init_verbs }, |
@@ -7249,6 +7319,9 @@ static int patch_alc882(struct hda_codec *codec) | |||
7249 | case 0x106b3800: /* MacbookPro4,1 - latter revision */ | 7319 | case 0x106b3800: /* MacbookPro4,1 - latter revision */ |
7250 | board_config = ALC885_MBP3; | 7320 | board_config = ALC885_MBP3; |
7251 | break; | 7321 | break; |
7322 | case 0x106b3f00: /* Macbook 5,1 */ | ||
7323 | board_config = ALC885_MB5; | ||
7324 | break; | ||
7252 | default: | 7325 | default: |
7253 | /* ALC889A is handled better as ALC888-compatible */ | 7326 | /* ALC889A is handled better as ALC888-compatible */ |
7254 | if (codec->revision_id == 0x100101 || | 7327 | if (codec->revision_id == 0x100101 || |