mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
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>
This commit is contained in:
parent
980f31c46b
commit
274693f370
1 changed files with 42 additions and 2 deletions
|
@ -1394,6 +1394,17 @@ static void alc_pick_fixup(struct hda_codec *codec,
|
||||||
add_verb(codec->spec, fix->verbs);
|
add_verb(codec->spec, fix->verbs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int alc_read_coef_idx(struct hda_codec *codec,
|
||||||
|
unsigned int coef_idx)
|
||||||
|
{
|
||||||
|
unsigned int val;
|
||||||
|
snd_hda_codec_write(codec, 0x20, 0, AC_VERB_SET_COEF_INDEX,
|
||||||
|
coef_idx);
|
||||||
|
val = snd_hda_codec_read(codec, 0x20, 0,
|
||||||
|
AC_VERB_GET_PROC_COEF, 0);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ALC888
|
* ALC888
|
||||||
*/
|
*/
|
||||||
|
@ -13445,6 +13456,13 @@ static int patch_alc269(struct hda_codec *codec)
|
||||||
|
|
||||||
alc_fix_pll_init(codec, 0x20, 0x04, 15);
|
alc_fix_pll_init(codec, 0x20, 0x04, 15);
|
||||||
|
|
||||||
|
if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
|
||||||
|
kfree(codec->chip_name);
|
||||||
|
codec->chip_name = kstrdup("ALC259", GFP_KERNEL);
|
||||||
|
if (!codec->chip_name)
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
|
board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
|
||||||
alc269_models,
|
alc269_models,
|
||||||
alc269_cfg_tbl);
|
alc269_cfg_tbl);
|
||||||
|
@ -17444,6 +17462,13 @@ static int patch_alc662(struct hda_codec *codec)
|
||||||
|
|
||||||
alc_fix_pll_init(codec, 0x20, 0x04, 15);
|
alc_fix_pll_init(codec, 0x20, 0x04, 15);
|
||||||
|
|
||||||
|
if (alc_read_coef_idx(codec, 0)==0x8020){
|
||||||
|
kfree(codec->chip_name);
|
||||||
|
codec->chip_name = kstrdup("ALC661", GFP_KERNEL);
|
||||||
|
if (!codec->chip_name)
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
|
board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
|
||||||
alc662_models,
|
alc662_models,
|
||||||
alc662_cfg_tbl);
|
alc662_cfg_tbl);
|
||||||
|
@ -17510,6 +17535,20 @@ static int patch_alc662(struct hda_codec *codec)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int patch_alc888(struct hda_codec *codec)
|
||||||
|
{
|
||||||
|
if ((alc_read_coef_idx(codec, 0) & 0x00f0)==0x0030){
|
||||||
|
kfree(codec->chip_name);
|
||||||
|
codec->chip_name = kstrdup("ALC888-VD", GFP_KERNEL);
|
||||||
|
if (!codec->chip_name)
|
||||||
|
return -ENOMEM;
|
||||||
|
patch_alc662(codec);
|
||||||
|
} else {
|
||||||
|
patch_alc882(codec);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* patch entries
|
* patch entries
|
||||||
*/
|
*/
|
||||||
|
@ -17541,8 +17580,9 @@ static struct hda_codec_preset snd_hda_preset_realtek[] = {
|
||||||
{ .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 },
|
{ .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 },
|
||||||
{ .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
|
{ .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
|
||||||
.patch = patch_alc882 },
|
.patch = patch_alc882 },
|
||||||
{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 },
|
{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc888 },
|
||||||
{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
|
{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
|
||||||
|
{ .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 },
|
||||||
{} /* terminator */
|
{} /* terminator */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue