Commit 67b6ec31 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/realtek - Drop all ALC880 static quirks

Finally the all static quirks for ALC880 are converted to the
auto-parser.  Since we are never sure whether the BIOS on so many old
machines are really correct, the quirk table entries are copied as
they are, but just providing the proper pin-config values
accordingly.

Since alc880_quirks.c is removed, alc882_quirks.c has to be adjusted
slightly to be built again.  There might be some compile warnings due
to the remaining alc882 quirks, but these shall be killed sooner or
later, I don't care it much at this point.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 29e3fdcc
......@@ -8,10 +8,6 @@ ALC880
5stack-digout 5-jack in back, 2-jack in front, a SPDIF out
6stack 6-jack in back, 2-jack in front
6stack-digout 6-jack with a SPDIF out
test for testing/debugging purpose, almost all controls can be
adjusted. Appearing only when compiled with
$CONFIG_SND_DEBUG=y
auto auto-config reading BIOS (default)
ALC260
======
......
This diff is collapsed.
......@@ -34,8 +34,16 @@ static const hda_nid_t alc882_dac_nids[4] = {
#define alc883_dac_nids alc882_dac_nids
/* ADCs */
#define alc882_adc_nids alc880_adc_nids
#define alc882_adc_nids_alt alc880_adc_nids_alt
static const hda_nid_t alc882_adc_nids[3] = {
/* ADC0-2 */
0x07, 0x08, 0x09,
};
static const hda_nid_t alc882_adc_nids_alt[2] = {
/* ADC1-2 */
0x08, 0x09,
};
#define alc883_adc_nids alc882_adc_nids_alt
static const hda_nid_t alc882_capsrc_nids_alt[2] = { 0x23, 0x22 };
......@@ -774,7 +782,7 @@ static const struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
static const struct alc_config_preset alc882_presets[] = {
[ALC885_MBA21] = {
.mixers = { alc885_mba21_mixer },
.init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
.init_verbs = { alc885_mba21_init_verbs, alc_gpio1_init_verbs },
.num_dacs = 2,
.dac_nids = alc882_dac_nids,
.channel_mode = alc885_mba21_ch_modes,
......@@ -787,7 +795,7 @@ static const struct alc_config_preset alc882_presets[] = {
[ALC885_MBP3] = {
.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
.init_verbs = { alc885_mbp3_init_verbs,
alc880_gpio1_init_verbs },
alc_gpio1_init_verbs },
.num_dacs = 2,
.dac_nids = alc882_dac_nids,
.hp_nid = 0x04,
......@@ -803,7 +811,7 @@ static const struct alc_config_preset alc882_presets[] = {
[ALC885_MB5] = {
.mixers = { alc885_mb5_mixer, alc882_chmode_mixer },
.init_verbs = { alc885_mb5_init_verbs,
alc880_gpio1_init_verbs },
alc_gpio1_init_verbs },
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
.dac_nids = alc882_dac_nids,
.channel_mode = alc885_mb5_6ch_modes,
......@@ -818,7 +826,7 @@ static const struct alc_config_preset alc882_presets[] = {
[ALC885_MACMINI3] = {
.mixers = { alc885_macmini3_mixer, alc882_chmode_mixer },
.init_verbs = { alc885_macmini3_init_verbs,
alc880_gpio1_init_verbs },
alc_gpio1_init_verbs },
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
.dac_nids = alc882_dac_nids,
.channel_mode = alc885_macmini3_6ch_modes,
......@@ -833,7 +841,7 @@ static const struct alc_config_preset alc882_presets[] = {
[ALC885_IMAC91] = {
.mixers = {alc885_imac91_mixer},
.init_verbs = { alc885_imac91_init_verbs,
alc880_gpio1_init_verbs },
alc_gpio1_init_verbs },
.num_dacs = ARRAY_SIZE(alc882_dac_nids),
.dac_nids = alc882_dac_nids,
.channel_mode = alc885_mba21_ch_modes,
......@@ -848,7 +856,7 @@ static const struct alc_config_preset alc882_presets[] = {
[ALC889A_MB31] = {
.mixers = { alc889A_mb31_mixer, alc883_chmode_mixer},
.init_verbs = { alc883_init_verbs, alc889A_mb31_verbs,
alc880_gpio1_init_verbs },
alc_gpio1_init_verbs },
.adc_nids = alc883_adc_nids,
.num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
.capsrc_nids = alc883_capsrc_nids,
......
......@@ -4451,6 +4451,15 @@ enum {
ALC880_FIXUP_UNIWILL,
ALC880_FIXUP_UNIWILL_DIG,
ALC880_FIXUP_Z71V,
ALC880_FIXUP_3ST_BASE,
ALC880_FIXUP_3ST,
ALC880_FIXUP_3ST_DIG,
ALC880_FIXUP_5ST_BASE,
ALC880_FIXUP_5ST,
ALC880_FIXUP_5ST_DIG,
ALC880_FIXUP_6ST_BASE,
ALC880_FIXUP_6ST,
ALC880_FIXUP_6ST_DIG,
};
/* enable the volume-knob widget support on NID 0x21 */
......@@ -4603,6 +4612,114 @@ static const struct alc_fixup alc880_fixups[] = {
{ }
}
},
[ALC880_FIXUP_3ST_BASE] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x14, 0x01014010 }, /* line-out */
{ 0x15, 0x411111f0 }, /* N/A */
{ 0x16, 0x411111f0 }, /* N/A */
{ 0x17, 0x411111f0 }, /* N/A */
{ 0x18, 0x01a19c30 }, /* mic-in */
{ 0x19, 0x0121411f }, /* HP */
{ 0x1a, 0x01813031 }, /* line-in */
{ 0x1b, 0x02a19c40 }, /* front-mic */
{ 0x1c, 0x411111f0 }, /* N/A */
{ 0x1d, 0x411111f0 }, /* N/A */
/* 0x1e is filled in below */
{ 0x1f, 0x411111f0 }, /* N/A */
{ }
}
},
[ALC880_FIXUP_3ST] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x411111f0 }, /* N/A */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_3ST_BASE,
},
[ALC880_FIXUP_3ST_DIG] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x0144111e }, /* SPDIF */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_3ST_BASE,
},
[ALC880_FIXUP_5ST_BASE] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x14, 0x01014010 }, /* front */
{ 0x15, 0x411111f0 }, /* N/A */
{ 0x16, 0x01011411 }, /* CLFE */
{ 0x17, 0x01016412 }, /* surr */
{ 0x18, 0x01a19c30 }, /* mic-in */
{ 0x19, 0x0121411f }, /* HP */
{ 0x1a, 0x01813031 }, /* line-in */
{ 0x1b, 0x02a19c40 }, /* front-mic */
{ 0x1c, 0x411111f0 }, /* N/A */
{ 0x1d, 0x411111f0 }, /* N/A */
/* 0x1e is filled in below */
{ 0x1f, 0x411111f0 }, /* N/A */
{ }
}
},
[ALC880_FIXUP_5ST] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x411111f0 }, /* N/A */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_5ST_BASE,
},
[ALC880_FIXUP_5ST_DIG] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x0144111e }, /* SPDIF */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_5ST_BASE,
},
[ALC880_FIXUP_6ST_BASE] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x14, 0x01014010 }, /* front */
{ 0x15, 0x01016412 }, /* surr */
{ 0x16, 0x01011411 }, /* CLFE */
{ 0x17, 0x01012414 }, /* side */
{ 0x18, 0x01a19c30 }, /* mic-in */
{ 0x19, 0x02a19c40 }, /* front-mic */
{ 0x1a, 0x01813031 }, /* line-in */
{ 0x1b, 0x0121411f }, /* HP */
{ 0x1c, 0x411111f0 }, /* N/A */
{ 0x1d, 0x411111f0 }, /* N/A */
/* 0x1e is filled in below */
{ 0x1f, 0x411111f0 }, /* N/A */
{ }
}
},
[ALC880_FIXUP_6ST] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x411111f0 }, /* N/A */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_6ST_BASE,
},
[ALC880_FIXUP_6ST_DIG] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x1e, 0x0144111e }, /* SPDIF */
{ }
},
.chained = true,
.chain_id = ALC880_FIXUP_6ST_BASE,
},
};
static const struct snd_pci_quirk alc880_fixup_tbl[] = {
......@@ -4625,6 +4742,60 @@ static const struct snd_pci_quirk alc880_fixup_tbl[] = {
SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_FIXUP_LG),
SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_FIXUP_LG),
SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_FIXUP_TCL_S700),
/* Below is the copied entries from alc880_quirks.c.
* It's not quite sure whether BIOS sets the correct pin-config table
* on these machines, thus they are kept to be compatible with
* the old static quirks. Once when it's confirmed to work without
* these overrides, it'd be better to remove.
*/
SND_PCI_QUIRK(0x1019, 0xa880, "ECS", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x1019, 0xa884, "Acer APFV", ALC880_FIXUP_6ST),
SND_PCI_QUIRK(0x1025, 0x0070, "ULI", ALC880_FIXUP_3ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0077, "ULI", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0078, "ULI", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0x0087, "ULI", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_FIXUP_3ST_DIG),
SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_FIXUP_3ST),
SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x104d, 0x81a0, "Sony", ALC880_FIXUP_3ST),
SND_PCI_QUIRK(0x104d, 0x81d6, "Sony", ALC880_FIXUP_3ST),
SND_PCI_QUIRK(0x107b, 0x3032, "Gateway", ALC880_FIXUP_5ST),
SND_PCI_QUIRK(0x107b, 0x3033, "Gateway", ALC880_FIXUP_5ST),
SND_PCI_QUIRK(0x107b, 0x4039, "Gateway", ALC880_FIXUP_5ST),
SND_PCI_QUIRK(0x1297, 0xc790, "Shuttle ST20G5", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1458, 0xa102, "Gigabyte K8", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1462, 0x1150, "MSI", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1509, 0x925d, "FIC P4M", ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x1565, 0x8202, "Biostar", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x1695, 0x400d, "EPoX", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x1695, 0x4012, "EPox EP-5LDA", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x2668, 0x8086, NULL, ALC880_FIXUP_6ST_DIG), /* broken BIOS */
SND_PCI_QUIRK(0x8086, 0x2668, NULL, ALC880_FIXUP_6ST_DIG),
SND_PCI_QUIRK(0x8086, 0xa100, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xd402, "Intel mobo", ALC880_FIXUP_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe224, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe305, "Intel mobo", ALC880_FIXUP_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe308, "Intel mobo", ALC880_FIXUP_3ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe400, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe401, "Intel mobo", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0x8086, 0xe402, "Intel mobo", ALC880_FIXUP_5ST_DIG),
/* default Intel */
SND_PCI_QUIRK_VENDOR(0x8086, "Intel mobo", ALC880_FIXUP_3ST),
SND_PCI_QUIRK(0xa0a0, 0x0560, "AOpen i915GMm-HFS", ALC880_FIXUP_5ST_DIG),
SND_PCI_QUIRK(0xe803, 0x1019, NULL, ALC880_FIXUP_6ST_DIG),
{}
};
static const struct alc_model_fixup alc880_fixup_models[] = {
{.id = ALC880_FIXUP_3ST, .name = "3stack"},
{.id = ALC880_FIXUP_3ST_DIG, .name = "3stack-digout"},
{.id = ALC880_FIXUP_5ST, .name = "5stack"},
{.id = ALC880_FIXUP_5ST_DIG, .name = "5stack-digout"},
{.id = ALC880_FIXUP_6ST, .name = "6stack"},
{.id = ALC880_FIXUP_6ST_DIG, .name = "6stack-digout"},
{}
};
......@@ -4647,14 +4818,9 @@ static const struct snd_pci_quirk alc880_fixup_tbl[] = {
/*
* OK, here we have finally the patch for ALC880
*/
#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
#include "alc880_quirks.c"
#endif
static int patch_alc880(struct hda_codec *codec)
{
struct alc_spec *spec;
int board_config;
int err;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
......@@ -4666,38 +4832,14 @@ static int patch_alc880(struct hda_codec *codec)
spec->mixer_nid = 0x0b;
spec->need_dac_fix = 1;
board_config = alc_board_config(codec, ALC880_MODEL_LAST,
alc880_models, alc880_cfg_tbl);
if (board_config < 0) {
printk(KERN_INFO "hda_codec: %s: BIOS auto-probing.\n",
codec->chip_name);
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);
if (err < 0)
goto error;
#ifdef CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS
else if (!err) {
printk(KERN_INFO
"hda_codec: Cannot set up configuration "
"from BIOS. Using 3-stack mode...\n");
board_config = ALC880_3ST;
}
#endif
}
alc_pick_fixup(codec, alc880_fixup_models, alc880_fixup_tbl,
alc880_fixups);
alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
if (board_config != ALC_MODEL_AUTO) {
spec->vmaster_nid = 0x0c;
setup_preset(codec, &alc880_presets[board_config]);
}
/* automatic parse from the BIOS config */
err = alc880_parse_auto_config(codec);
if (err < 0)
goto error;
if (!spec->no_analog && !spec->adc_nids) {
alc_auto_fill_adc_caps(codec);
......@@ -4716,10 +4858,7 @@ 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;
spec->init_hook = alc_auto_init_std;
#ifdef CONFIG_SND_HDA_POWER_SAVE
if (!spec->loopback.amplist)
spec->loopback.amplist = alc880_loopbacks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment