Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293053
b: refs/heads/master
c: eefad7f
h: refs/heads/master
i:
  293051: 4d83356
v: v3
  • Loading branch information
Takashi Iwai committed Jan 20, 2012
1 parent 5147180 commit b8d1036
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 29 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: ac9ef6cf9196107115930e9fc66207199ef395b3
refs/heads/master: eefad7fd53eae2eb8d1e205b1d3a18f67e4e6b46
17 changes: 12 additions & 5 deletions trunk/sound/pci/hda/alc880_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,16 +762,22 @@ static void alc880_uniwill_unsol_event(struct hda_codec *codec,
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
switch (res >> 28) {
res >>= 28;
switch (res) {
case ALC_MIC_EVENT:
alc88x_simple_mic_automute(codec);
break;
default:
alc_sku_unsol_event(codec, res);
alc_exec_unsol_event(codec, res);
break;
}
}

static void alc880_unsol_event(struct hda_codec *codec, unsigned int res)
{
alc_exec_unsol_event(codec, res >> 28);
}

static void alc880_uniwill_p53_setup(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
Expand Down Expand Up @@ -800,10 +806,11 @@ static void alc880_uniwill_p53_unsol_event(struct hda_codec *codec,
/* Looks like the unsol event is incompatible with the standard
* definition. 4bit tag is placed at 28 bit!
*/
if ((res >> 28) == ALC_DCVOL_EVENT)
res >>= 28;
if (res == ALC_DCVOL_EVENT)
alc880_uniwill_p53_dcvol_automute(codec);
else
alc_sku_unsol_event(codec, res);
alc_exec_unsol_event(codec, res);
}

/*
Expand Down Expand Up @@ -1677,7 +1684,7 @@ static const struct alc_config_preset alc880_presets[] = {
.channel_mode = alc880_lg_ch_modes,
.need_dac_fix = 1,
.input_mux = &alc880_lg_capture_source,
.unsol_event = alc_sku_unsol_event,
.unsol_event = alc880_unsol_event,
.setup = alc880_lg_setup,
.init_hook = alc_hp_automute,
#ifdef CONFIG_SND_HDA_POWER_SAVE
Expand Down
15 changes: 10 additions & 5 deletions trunk/sound/pci/hda/alc882_quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,11 @@ static void alc889A_mb31_unsol_event(struct hda_codec *codec, unsigned int res)
alc889A_mb31_automute(codec);
}

static void alc882_unsol_event(struct hda_codec *codec, unsigned int res)
{
alc_exec_unsol_event(codec, res >> 26);
}

/*
* configuration and preset
*/
Expand Down Expand Up @@ -775,7 +780,7 @@ static const struct alc_config_preset alc882_presets[] = {
.channel_mode = alc885_mba21_ch_modes,
.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
.input_mux = &alc882_capture_source,
.unsol_event = alc_sku_unsol_event,
.unsol_event = alc882_unsol_event,
.setup = alc885_mba21_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -791,7 +796,7 @@ static const 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 = alc_sku_unsol_event,
.unsol_event = alc882_unsol_event,
.setup = alc885_mbp3_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -806,7 +811,7 @@ static const 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 = alc_sku_unsol_event,
.unsol_event = alc882_unsol_event,
.setup = alc885_mb5_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -821,7 +826,7 @@ static const 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 = alc_sku_unsol_event,
.unsol_event = alc882_unsol_event,
.setup = alc885_macmini3_setup,
.init_hook = alc_hp_automute,
},
Expand All @@ -836,7 +841,7 @@ static const struct alc_config_preset alc882_presets[] = {
.input_mux = &alc889A_imac91_capture_source,
.dig_out_nid = ALC882_DIGOUT_NID,
.dig_in_nid = ALC882_DIGIN_NID,
.unsol_event = alc_sku_unsol_event,
.unsol_event = alc882_unsol_event,
.setup = alc885_imac91_setup,
.init_hook = alc_hp_automute,
},
Expand Down
48 changes: 31 additions & 17 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ struct alc_spec {
unsigned int vol_in_capsrc:1; /* use capsrc volume (ADC has no vol) */
unsigned int parse_flags; /* passed to snd_hda_parse_pin_defcfg() */
unsigned int shared_mic_hp:1; /* HP/Mic-in sharing */
unsigned int use_jack_tbl:1; /* 1 for model=auto */

/* auto-mute control */
int automute_mode;
Expand Down Expand Up @@ -621,17 +620,10 @@ static void alc_mic_automute(struct hda_codec *codec)
alc_mux_select(codec, 0, spec->int_mic_idx, false);
}

/* unsolicited event for HP jack sensing */
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
/* handle the specified unsol action (ALC_XXX_EVENT) */
static void alc_exec_unsol_event(struct hda_codec *codec, int action)
{
struct alc_spec *spec = codec->spec;
if (codec->vendor_id == 0x10ec0880)
res >>= 28;
else
res >>= 26;
if (spec->use_jack_tbl)
res = snd_hda_jack_get_action(codec, res);
switch (res) {
switch (action) {
case ALC_HP_EVENT:
alc_hp_automute(codec);
break;
Expand All @@ -645,6 +637,18 @@ static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
snd_hda_jack_report_sync(codec);
}

/* unsolicited event for HP jack sensing */
static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res)
{
struct alc_spec *spec = codec->spec;
if (codec->vendor_id == 0x10ec0880)
res >>= 28;
else
res >>= 26;
res = snd_hda_jack_get_action(codec, res);
alc_exec_unsol_event(codec, res);
}

/* call init functions of standard auto-mute helpers */
static void alc_inithook(struct hda_codec *codec)
{
Expand Down Expand Up @@ -1883,7 +1887,7 @@ static const struct snd_kcontrol_new alc_beep_mixer[] = {
};
#endif

static int alc_build_controls(struct hda_codec *codec)
static int __alc_build_controls(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
struct snd_kcontrol *kctl = NULL;
Expand Down Expand Up @@ -2029,11 +2033,16 @@ static int alc_build_controls(struct hda_codec *codec)

alc_free_kctls(codec); /* no longer needed */

err = snd_hda_jack_add_kctls(codec, &spec->autocfg);
return 0;
}

static int alc_build_controls(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
int err = __alc_build_controls(codec);
if (err < 0)
return err;

return 0;
return snd_hda_jack_add_kctls(codec, &spec->autocfg);
}


Expand Down Expand Up @@ -3233,7 +3242,7 @@ static int alc_auto_create_multi_out_ctls(struct hda_codec *codec,
int i, err, noutputs;

noutputs = cfg->line_outs;
if (spec->multi_ios > 0)
if (spec->multi_ios > 0 && cfg->line_outs < 3)
noutputs += spec->multi_ios;

for (i = 0; i < noutputs; i++) {
Expand Down Expand Up @@ -3904,7 +3913,6 @@ static void set_capture_mixer(struct hda_codec *codec)
static void alc_auto_init_std(struct hda_codec *codec)
{
struct alc_spec *spec = codec->spec;
spec->use_jack_tbl = 1;
alc_auto_init_multi_out(codec);
alc_auto_init_extra_out(codec);
alc_auto_init_analog_input(codec);
Expand Down Expand Up @@ -4168,6 +4176,8 @@ static int patch_alc880(struct hda_codec *codec)
codec->patch_ops = alc_patch_ops;
if (board_config == ALC_MODEL_AUTO)
spec->init_hook = alc_auto_init_std;
else
codec->patch_ops.build_controls = __alc_build_controls;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc880_loopbacks;
Expand Down Expand Up @@ -4297,6 +4307,8 @@ static int patch_alc260(struct hda_codec *codec)
codec->patch_ops = alc_patch_ops;
if (board_config == ALC_MODEL_AUTO)
spec->init_hook = alc_auto_init_std;
else
codec->patch_ops.build_controls = __alc_build_controls;
spec->shutup = alc_eapd_shutup;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
Expand Down Expand Up @@ -4691,6 +4703,8 @@ static int patch_alc882(struct hda_codec *codec)
codec->patch_ops = alc_patch_ops;
if (board_config == ALC_MODEL_AUTO)
spec->init_hook = alc_auto_init_std;
else
codec->patch_ops.build_controls = __alc_build_controls;

#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/patch_sigmatel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@ static const struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = {
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a,
"Alienware M17x", STAC_ALIENWARE_M17X),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0490,
"Alienware M17x", STAC_ALIENWARE_M17X),
"Alienware M17x R3", STAC_DELL_EQ),
{} /* terminator */
};

Expand Down

0 comments on commit b8d1036

Please sign in to comment.