Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284188
b: refs/heads/master
c: ee3b296
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Nov 15, 2011
1 parent 5d4e3c8 commit 213fd8a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 91 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: 5671087ffa80ea7fcc254c08de9697551fecedcf
refs/heads/master: ee3b29693cb56b36fa4913b9a573d6c233bb8f03
90 changes: 0 additions & 90 deletions trunk/sound/pci/hda/alc880_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ enum {
ALC880_TCL_S700,
ALC880_LG,
ALC880_LG_LW,
ALC880_MEDION_RIM,
#ifdef CONFIG_SND_DEBUG
ALC880_TEST,
#endif
Expand Down Expand Up @@ -1137,78 +1136,6 @@ static void alc880_lg_lw_setup(struct hda_codec *codec)
alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
}

static const struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
HDA_BIND_MUTE("Master Playback Switch", 0x0c, 2, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT),
HDA_CODEC_MUTE("Internal Playback Switch", 0x0b, 0x1, HDA_INPUT),
{ } /* end */
};

static const struct hda_input_mux alc880_medion_rim_capture_source = {
.num_items = 2,
.items = {
{ "Mic", 0x0 },
{ "Internal Mic", 0x1 },
},
};

static const struct hda_verb alc880_medion_rim_init_verbs[] = {
{0x13, AC_VERB_SET_CONNECT_SEL, 0x00}, /* HP */

{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},

/* Mic1 (rear panel) pin widget for input and vref at 80% */
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
/* Mic2 (as headphone out) for HP output */
{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
/* Internal Speaker */
{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},

{0x20, AC_VERB_SET_COEF_INDEX, 0x07},
{0x20, AC_VERB_SET_PROC_COEF, 0x3060},

{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
{ }
};

/* toggle speaker-output according to the hp-jack state */
static void alc880_medion_rim_automute(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
alc_hp_automute(codec);
/* toggle EAPD */
if (spec->hp_jack_present)
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
else
snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
}

static void alc880_medion_rim_unsol_event(struct hda_codec *codec,
unsigned int res)
{
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
if ((res >> 28) == ALC_HP_EVENT)
alc880_medion_rim_automute(codec);
}

static void alc880_medion_rim_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;

spec->autocfg.hp_pins[0] = 0x14;
spec->autocfg.speaker_pins[0] = 0x1b;
alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
}

#ifdef CONFIG_SND_HDA_POWER_SAVE
static const struct hda_amp_list alc880_lg_loopbacks[] = {
{ 0x0b, HDA_INPUT, 1 },
Expand Down Expand Up @@ -1506,7 +1433,6 @@ static const char * const alc880_models[ALC880_MODEL_LAST] = {
[ALC880_F1734] = "F1734",
[ALC880_LG] = "lg",
[ALC880_LG_LW] = "lg-lw",
[ALC880_MEDION_RIM] = "medion",
#ifdef CONFIG_SND_DEBUG
[ALC880_TEST] = "test",
#endif
Expand Down Expand Up @@ -1557,7 +1483,6 @@ static const struct snd_pci_quirk alc880_cfg_tbl[] = {
SND_PCI_QUIRK(0x1584, 0x9070, "Uniwill", ALC880_UNIWILL),
SND_PCI_QUIRK(0x1584, 0x9077, "Uniwill P53", ALC880_UNIWILL_P53),
SND_PCI_QUIRK(0x161f, 0x203d, "W810", ALC880_W810),
SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_MEDION_RIM),
SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_5ST_DIG),
SND_PCI_QUIRK(0x1734, 0x107c, "FSC F1734", ALC880_F1734),
Expand Down Expand Up @@ -1862,21 +1787,6 @@ static const struct alc_config_preset alc880_presets[] = {
.setup = alc880_lg_lw_setup,
.init_hook = alc_hp_automute,
},
[ALC880_MEDION_RIM] = {
.mixers = { alc880_medion_rim_mixer },
.init_verbs = { alc880_volume_init_verbs,
alc880_medion_rim_init_verbs,
alc_gpio2_init_verbs },
.num_dacs = ARRAY_SIZE(alc880_dac_nids),
.dac_nids = alc880_dac_nids,
.dig_out_nid = ALC880_DIGOUT_NID,
.num_channel_mode = ARRAY_SIZE(alc880_2_jack_modes),
.channel_mode = alc880_2_jack_modes,
.input_mux = &alc880_medion_rim_capture_source,
.unsol_event = alc880_medion_rim_unsol_event,
.setup = alc880_medion_rim_setup,
.init_hook = alc880_medion_rim_automute,
},
#ifdef CONFIG_SND_DEBUG
[ALC880_TEST] = {
.mixers = { alc880_test_mixer },
Expand Down
38 changes: 38 additions & 0 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -4034,6 +4034,37 @@ static const struct hda_amp_list alc880_loopbacks[] = {
};
#endif

/*
* ALC880 fix-ups
*/
enum {
ALC880_FIXUP_GPIO2,
ALC880_FIXUP_MEDION_RIM,
};

static const struct alc_fixup alc880_fixups[] = {
[ALC880_FIXUP_GPIO2] = {
.type = ALC_FIXUP_VERBS,
.v.verbs = alc_gpio2_init_verbs,
},
[ALC880_FIXUP_MEDION_RIM] = {
.type = ALC_FIXUP_VERBS,
.v.verbs = (const struct hda_verb[]) {
{ 0x20, AC_VERB_SET_COEF_INDEX, 0x07 },
{ 0x20, AC_VERB_SET_PROC_COEF, 0x3060 },
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_GPIO2,
},
};

static const struct snd_pci_quirk alc880_fixup_tbl[] = {
SND_PCI_QUIRK(0x161f, 0x205d, "Medion Rim 2150", ALC880_FIXUP_MEDION_RIM),
{}
};


/*
* board setups
*/
Expand Down Expand Up @@ -4079,6 +4110,11 @@ static int patch_alc880(struct hda_codec *codec)
board_config = ALC_MODEL_AUTO;
}

if (board_config == ALC_MODEL_AUTO) {
alc_pick_fixup(codec, NULL, alc880_fixup_tbl, alc880_fixups);
alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
}

if (board_config == ALC_MODEL_AUTO) {
/* automatic parse from the BIOS config */
err = alc880_parse_auto_config(codec);
Expand Down Expand Up @@ -4113,6 +4149,8 @@ static int patch_alc880(struct hda_codec *codec)
set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
}

alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);

spec->vmaster_nid = 0x0c;

codec->patch_ops = alc_patch_ops;
Expand Down

0 comments on commit 213fd8a

Please sign in to comment.