Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182762
b: refs/heads/master
c: 9d54f08
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Feb 22, 2010
1 parent 2ecc5d3 commit f151703
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 65 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e458b1fadf9239d1fdb165ff4c4ea0d807041bec
refs/heads/master: 9d54f08bc77bf6dfe835b945d03b6e127c9fc5a3
81 changes: 17 additions & 64 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -7879,6 +7879,9 @@ static void alc885_imac24_setup(struct hda_codec *codec)
spec->autocfg.speaker_pins[1] = 0x1a;
}

#define alc885_mb5_setup alc885_imac24_setup
#define alc885_macmini3_setup alc885_imac24_setup

static void alc885_mbp3_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
Expand All @@ -7887,66 +7890,13 @@ static void alc885_mbp3_setup(struct hda_codec *codec)
spec->autocfg.speaker_pins[0] = 0x14;
}

static void alc885_mb5_automute(struct hda_codec *codec)
{
unsigned int present;

present = snd_hda_codec_read(codec, 0x14, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);

}

static void alc885_macmini3_automute(struct hda_codec *codec)
{
unsigned int present;

present = snd_hda_codec_read(codec, 0x14, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
}

static void alc885_mb5_unsol_event(struct hda_codec *codec,
unsigned int res)
{
/* Headphone insertion or removal. */
if ((res >> 26) == ALC880_HP_EVENT)
alc885_mb5_automute(codec);
}

static void alc885_macmini3_unsol_event(struct hda_codec *codec,
unsigned int res)
{
/* Headphone insertion or removal. */
if ((res >> 26) == ALC880_HP_EVENT)
alc885_mb5_automute(codec);
}

static void alc885_imac91_automute(struct hda_codec *codec)
static void alc885_imac91_setup(struct hda_codec *codec)
{
unsigned int present;

present = snd_hda_codec_read(codec, 0x14, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
snd_hda_codec_amp_stereo(codec, 0x15, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);
snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0,
HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0);

}
struct alc_spec *spec = codec->spec;

static void alc885_imac91_unsol_event(struct hda_codec *codec,
unsigned int res)
{
/* Headphone insertion or removal. */
if ((res >> 26) == ALC880_HP_EVENT)
alc885_imac91_automute(codec);
spec->autocfg.hp_pins[0] = 0x14;
spec->autocfg.speaker_pins[0] = 0x15;
spec->autocfg.speaker_pins[1] = 0x1a;
}

static struct hda_verb alc882_targa_verbs[] = {
Expand Down Expand Up @@ -9357,8 +9307,9 @@ static struct alc_config_preset alc882_presets[] = {
.input_mux = &mb5_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc885_mb5_unsol_event,
.init_hook = alc885_mb5_automute,
.unsol_event = alc_automute_amp_unsol_event,
.setup = alc885_mb5_setup,
.init_hook = alc_automute_amp,
},
[ALC885_MACMINI3] = {
.mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
Expand All @@ -9371,8 +9322,9 @@ static struct alc_config_preset alc882_presets[] = {
.input_mux = &macmini3_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc885_macmini3_unsol_event,
.init_hook = alc885_macmini3_automute,
.unsol_event = alc_automute_amp_unsol_event,
.setup = alc885_macmini3_setup,
.init_hook = alc_automute_amp,
},
[ALC885_MACPRO] = {
.mixers = { alc882_macpro_mixer },
Expand Down Expand Up @@ -9411,8 +9363,9 @@ static struct alc_config_preset alc882_presets[] = {
.input_mux = &alc882_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc885_imac91_unsol_event,
.init_hook = alc885_imac91_automute,
.unsol_event = alc_automute_amp_unsol_event,
.setup = alc885_imac91_setup,
.init_hook = alc_automute_amp,
},
[ALC882_TARGA] = {
.mixers = { alc882_targa_mixer, alc882_chmode_mixer },
Expand Down

0 comments on commit f151703

Please sign in to comment.