diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-12 02:49:00 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-12 02:58:48 -0400 |
commit | 7fa90e873f520dad5ec58f47340996cda083e875 (patch) | |
tree | c8283679460202f10545e0734ecbebcd2bc06fd4 /sound/pci | |
parent | 7f311a46916a3be00a1a8e3f1bdf461d08f1d263 (diff) |
ALSA: hda - Enhance fix-up table for Realtek codecs
A few enhancement / fixes for fix-up table of some Realtek codecs:
- Apply fix-ups only for the auto model
- Apply additional verbs after normal init verbs
- Add a debug print to show the fix-up application
This is basically a preliminary work for the next fix for Sony VAIO.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8d60b1f25ce1..cff57710d1fb 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1390,22 +1390,31 @@ struct alc_fixup { | |||
1390 | 1390 | ||
1391 | static void alc_pick_fixup(struct hda_codec *codec, | 1391 | static void alc_pick_fixup(struct hda_codec *codec, |
1392 | const struct snd_pci_quirk *quirk, | 1392 | const struct snd_pci_quirk *quirk, |
1393 | const struct alc_fixup *fix) | 1393 | const struct alc_fixup *fix, |
1394 | int pre_init) | ||
1394 | { | 1395 | { |
1395 | const struct alc_pincfg *cfg; | 1396 | const struct alc_pincfg *cfg; |
1396 | 1397 | ||
1397 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); | 1398 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); |
1398 | if (!quirk) | 1399 | if (!quirk) |
1399 | return; | 1400 | return; |
1400 | |||
1401 | fix += quirk->value; | 1401 | fix += quirk->value; |
1402 | cfg = fix->pins; | 1402 | cfg = fix->pins; |
1403 | if (cfg) { | 1403 | if (pre_init && cfg) { |
1404 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1405 | snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n", | ||
1406 | codec->chip_name, quirk->name); | ||
1407 | #endif | ||
1404 | for (; cfg->nid; cfg++) | 1408 | for (; cfg->nid; cfg++) |
1405 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | 1409 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); |
1406 | } | 1410 | } |
1407 | if (fix->verbs) | 1411 | if (!pre_init && fix->verbs) { |
1412 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1413 | snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n", | ||
1414 | codec->chip_name, quirk->name); | ||
1415 | #endif | ||
1408 | add_verb(codec->spec, fix->verbs); | 1416 | add_verb(codec->spec, fix->verbs); |
1417 | } | ||
1409 | } | 1418 | } |
1410 | 1419 | ||
1411 | static int alc_read_coef_idx(struct hda_codec *codec, | 1420 | static int alc_read_coef_idx(struct hda_codec *codec, |
@@ -10439,7 +10448,8 @@ static int patch_alc882(struct hda_codec *codec) | |||
10439 | board_config = ALC882_AUTO; | 10448 | board_config = ALC882_AUTO; |
10440 | } | 10449 | } |
10441 | 10450 | ||
10442 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); | 10451 | if (board_config == ALC882_AUTO) |
10452 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1); | ||
10443 | 10453 | ||
10444 | if (board_config == ALC882_AUTO) { | 10454 | if (board_config == ALC882_AUTO) { |
10445 | /* automatic parse from the BIOS config */ | 10455 | /* automatic parse from the BIOS config */ |
@@ -10512,6 +10522,9 @@ static int patch_alc882(struct hda_codec *codec) | |||
10512 | set_capture_mixer(codec); | 10522 | set_capture_mixer(codec); |
10513 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10523 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
10514 | 10524 | ||
10525 | if (board_config == ALC882_AUTO) | ||
10526 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0); | ||
10527 | |||
10515 | spec->vmaster_nid = 0x0c; | 10528 | spec->vmaster_nid = 0x0c; |
10516 | 10529 | ||
10517 | codec->patch_ops = alc_patch_ops; | 10530 | codec->patch_ops = alc_patch_ops; |
@@ -15417,7 +15430,8 @@ static int patch_alc861(struct hda_codec *codec) | |||
15417 | board_config = ALC861_AUTO; | 15430 | board_config = ALC861_AUTO; |
15418 | } | 15431 | } |
15419 | 15432 | ||
15420 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups); | 15433 | if (board_config == ALC861_AUTO) |
15434 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1); | ||
15421 | 15435 | ||
15422 | if (board_config == ALC861_AUTO) { | 15436 | if (board_config == ALC861_AUTO) { |
15423 | /* automatic parse from the BIOS config */ | 15437 | /* automatic parse from the BIOS config */ |
@@ -15454,6 +15468,9 @@ static int patch_alc861(struct hda_codec *codec) | |||
15454 | 15468 | ||
15455 | spec->vmaster_nid = 0x03; | 15469 | spec->vmaster_nid = 0x03; |
15456 | 15470 | ||
15471 | if (board_config == ALC861_AUTO) | ||
15472 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0); | ||
15473 | |||
15457 | codec->patch_ops = alc_patch_ops; | 15474 | codec->patch_ops = alc_patch_ops; |
15458 | if (board_config == ALC861_AUTO) { | 15475 | if (board_config == ALC861_AUTO) { |
15459 | spec->init_hook = alc861_auto_init; | 15476 | spec->init_hook = alc861_auto_init; |
@@ -16388,7 +16405,8 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
16388 | board_config = ALC861VD_AUTO; | 16405 | board_config = ALC861VD_AUTO; |
16389 | } | 16406 | } |
16390 | 16407 | ||
16391 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); | 16408 | if (board_config == ALC861VD_AUTO) |
16409 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1); | ||
16392 | 16410 | ||
16393 | if (board_config == ALC861VD_AUTO) { | 16411 | if (board_config == ALC861VD_AUTO) { |
16394 | /* automatic parse from the BIOS config */ | 16412 | /* automatic parse from the BIOS config */ |
@@ -16436,6 +16454,9 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
16436 | 16454 | ||
16437 | spec->vmaster_nid = 0x02; | 16455 | spec->vmaster_nid = 0x02; |
16438 | 16456 | ||
16457 | if (board_config == ALC861VD_AUTO) | ||
16458 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0); | ||
16459 | |||
16439 | codec->patch_ops = alc_patch_ops; | 16460 | codec->patch_ops = alc_patch_ops; |
16440 | 16461 | ||
16441 | if (board_config == ALC861VD_AUTO) | 16462 | if (board_config == ALC861VD_AUTO) |