aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-09-20 09:11:54 -0400
committerTakashi Iwai <tiwai@suse.de>2010-09-20 09:35:29 -0400
commitd433a67831ab2c470cc53a3ff9b60f656767be15 (patch)
treef2d615fd1ec1ecc5b72a825aec0c4ffa1f504a67 /sound/pci/hda/patch_realtek.c
parente1ca7b4ea29707920650d86b22afdb7e94ad5986 (diff)
ALSA: hda - Optimize the check of ALC269 codec variants
Don't call the COEF check for checking ACL269 codec variants at each time in init but remember the type at the initialization. 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.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c4d9ad70fde7..9bcf34eab679 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -393,6 +393,7 @@ struct alc_spec {
393 unsigned int no_analog :1; /* digital I/O only */ 393 unsigned int no_analog :1; /* digital I/O only */
394 unsigned int dual_adc_switch:1; /* switch ADCs (for ALC275) */ 394 unsigned int dual_adc_switch:1; /* switch ADCs (for ALC275) */
395 int init_amp; 395 int init_amp;
396 int codec_variant; /* flag for other variants */
396 397
397 /* for virtual master */ 398 /* for virtual master */
398 hda_nid_t vmaster_nid; 399 hda_nid_t vmaster_nid;
@@ -14568,6 +14569,13 @@ static int alc275_setup_dual_adc(struct hda_codec *codec)
14568 return 0; 14569 return 0;
14569} 14570}
14570 14571
14572/* different alc269-variants */
14573enum {
14574 ALC269_TYPE_NORMAL,
14575 ALC269_TYPE_ALC259,
14576 ALC269_TYPE_ALC271X,
14577};
14578
14571/* 14579/*
14572 * BIOS auto configuration 14580 * BIOS auto configuration
14573 */ 14581 */
@@ -14596,7 +14604,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
14596 if (spec->kctls.list) 14604 if (spec->kctls.list)
14597 add_mixer(spec, spec->kctls.list); 14605 add_mixer(spec, spec->kctls.list);
14598 14606
14599 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010) { 14607 if (spec->codec_variant != ALC269_TYPE_NORMAL) {
14600 add_verb(spec, alc269vb_init_verbs); 14608 add_verb(spec, alc269vb_init_verbs);
14601 alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21); 14609 alc_ssid_check(codec, 0, 0x1b, 0x14, 0x21);
14602 } else { 14610 } else {
@@ -14962,7 +14970,6 @@ static int patch_alc269(struct hda_codec *codec)
14962 struct alc_spec *spec; 14970 struct alc_spec *spec;
14963 int board_config; 14971 int board_config;
14964 int err; 14972 int err;
14965 int is_alc269vb = 0;
14966 14973
14967 spec = kzalloc(sizeof(*spec), GFP_KERNEL); 14974 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
14968 if (spec == NULL) 14975 if (spec == NULL)
@@ -14974,11 +14981,13 @@ static int patch_alc269(struct hda_codec *codec)
14974 14981
14975 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ 14982 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
14976 if (codec->bus->pci->subsystem_vendor == 0x1025 && 14983 if (codec->bus->pci->subsystem_vendor == 0x1025 &&
14977 spec->cdefine.platform_type == 1) 14984 spec->cdefine.platform_type == 1) {
14978 alc_codec_rename(codec, "ALC271X"); 14985 alc_codec_rename(codec, "ALC271X");
14979 else 14986 spec->codec_variant = ALC269_TYPE_ALC271X;
14987 } else {
14980 alc_codec_rename(codec, "ALC259"); 14988 alc_codec_rename(codec, "ALC259");
14981 is_alc269vb = 1; 14989 spec->codec_variant = ALC269_TYPE_ALC259;
14990 }
14982 } else 14991 } else
14983 alc_fix_pll_init(codec, 0x20, 0x04, 15); 14992 alc_fix_pll_init(codec, 0x20, 0x04, 15);
14984 14993
@@ -15040,7 +15049,7 @@ static int patch_alc269(struct hda_codec *codec)
15040 spec->stream_digital_capture = &alc269_pcm_digital_capture; 15049 spec->stream_digital_capture = &alc269_pcm_digital_capture;
15041 15050
15042 if (!spec->adc_nids) { /* wasn't filled automatically? use default */ 15051 if (!spec->adc_nids) { /* wasn't filled automatically? use default */
15043 if (!is_alc269vb) { 15052 if (spec->codec_variant != ALC269_TYPE_NORMAL) {
15044 spec->adc_nids = alc269_adc_nids; 15053 spec->adc_nids = alc269_adc_nids;
15045 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids); 15054 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
15046 spec->capsrc_nids = alc269_capsrc_nids; 15055 spec->capsrc_nids = alc269_capsrc_nids;