aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorReimundo Heluani <rheluani@gmail.com>2010-02-23 04:19:51 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-23 04:55:03 -0500
commit76e6f5a9efc919f9179163c66403451a789d47ab (patch)
tree14d7944add98cff6f2a0f140f4f5dedd378d4bf9 /sound
parent32679f95cac3b1bdf27dce8b5273e06af186fd91 (diff)
ALSA: add support for Macbook Air 2,1 internal speaker
Add support for Macbook Air 2,1 (late 2008) internal speaker and headphones. Create a "mba21" model for snd-hda-intel. Signed-off-by: Reimundo Heluani <rheluani@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c74ca39a0b8e..5382872eba1f 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -209,6 +209,7 @@ enum {
209 ALC882_ASUS_A7J, 209 ALC882_ASUS_A7J,
210 ALC882_ASUS_A7M, 210 ALC882_ASUS_A7M,
211 ALC885_MACPRO, 211 ALC885_MACPRO,
212 ALC885_MBA21,
212 ALC885_MBP3, 213 ALC885_MBP3,
213 ALC885_MB5, 214 ALC885_MB5,
214 ALC885_MACMINI3, 215 ALC885_MACMINI3,
@@ -6948,6 +6949,13 @@ static struct hda_channel_mode alc882_sixstack_modes[2] = {
6948 { 8, alc882_sixstack_ch8_init }, 6949 { 8, alc882_sixstack_ch8_init },
6949}; 6950};
6950 6951
6952
6953/* Macbook Air 2,1 */
6954
6955static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
6956 { 2, NULL },
6957};
6958
6951/* 6959/*
6952 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic 6960 * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
6953 */ 6961 */
@@ -7220,6 +7228,15 @@ static struct snd_kcontrol_new alc882_base_mixer[] = {
7220 { } /* end */ 7228 { } /* end */
7221}; 7229};
7222 7230
7231/* Macbook Air 2,1 same control for HP and internal Speaker */
7232
7233static struct snd_kcontrol_new alc885_mba21_mixer[] = {
7234 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7235 HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
7236 { }
7237};
7238
7239
7223static struct snd_kcontrol_new alc885_mbp3_mixer[] = { 7240static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
7224 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT), 7241 HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
7225 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT), 7242 HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
@@ -7689,6 +7706,29 @@ static struct hda_verb alc885_macmini3_init_verbs[] = {
7689 { } 7706 { }
7690}; 7707};
7691 7708
7709
7710static struct hda_verb alc885_mba21_init_verbs[] = {
7711 /*Internal and HP Speaker Mixer*/
7712 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
7713 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
7714 {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
7715 /*Internal Speaker Pin (0x0c)*/
7716 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
7717 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7718 {0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
7719 /* HP Pin: output 0 (0x0e) */
7720 {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
7721 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
7722 {0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
7723 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)},
7724 /* Line in (is hp when jack connected)*/
7725 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
7726 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
7727
7728 { }
7729 };
7730
7731
7692/* Macbook Pro rev3 */ 7732/* Macbook Pro rev3 */
7693static struct hda_verb alc885_mbp3_init_verbs[] = { 7733static struct hda_verb alc885_mbp3_init_verbs[] = {
7694 /* Front mixer: unmute input/output amp left and right (volume = 0) */ 7734 /* Front mixer: unmute input/output amp left and right (volume = 0) */
@@ -7854,6 +7894,17 @@ static void alc885_imac24_setup(struct hda_codec *codec)
7854#define alc885_mb5_setup alc885_imac24_setup 7894#define alc885_mb5_setup alc885_imac24_setup
7855#define alc885_macmini3_setup alc885_imac24_setup 7895#define alc885_macmini3_setup alc885_imac24_setup
7856 7896
7897/* Macbook Air 2,1 */
7898static void alc885_mba21_setup(struct hda_codec *codec)
7899{
7900 struct alc_spec *spec = codec->spec;
7901
7902 spec->autocfg.hp_pins[0] = 0x14;
7903 spec->autocfg.speaker_pins[0] = 0x18;
7904}
7905
7906
7907
7857static void alc885_mbp3_setup(struct hda_codec *codec) 7908static void alc885_mbp3_setup(struct hda_codec *codec)
7858{ 7909{
7859 struct alc_spec *spec = codec->spec; 7910 struct alc_spec *spec = codec->spec;
@@ -9017,6 +9068,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
9017 [ALC885_MACPRO] = "macpro", 9068 [ALC885_MACPRO] = "macpro",
9018 [ALC885_MB5] = "mb5", 9069 [ALC885_MB5] = "mb5",
9019 [ALC885_MACMINI3] = "macmini3", 9070 [ALC885_MACMINI3] = "macmini3",
9071 [ALC885_MBA21] = "mba21",
9020 [ALC885_MBP3] = "mbp3", 9072 [ALC885_MBP3] = "mbp3",
9021 [ALC885_IMAC24] = "imac24", 9073 [ALC885_IMAC24] = "imac24",
9022 [ALC885_IMAC91] = "imac91", 9074 [ALC885_IMAC91] = "imac91",
@@ -9252,6 +9304,18 @@ static struct alc_config_preset alc882_presets[] = {
9252 .input_mux = &alc882_capture_source, 9304 .input_mux = &alc882_capture_source,
9253 .dig_out_nid = ALC882_DIGOUT_NID, 9305 .dig_out_nid = ALC882_DIGOUT_NID,
9254 }, 9306 },
9307 [ALC885_MBA21] = {
9308 .mixers = { alc885_mba21_mixer },
9309 .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
9310 .num_dacs = 2,
9311 .dac_nids = alc882_dac_nids,
9312 .channel_mode = alc885_mba21_ch_modes,
9313 .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
9314 .input_mux = &alc882_capture_source,
9315 .unsol_event = alc_automute_amp_unsol_event,
9316 .setup = alc885_mba21_setup,
9317 .init_hook = alc_automute_amp,
9318 },
9255 [ALC885_MBP3] = { 9319 [ALC885_MBP3] = {
9256 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer }, 9320 .mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
9257 .init_verbs = { alc885_mbp3_init_verbs, 9321 .init_verbs = { alc885_mbp3_init_verbs,