Fix headphone/speaker automute for [1] Acer Aspire 5050 and [2] MSI MS-1034

laptops.

Tested by:	[1] Lion G. <liontanker@hotmail.com>
          	[2] Pietro Cerutti <pietro.cerutti@gmail.com>

Specialized mixer initialization for STAC9221, much like STAC9220.

Tested by:	Devon H. O'Dell
This commit is contained in:
ariff 2007-01-13 00:24:44 +00:00
parent aa6513e87b
commit 8b23d99eaa

View File

@ -189,6 +189,7 @@ SND_DECLARE_FILE("$FreeBSD$");
/* Acer */
#define ACER_VENDORID 0x1025
#define ACER_A5050_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0x010f)
#define ACER_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(ACER, 0xffff)
/* Asus */
@ -242,6 +243,11 @@ SND_DECLARE_FILE("$FreeBSD$");
#define TOSHIBA_U200_SUBVENDOR HDA_MODEL_CONSTRUCT(TOSHIBA, 0x0001)
#define TOSHIBA_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(TOSHIBA, 0xffff)
/* Micro-Star International (MSI) */
#define MSI_VENDORID 0x1462
#define MSI_MS1034_SUBVENDOR HDA_MODEL_CONSTRUCT(MSI, 0x0349)
#define MSI_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(MSI, 0xffff)
/* Misc constants.. */
#define HDA_AMP_MUTE_DEFAULT (0xffffffff)
#define HDA_AMP_MUTE_NONE (0)
@ -505,6 +511,10 @@ static const struct {
26, { 27, -1 }, -1 },
{ LG_LW20_SUBVENDOR, HDA_CODEC_ALC880, HDAC_HP_SWITCH_CTL, 0,
27, { 20, -1 }, -1 },
{ ACER_A5050_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL, 0,
20, { 21, -1 }, -1 },
{ MSI_MS1034_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL, 0,
20, { 27, -1 }, -1 },
/*
* All models that at least come from the same vendor with
* simmilar codec.
@ -519,6 +529,8 @@ static const struct {
13, { 14, -1 }, -1 },
{ LENOVO_ALL_SUBVENDOR, HDA_CODEC_AD1986A, HDAC_HP_SWITCH_CTL, 1,
26, { 27, -1 }, -1 },
{ ACER_ALL_SUBVENDOR, HDA_CODEC_ALC883, HDAC_HP_SWITCH_CTL, 0,
20, { 21, -1 }, -1 },
};
#define HDAC_HP_SWITCH_LEN \
(sizeof(hdac_hp_switch) / sizeof(hdac_hp_switch[0]))
@ -2912,6 +2924,21 @@ hdac_audio_ctl_ossmixer_init(struct snd_mixer *m)
} else
ctl->ossmask &= ~SOUND_MASK_VOLUME;
}
} else if (id == HDA_CODEC_STAC9221) {
mask |= SOUND_MASK_VOLUME;
while ((ctl = hdac_audio_ctl_each(devinfo, &i)) !=
NULL) {
if (ctl->widget == NULL)
continue;
if (ctl->widget->nid == 2 && ctl->index == 0) {
ctl->enable = 1;
ctl->ossmask = SOUND_MASK_VOLUME;
ctl->ossval = 100 | (100 << 8);
} else if (ctl->enable == 0)
continue;
else
ctl->ossmask &= ~SOUND_MASK_VOLUME;
}
} else {
mix_setparentchild(m, SOUND_MIXER_VOLUME,
SOUND_MASK_PCM);