aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-23 12:27:14 -0400
committerTakashi Iwai <tiwai@suse.de>2011-08-23 12:27:14 -0400
commit53c334add1e57bf96aec9b1fd927ff7746a7cb79 (patch)
tree6989f33dece766b0526a7533ffca70d15b1ae3b0 /sound/pci/hda/patch_realtek.c
parente23832ac1522bd833b47b3f0c879ce12ece700e2 (diff)
ALSA: hda - Rewrite ALC662 asus-mode* models with fixups
Re-implement the asus-mode[1-8] quirks with the pin-config tables. They are provided in case where BIOS is broken on the device, so it's not enabled in PCI SSID lookup table. User needs to specify it via model option explicitly if the driver doesn't work with the BIOS setup as is. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c182
1 files changed, 177 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c23bd3b43c9c..060f9e609aa8 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -177,6 +177,7 @@ struct alc_spec {
177 unsigned int dyn_adc_switch:1; /* switch ADCs (for ALC275) */ 177 unsigned int dyn_adc_switch:1; /* switch ADCs (for ALC275) */
178 unsigned int single_input_src:1; 178 unsigned int single_input_src:1;
179 unsigned int vol_in_capsrc:1; /* use capsrc volume (ADC has no vol) */ 179 unsigned int vol_in_capsrc:1; /* use capsrc volume (ADC has no vol) */
180 unsigned int parse_flags; /* passed to snd_hda_parse_pin_defcfg() */
180 181
181 /* auto-mute control */ 182 /* auto-mute control */
182 int automute_mode; 183 int automute_mode;
@@ -3691,7 +3692,8 @@ static int alc_parse_auto_config(struct hda_codec *codec,
3691 struct auto_pin_cfg *cfg = &spec->autocfg; 3692 struct auto_pin_cfg *cfg = &spec->autocfg;
3692 int err; 3693 int err;
3693 3694
3694 err = snd_hda_parse_pin_def_config(codec, cfg, ignore_nids); 3695 err = snd_hda_parse_pin_defcfg(codec, cfg, ignore_nids,
3696 spec->parse_flags);
3695 if (err < 0) 3697 if (err < 0)
3696 return err; 3698 return err;
3697 if (!cfg->line_outs) { 3699 if (!cfg->line_outs) {
@@ -5232,7 +5234,14 @@ enum {
5232 ALC662_FIXUP_CZC_P10T, 5234 ALC662_FIXUP_CZC_P10T,
5233 ALC662_FIXUP_SKU_IGNORE, 5235 ALC662_FIXUP_SKU_IGNORE,
5234 ALC662_FIXUP_HP_RP5800, 5236 ALC662_FIXUP_HP_RP5800,
5235 ALC662_FIXUP_ECS, 5237 ALC662_FIXUP_ASUS_MODE1,
5238 ALC662_FIXUP_ASUS_MODE2,
5239 ALC662_FIXUP_ASUS_MODE3,
5240 ALC662_FIXUP_ASUS_MODE4,
5241 ALC662_FIXUP_ASUS_MODE5,
5242 ALC662_FIXUP_ASUS_MODE6,
5243 ALC662_FIXUP_ASUS_MODE7,
5244 ALC662_FIXUP_ASUS_MODE8,
5236}; 5245};
5237 5246
5238static const struct alc_fixup alc662_fixups[] = { 5247static const struct alc_fixup alc662_fixups[] = {
@@ -5274,7 +5283,19 @@ static const struct alc_fixup alc662_fixups[] = {
5274 .chained = true, 5283 .chained = true,
5275 .chain_id = ALC662_FIXUP_SKU_IGNORE 5284 .chain_id = ALC662_FIXUP_SKU_IGNORE
5276 }, 5285 },
5277 [ALC662_FIXUP_ECS] = { 5286 [ALC662_FIXUP_ASUS_MODE1] = {
5287 .type = ALC_FIXUP_PINS,
5288 .v.pins = (const struct alc_pincfg[]) {
5289 { 0x14, 0x99130110 }, /* speaker */
5290 { 0x18, 0x01a19c20 }, /* mic */
5291 { 0x19, 0x99a3092f }, /* int-mic */
5292 { 0x21, 0x0121401f }, /* HP out */
5293 { }
5294 },
5295 .chained = true,
5296 .chain_id = ALC662_FIXUP_SKU_IGNORE
5297 },
5298 [ALC662_FIXUP_ASUS_MODE2] = {
5278 .type = ALC_FIXUP_PINS, 5299 .type = ALC_FIXUP_PINS,
5279 .v.pins = (const struct alc_pincfg[]) { 5300 .v.pins = (const struct alc_pincfg[]) {
5280 { 0x14, 0x99130110 }, /* speaker */ 5301 { 0x14, 0x99130110 }, /* speaker */
@@ -5283,25 +5304,173 @@ static const struct alc_fixup alc662_fixups[] = {
5283 { 0x1b, 0x0121401f }, /* HP out */ 5304 { 0x1b, 0x0121401f }, /* HP out */
5284 { } 5305 { }
5285 }, 5306 },
5307 .chained = true,
5308 .chain_id = ALC662_FIXUP_SKU_IGNORE
5309 },
5310 [ALC662_FIXUP_ASUS_MODE3] = {
5311 .type = ALC_FIXUP_PINS,
5312 .v.pins = (const struct alc_pincfg[]) {
5313 { 0x14, 0x99130110 }, /* speaker */
5314 { 0x15, 0x0121441f }, /* HP */
5315 { 0x18, 0x01a19840 }, /* mic */
5316 { 0x19, 0x99a3094f }, /* int-mic */
5317 { 0x21, 0x01211420 }, /* HP2 */
5318 { }
5319 },
5320 .chained = true,
5321 .chain_id = ALC662_FIXUP_SKU_IGNORE
5322 },
5323 [ALC662_FIXUP_ASUS_MODE4] = {
5324 .type = ALC_FIXUP_PINS,
5325 .v.pins = (const struct alc_pincfg[]) {
5326 { 0x14, 0x99130110 }, /* speaker */
5327 { 0x16, 0x99130111 }, /* speaker */
5328 { 0x18, 0x01a19840 }, /* mic */
5329 { 0x19, 0x99a3094f }, /* int-mic */
5330 { 0x21, 0x0121441f }, /* HP */
5331 { }
5332 },
5333 .chained = true,
5334 .chain_id = ALC662_FIXUP_SKU_IGNORE
5335 },
5336 [ALC662_FIXUP_ASUS_MODE5] = {
5337 .type = ALC_FIXUP_PINS,
5338 .v.pins = (const struct alc_pincfg[]) {
5339 { 0x14, 0x99130110 }, /* speaker */
5340 { 0x15, 0x0121441f }, /* HP */
5341 { 0x16, 0x99130111 }, /* speaker */
5342 { 0x18, 0x01a19840 }, /* mic */
5343 { 0x19, 0x99a3094f }, /* int-mic */
5344 { }
5345 },
5346 .chained = true,
5347 .chain_id = ALC662_FIXUP_SKU_IGNORE
5348 },
5349 [ALC662_FIXUP_ASUS_MODE6] = {
5350 .type = ALC_FIXUP_PINS,
5351 .v.pins = (const struct alc_pincfg[]) {
5352 { 0x14, 0x99130110 }, /* speaker */
5353 { 0x15, 0x01211420 }, /* HP2 */
5354 { 0x18, 0x01a19840 }, /* mic */
5355 { 0x19, 0x99a3094f }, /* int-mic */
5356 { 0x1b, 0x0121441f }, /* HP */
5357 { }
5358 },
5359 .chained = true,
5360 .chain_id = ALC662_FIXUP_SKU_IGNORE
5361 },
5362 [ALC662_FIXUP_ASUS_MODE7] = {
5363 .type = ALC_FIXUP_PINS,
5364 .v.pins = (const struct alc_pincfg[]) {
5365 { 0x14, 0x99130110 }, /* speaker */
5366 { 0x17, 0x99130111 }, /* speaker */
5367 { 0x18, 0x01a19840 }, /* mic */
5368 { 0x19, 0x99a3094f }, /* int-mic */
5369 { 0x1b, 0x01214020 }, /* HP */
5370 { 0x21, 0x0121401f }, /* HP */
5371 { }
5372 },
5373 .chained = true,
5374 .chain_id = ALC662_FIXUP_SKU_IGNORE
5375 },
5376 [ALC662_FIXUP_ASUS_MODE8] = {
5377 .type = ALC_FIXUP_PINS,
5378 .v.pins = (const struct alc_pincfg[]) {
5379 { 0x14, 0x99130110 }, /* speaker */
5380 { 0x12, 0x99a30970 }, /* int-mic */
5381 { 0x15, 0x01214020 }, /* HP */
5382 { 0x17, 0x99130111 }, /* speaker */
5383 { 0x18, 0x01a19840 }, /* mic */
5384 { 0x21, 0x0121401f }, /* HP */
5385 { }
5386 },
5387 .chained = true,
5388 .chain_id = ALC662_FIXUP_SKU_IGNORE
5286 }, 5389 },
5287}; 5390};
5288 5391
5289static const struct snd_pci_quirk alc662_fixup_tbl[] = { 5392static const struct snd_pci_quirk alc662_fixup_tbl[] = {
5290 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ECS), 5393 SND_PCI_QUIRK(0x1019, 0x9087, "ECS", ALC662_FIXUP_ASUS_MODE2),
5291 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 5394 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
5292 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE), 5395 SND_PCI_QUIRK(0x1025, 0x031c, "Gateway NV79", ALC662_FIXUP_SKU_IGNORE),
5293 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 5396 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
5294 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 5397 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
5295 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ECS), 5398 SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2),
5296 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 5399 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
5297 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 5400 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
5298 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 5401 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
5299 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 5402 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
5403
5404#if 0
5405 /* Below is a quirk table taken from the old code.
5406 * Basically the device should work as is without the fixup table.
5407 * If BIOS doesn't give a proper info, enable the corresponding
5408 * fixup entry.
5409 */
5410 SND_PCI_QUIRK(0x1043, 0x1000, "ASUS N50Vm", ALC662_FIXUP_ASUS_MODE1),
5411 SND_PCI_QUIRK(0x1043, 0x1092, "ASUS NB", ALC662_FIXUP_ASUS_MODE3),
5412 SND_PCI_QUIRK(0x1043, 0x1173, "ASUS K73Jn", ALC662_FIXUP_ASUS_MODE1),
5413 SND_PCI_QUIRK(0x1043, 0x11c3, "ASUS M70V", ALC662_FIXUP_ASUS_MODE3),
5414 SND_PCI_QUIRK(0x1043, 0x11d3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
5415 SND_PCI_QUIRK(0x1043, 0x11f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5416 SND_PCI_QUIRK(0x1043, 0x1203, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
5417 SND_PCI_QUIRK(0x1043, 0x1303, "ASUS G60J", ALC662_FIXUP_ASUS_MODE1),
5418 SND_PCI_QUIRK(0x1043, 0x1333, "ASUS G60Jx", ALC662_FIXUP_ASUS_MODE1),
5419 SND_PCI_QUIRK(0x1043, 0x1339, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5420 SND_PCI_QUIRK(0x1043, 0x13e3, "ASUS N71JA", ALC662_FIXUP_ASUS_MODE7),
5421 SND_PCI_QUIRK(0x1043, 0x1463, "ASUS N71", ALC662_FIXUP_ASUS_MODE7),
5422 SND_PCI_QUIRK(0x1043, 0x14d3, "ASUS G72", ALC662_FIXUP_ASUS_MODE8),
5423 SND_PCI_QUIRK(0x1043, 0x1563, "ASUS N90", ALC662_FIXUP_ASUS_MODE3),
5424 SND_PCI_QUIRK(0x1043, 0x15d3, "ASUS N50SF F50SF", ALC662_FIXUP_ASUS_MODE1),
5425 SND_PCI_QUIRK(0x1043, 0x16c3, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5426 SND_PCI_QUIRK(0x1043, 0x16f3, "ASUS K40C K50C", ALC662_FIXUP_ASUS_MODE2),
5427 SND_PCI_QUIRK(0x1043, 0x1733, "ASUS N81De", ALC662_FIXUP_ASUS_MODE1),
5428 SND_PCI_QUIRK(0x1043, 0x1753, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5429 SND_PCI_QUIRK(0x1043, 0x1763, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
5430 SND_PCI_QUIRK(0x1043, 0x1765, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
5431 SND_PCI_QUIRK(0x1043, 0x1783, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5432 SND_PCI_QUIRK(0x1043, 0x1793, "ASUS F50GX", ALC662_FIXUP_ASUS_MODE1),
5433 SND_PCI_QUIRK(0x1043, 0x17b3, "ASUS F70SL", ALC662_FIXUP_ASUS_MODE3),
5434 SND_PCI_QUIRK(0x1043, 0x17f3, "ASUS X58LE", ALC662_FIXUP_ASUS_MODE2),
5435 SND_PCI_QUIRK(0x1043, 0x1813, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5436 SND_PCI_QUIRK(0x1043, 0x1823, "ASUS NB", ALC662_FIXUP_ASUS_MODE5),
5437 SND_PCI_QUIRK(0x1043, 0x1833, "ASUS NB", ALC662_FIXUP_ASUS_MODE6),
5438 SND_PCI_QUIRK(0x1043, 0x1843, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5439 SND_PCI_QUIRK(0x1043, 0x1853, "ASUS F50Z", ALC662_FIXUP_ASUS_MODE1),
5440 SND_PCI_QUIRK(0x1043, 0x1864, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5441 SND_PCI_QUIRK(0x1043, 0x1876, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5442 SND_PCI_QUIRK(0x1043, 0x1893, "ASUS M50Vm", ALC662_FIXUP_ASUS_MODE3),
5443 SND_PCI_QUIRK(0x1043, 0x1894, "ASUS X55", ALC662_FIXUP_ASUS_MODE3),
5444 SND_PCI_QUIRK(0x1043, 0x18b3, "ASUS N80Vc", ALC662_FIXUP_ASUS_MODE1),
5445 SND_PCI_QUIRK(0x1043, 0x18c3, "ASUS VX5", ALC662_FIXUP_ASUS_MODE1),
5446 SND_PCI_QUIRK(0x1043, 0x18d3, "ASUS N81Te", ALC662_FIXUP_ASUS_MODE1),
5447 SND_PCI_QUIRK(0x1043, 0x18f3, "ASUS N505Tp", ALC662_FIXUP_ASUS_MODE1),
5448 SND_PCI_QUIRK(0x1043, 0x1903, "ASUS F5GL", ALC662_FIXUP_ASUS_MODE1),
5449 SND_PCI_QUIRK(0x1043, 0x1913, "ASUS NB", ALC662_FIXUP_ASUS_MODE2),
5450 SND_PCI_QUIRK(0x1043, 0x1933, "ASUS F80Q", ALC662_FIXUP_ASUS_MODE2),
5451 SND_PCI_QUIRK(0x1043, 0x1943, "ASUS Vx3V", ALC662_FIXUP_ASUS_MODE1),
5452 SND_PCI_QUIRK(0x1043, 0x1953, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
5453 SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71C", ALC662_FIXUP_ASUS_MODE3),
5454 SND_PCI_QUIRK(0x1043, 0x1983, "ASUS N5051A", ALC662_FIXUP_ASUS_MODE1),
5455 SND_PCI_QUIRK(0x1043, 0x1993, "ASUS N20", ALC662_FIXUP_ASUS_MODE1),
5456 SND_PCI_QUIRK(0x1043, 0x19b3, "ASUS F7Z", ALC662_FIXUP_ASUS_MODE1),
5457 SND_PCI_QUIRK(0x1043, 0x19c3, "ASUS F5Z/F6x", ALC662_FIXUP_ASUS_MODE2),
5458 SND_PCI_QUIRK(0x1043, 0x19e3, "ASUS NB", ALC662_FIXUP_ASUS_MODE1),
5459 SND_PCI_QUIRK(0x1043, 0x19f3, "ASUS NB", ALC662_FIXUP_ASUS_MODE4),
5460#endif
5300 {} 5461 {}
5301}; 5462};
5302 5463
5303static const struct alc_model_fixup alc662_fixup_models[] = { 5464static const struct alc_model_fixup alc662_fixup_models[] = {
5304 {.id = ALC272_FIXUP_MARIO, .name = "mario"}, 5465 {.id = ALC272_FIXUP_MARIO, .name = "mario"},
5466 {.id = ALC662_FIXUP_ASUS_MODE1, .name = "asus-mode1"},
5467 {.id = ALC662_FIXUP_ASUS_MODE2, .name = "asus-mode2"},
5468 {.id = ALC662_FIXUP_ASUS_MODE3, .name = "asus-mode3"},
5469 {.id = ALC662_FIXUP_ASUS_MODE4, .name = "asus-mode4"},
5470 {.id = ALC662_FIXUP_ASUS_MODE5, .name = "asus-mode5"},
5471 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
5472 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
5473 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
5305 {} 5474 {}
5306}; 5475};
5307 5476
@@ -5326,6 +5495,9 @@ static int patch_alc662(struct hda_codec *codec)
5326 5495
5327 spec->mixer_nid = 0x0b; 5496 spec->mixer_nid = 0x0b;
5328 5497
5498 /* handle multiple HPs as is */
5499 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
5500
5329 alc_auto_parse_customize_define(codec); 5501 alc_auto_parse_customize_define(codec);
5330 5502
5331 alc_fix_pll_init(codec, 0x20, 0x04, 15); 5503 alc_fix_pll_init(codec, 0x20, 0x04, 15);