aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKailang Yang <kailang@realtek.com.tw>2009-12-03 04:07:50 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-03 04:07:50 -0500
commit274693f37090ada2cadd09944ab883f05ea6ebe6 (patch)
tree584957b584188ef83787745d3a505286be7058bb /sound
parent980f31c46b3c7895ad926fbb43c8edac6ce193ff (diff)
ALSA: hda - Add ALC661/259, ALC892/888VD support
Fixed List: 1. Add alc_read_coef_idx function 2. Add ALC661 ALC259 3. Add ALC892 ALC888VD Signed-off-by: Kailang Yang <kailang@realtek.com.tw> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index a38a81e53863..98e117bac90a 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1394,6 +1394,17 @@ static void alc_pick_fixup(struct hda_codec *codec,
1394 add_verb(codec->spec, fix->verbs); 1394 add_verb(codec->spec, fix->verbs);
1395} 1395}
1396 1396
1397static int alc_read_coef_idx(struct hda_codec *codec,
1398 unsigned int coef_idx)
1399{
1400 unsigned int val;
1401 snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX,
1402 coef_idx);
1403 val = snd_hda_codec_read(codec, 0x20, 0,
1404 AC_VERB_GET_PROC_COEF, 0);
1405 return val;
1406}
1407
1397/* 1408/*
1398 * ALC888 1409 * ALC888
1399 */ 1410 */
@@ -3472,7 +3483,7 @@ static int alc_build_pcms(struct hda_codec *codec)
3472 snprintf(spec->stream_name_analog, sizeof(spec->stream_name_analog), 3483 snprintf(spec->stream_name_analog, sizeof(spec->stream_name_analog),
3473 "%s Analog", codec->chip_name); 3484 "%s Analog", codec->chip_name);
3474 info->name = spec->stream_name_analog; 3485 info->name = spec->stream_name_analog;
3475 3486
3476 if (spec->stream_analog_playback) { 3487 if (spec->stream_analog_playback) {
3477 if (snd_BUG_ON(!spec->multiout.dac_nids)) 3488 if (snd_BUG_ON(!spec->multiout.dac_nids))
3478 return -EINVAL; 3489 return -EINVAL;
@@ -13445,6 +13456,13 @@ static int patch_alc269(struct hda_codec *codec)
13445 13456
13446 alc_fix_pll_init(codec, 0x20, 0x04, 15); 13457 alc_fix_pll_init(codec, 0x20, 0x04, 15);
13447 13458
13459 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
13460 kfree(codec->chip_name);
13461 codec->chip_name = kstrdup("ALC259", GFP_KERNEL);
13462 if (!codec->chip_name)
13463 return -ENOMEM;
13464 }
13465
13448 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, 13466 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
13449 alc269_models, 13467 alc269_models,
13450 alc269_cfg_tbl); 13468 alc269_cfg_tbl);
@@ -17444,6 +17462,13 @@ static int patch_alc662(struct hda_codec *codec)
17444 17462
17445 alc_fix_pll_init(codec, 0x20, 0x04, 15); 17463 alc_fix_pll_init(codec, 0x20, 0x04, 15);
17446 17464
17465 if (alc_read_coef_idx(codec, 0)==0x8020){
17466 kfree(codec->chip_name);
17467 codec->chip_name = kstrdup("ALC661", GFP_KERNEL);
17468 if (!codec->chip_name)
17469 return -ENOMEM;
17470 }
17471
17447 board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST, 17472 board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
17448 alc662_models, 17473 alc662_models,
17449 alc662_cfg_tbl); 17474 alc662_cfg_tbl);
@@ -17510,6 +17535,20 @@ static int patch_alc662(struct hda_codec *codec)
17510 return 0; 17535 return 0;
17511} 17536}
17512 17537
17538static int patch_alc888(struct hda_codec *codec)
17539{
17540 if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){
17541 kfree(codec->chip_name);
17542 codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL);
17543 if (!codec->chip_name)
17544 return -ENOMEM;
17545 patch_alc662(codec);
17546 } else {
17547 patch_alc882(codec);
17548 }
17549 return 0;
17550}
17551
17513/* 17552/*
17514 * patch entries 17553 * patch entries
17515 */ 17554 */
@@ -17541,8 +17580,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
17541 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 }, 17580 { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 },
17542 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200", 17581 { .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
17543 .patch = patch_alc882 }, 17582 .patch = patch_alc882 },
17544 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 }, 17583 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
17545 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 }, 17584 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
17585 { .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 },
17546 {} /* terminator */ 17586 {} /* terminator */
17547}; 17587};
17548 17588