Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182767
b: refs/heads/master
c: 76e6f5a
h: refs/heads/master
i:
  182765: c149973
  182763: 04e5705
  182759: 7cefc1a
  182751: 9a30f90
v: v3
  • Loading branch information
Reimundo Heluani authored and Takashi Iwai committed Feb 23, 2010
1 parent acbf4b8 commit 8a2458f
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32679f95cac3b1bdf27dce8b5273e06af186fd91
refs/heads/master: 76e6f5a9efc919f9179163c66403451a789d47ab
64 changes: 64 additions & 0 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ enum {
ALC882_ASUS_A7J,
ALC882_ASUS_A7M,
ALC885_MACPRO,
ALC885_MBA21,
ALC885_MBP3,
ALC885_MB5,
ALC885_MACMINI3,
Expand Down Expand Up @@ -6948,6 +6949,13 @@ static struct hda_channel_mode alc882_sixstack_modes[2] = {
{ 8, alc882_sixstack_ch8_init },
};


/* Macbook Air 2,1 */

static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
{ 2, NULL },
};

/*
* macbook pro ALC885 can switch LineIn to LineOut without losing Mic
*/
Expand Down Expand Up @@ -7220,6 +7228,15 @@ static struct snd_kcontrol_new alc882_base_mixer[] = {
{ } /* end */
};

/* Macbook Air 2,1 same control for HP and internal Speaker */

static struct snd_kcontrol_new alc885_mba21_mixer[] = {
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
HDA_BIND_MUTE("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
{ }
};


static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
HDA_BIND_MUTE ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
Expand Down Expand Up @@ -7689,6 +7706,29 @@ static struct hda_verb alc885_macmini3_init_verbs[] = {
{ }
};


static struct hda_verb alc885_mba21_init_verbs[] = {
/*Internal and HP Speaker Mixer*/
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
/*Internal Speaker Pin (0x0c)*/
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
/* HP Pin: output 0 (0x0e) */
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)},
/* Line in (is hp when jack connected)*/
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},

{ }
};


/* Macbook Pro rev3 */
static struct hda_verb alc885_mbp3_init_verbs[] = {
/* Front mixer: unmute input/output amp left and right (volume = 0) */
Expand Down Expand Up @@ -7854,6 +7894,17 @@ static void alc885_imac24_setup(struct hda_codec *codec)
#define alc885_mb5_setup alc885_imac24_setup
#define alc885_macmini3_setup alc885_imac24_setup

/* Macbook Air 2,1 */
static void alc885_mba21_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;

spec->autocfg.hp_pins[0] = 0x14;
spec->autocfg.speaker_pins[0] = 0x18;
}



static void alc885_mbp3_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
Expand Down Expand Up @@ -9017,6 +9068,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
[ALC885_MACPRO] = "macpro",
[ALC885_MB5] = "mb5",
[ALC885_MACMINI3] = "macmini3",
[ALC885_MBA21] = "mba21",
[ALC885_MBP3] = "mbp3",
[ALC885_IMAC24] = "imac24",
[ALC885_IMAC91] = "imac91",
Expand Down Expand Up @@ -9252,6 +9304,18 @@ static struct alc_config_preset alc882_presets[] = {
.input_mux = &alc882_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
},
[ALC885_MBA21] = {
.mixers = { alc885_mba21_mixer },
.init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
.num_dacs = 2,
.dac_nids = alc882_dac_nids,
.channel_mode = alc885_mba21_ch_modes,
.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
.input_mux = &alc882_capture_source,
.unsol_event = alc_automute_amp_unsol_event,
.setup = alc885_mba21_setup,
.init_hook = alc_automute_amp,
},
[ALC885_MBP3] = {
.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
.init_verbs = { alc885_mbp3_init_verbs,
Expand Down

0 comments on commit 8a2458f

Please sign in to comment.