aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_codec.c3
-rw-r--r--sound/pci/hda/hda_intel.c24
-rw-r--r--sound/pci/hda/patch_analog.c21
-rw-r--r--sound/pci/hda/patch_realtek.c150
4 files changed, 152 insertions, 46 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 0e76ac2b2ace..d72bcff8d271 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -4218,7 +4218,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
4218 break; 4218 break;
4219 case AC_JACK_MIC_IN: { 4219 case AC_JACK_MIC_IN: {
4220 int preferred, alt; 4220 int preferred, alt;
4221 if (loc == AC_JACK_LOC_FRONT) { 4221 if (loc == AC_JACK_LOC_FRONT ||
4222 (loc & 0x30) == AC_JACK_LOC_INTERNAL) {
4222 preferred = AUTO_PIN_FRONT_MIC; 4223 preferred = AUTO_PIN_FRONT_MIC;
4223 alt = AUTO_PIN_MIC; 4224 alt = AUTO_PIN_MIC;
4224 } else { 4225 } else {
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 4bb90675f70f..b185afd581f1 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -84,7 +84,7 @@ module_param_array(bdl_pos_adj, int, NULL, 0644);
84MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); 84MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset.");
85module_param_array(probe_mask, int, NULL, 0444); 85module_param_array(probe_mask, int, NULL, 0444);
86MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); 86MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1).");
87module_param_array(probe_only, bool, NULL, 0444); 87module_param_array(probe_only, int, NULL, 0444);
88MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); 88MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization.");
89module_param(single_cmd, bool, 0444); 89module_param(single_cmd, bool, 0444);
90MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " 90MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs "
@@ -858,10 +858,13 @@ static void azx_power_notify(struct hda_bus *bus);
858#endif 858#endif
859 859
860/* reset codec link */ 860/* reset codec link */
861static int azx_reset(struct azx *chip) 861static int azx_reset(struct azx *chip, int full_reset)
862{ 862{
863 int count; 863 int count;
864 864
865 if (!full_reset)
866 goto __skip;
867
865 /* clear STATESTS */ 868 /* clear STATESTS */
866 azx_writeb(chip, STATESTS, STATESTS_INT_MASK); 869 azx_writeb(chip, STATESTS, STATESTS_INT_MASK);
867 870
@@ -887,6 +890,7 @@ static int azx_reset(struct azx *chip)
887 /* Brent Chartrand said to wait >= 540us for codecs to initialize */ 890 /* Brent Chartrand said to wait >= 540us for codecs to initialize */
888 msleep(1); 891 msleep(1);
889 892
893 __skip:
890 /* check to see if controller is ready */ 894 /* check to see if controller is ready */
891 if (!azx_readb(chip, GCTL)) { 895 if (!azx_readb(chip, GCTL)) {
892 snd_printd(SFX "azx_reset: controller not ready!\n"); 896 snd_printd(SFX "azx_reset: controller not ready!\n");
@@ -998,13 +1002,13 @@ static void azx_stream_stop(struct azx *chip, struct azx_dev *azx_dev)
998/* 1002/*
999 * reset and start the controller registers 1003 * reset and start the controller registers
1000 */ 1004 */
1001static void azx_init_chip(struct azx *chip) 1005static void azx_init_chip(struct azx *chip, int full_reset)
1002{ 1006{
1003 if (chip->initialized) 1007 if (chip->initialized)
1004 return; 1008 return;
1005 1009
1006 /* reset controller */ 1010 /* reset controller */
1007 azx_reset(chip); 1011 azx_reset(chip, full_reset);
1008 1012
1009 /* initialize interrupts */ 1013 /* initialize interrupts */
1010 azx_int_clear(chip); 1014 azx_int_clear(chip);
@@ -1348,7 +1352,7 @@ static void azx_bus_reset(struct hda_bus *bus)
1348 1352
1349 bus->in_reset = 1; 1353 bus->in_reset = 1;
1350 azx_stop_chip(chip); 1354 azx_stop_chip(chip);
1351 azx_init_chip(chip); 1355 azx_init_chip(chip, 1);
1352#ifdef CONFIG_PM 1356#ifdef CONFIG_PM
1353 if (chip->initialized) { 1357 if (chip->initialized) {
1354 int i; 1358 int i;
@@ -1422,7 +1426,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
1422 * get back to the sanity state. 1426 * get back to the sanity state.
1423 */ 1427 */
1424 azx_stop_chip(chip); 1428 azx_stop_chip(chip);
1425 azx_init_chip(chip); 1429 azx_init_chip(chip, 1);
1426 } 1430 }
1427 } 1431 }
1428 } 1432 }
@@ -2112,7 +2116,7 @@ static void azx_power_notify(struct hda_bus *bus)
2112 } 2116 }
2113 } 2117 }
2114 if (power_on) 2118 if (power_on)
2115 azx_init_chip(chip); 2119 azx_init_chip(chip, 1);
2116 else if (chip->running && power_save_controller && 2120 else if (chip->running && power_save_controller &&
2117 !bus->power_keep_link_on) 2121 !bus->power_keep_link_on)
2118 azx_stop_chip(chip); 2122 azx_stop_chip(chip);
@@ -2182,7 +2186,7 @@ static int azx_resume(struct pci_dev *pci)
2182 azx_init_pci(chip); 2186 azx_init_pci(chip);
2183 2187
2184 if (snd_hda_codecs_inuse(chip->bus)) 2188 if (snd_hda_codecs_inuse(chip->bus))
2185 azx_init_chip(chip); 2189 azx_init_chip(chip, 1);
2186 2190
2187 snd_hda_resume(chip->bus); 2191 snd_hda_resume(chip->bus);
2188 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2192 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
@@ -2574,7 +2578,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
2574 2578
2575 /* initialize chip */ 2579 /* initialize chip */
2576 azx_init_pci(chip); 2580 azx_init_pci(chip);
2577 azx_init_chip(chip); 2581 azx_init_chip(chip, (probe_only[dev] & 2) == 0);
2578 2582
2579 /* codec detection */ 2583 /* codec detection */
2580 if (!chip->codec_mask) { 2584 if (!chip->codec_mask) {
@@ -2663,7 +2667,7 @@ static int __devinit azx_probe(struct pci_dev *pci,
2663 goto out_free; 2667 goto out_free;
2664 } 2668 }
2665#endif 2669#endif
2666 if (!probe_only[dev]) { 2670 if ((probe_only[dev] & 1) == 0) {
2667 err = azx_codec_configure(chip); 2671 err = azx_codec_configure(chip);
2668 if (err < 0) 2672 if (err < 0)
2669 goto out_free; 2673 goto out_free;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index e6d1bdff1b6e..262f5b5decf1 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -71,9 +71,10 @@ struct ad198x_spec {
71 struct hda_input_mux private_imux; 71 struct hda_input_mux private_imux;
72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 72 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
73 73
74 unsigned int jack_present :1; 74 unsigned int jack_present: 1;
75 unsigned int inv_jack_detect:1; /* inverted jack-detection */ 75 unsigned int inv_jack_detect: 1;/* inverted jack-detection */
76 unsigned int inv_eapd:1; /* inverted EAPD implementation */ 76 unsigned int inv_eapd: 1; /* inverted EAPD implementation */
77 unsigned int analog_beep: 1; /* analog beep input present */
77 78
78#ifdef CONFIG_SND_HDA_POWER_SAVE 79#ifdef CONFIG_SND_HDA_POWER_SAVE
79 struct hda_loopback_check loopback; 80 struct hda_loopback_check loopback;
@@ -165,6 +166,12 @@ static struct snd_kcontrol_new ad_beep_mixer[] = {
165 { } /* end */ 166 { } /* end */
166}; 167};
167 168
169static struct snd_kcontrol_new ad_beep2_mixer[] = {
170 HDA_CODEC_VOLUME("Digital Beep Playback Volume", 0, 0, HDA_OUTPUT),
171 HDA_CODEC_MUTE_BEEP("Digital Beep Playback Switch", 0, 0, HDA_OUTPUT),
172 { } /* end */
173};
174
168#define set_beep_amp(spec, nid, idx, dir) \ 175#define set_beep_amp(spec, nid, idx, dir) \
169 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */ 176 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 1, idx, dir)) /* mono */
170#else 177#else
@@ -203,7 +210,8 @@ static int ad198x_build_controls(struct hda_codec *codec)
203#ifdef CONFIG_SND_HDA_INPUT_BEEP 210#ifdef CONFIG_SND_HDA_INPUT_BEEP
204 if (spec->beep_amp) { 211 if (spec->beep_amp) {
205 struct snd_kcontrol_new *knew; 212 struct snd_kcontrol_new *knew;
206 for (knew = ad_beep_mixer; knew->name; knew++) { 213 knew = spec->analog_beep ? ad_beep2_mixer : ad_beep_mixer;
214 for ( ; knew->name; knew++) {
207 struct snd_kcontrol *kctl; 215 struct snd_kcontrol *kctl;
208 kctl = snd_ctl_new1(knew, codec); 216 kctl = snd_ctl_new1(knew, codec);
209 if (!kctl) 217 if (!kctl)
@@ -3482,6 +3490,8 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = {
3482 HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT), 3490 HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT),
3483 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT), 3491 HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT),
3484 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT), 3492 HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT),
3493 HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT),
3494 HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT),
3485 HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT), 3495 HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT),
3486 HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT), 3496 HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT),
3487 HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), 3497 HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT),
@@ -3523,6 +3533,8 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = {
3523 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, 3533 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
3524 /* docking mic boost */ 3534 /* docking mic boost */
3525 {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 3535 {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
3536 /* Analog PC Beeper - allow firmware/ACPI beeps */
3537 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3) | 0x1a},
3526 /* Analog mixer - docking mic; mute as default */ 3538 /* Analog mixer - docking mic; mute as default */
3527 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, 3539 {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)},
3528 /* enable EAPD bit */ 3540 /* enable EAPD bit */
@@ -3655,6 +3667,7 @@ static int patch_ad1984(struct hda_codec *codec)
3655 spec->input_mux = &ad1984_thinkpad_capture_source; 3667 spec->input_mux = &ad1984_thinkpad_capture_source;
3656 spec->mixers[0] = ad1984_thinkpad_mixers; 3668 spec->mixers[0] = ad1984_thinkpad_mixers;
3657 spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs; 3669 spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs;
3670 spec->analog_beep = 1;
3658 break; 3671 break;
3659 case AD1984_DELL_DESKTOP: 3672 case AD1984_DELL_DESKTOP:
3660 spec->multiout.dig_out_nid = 0; 3673 spec->multiout.dig_out_nid = 0;
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index bc55c1e96df5..edd5071cf011 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -275,6 +275,18 @@ struct alc_mic_route {
275 275
276#define MUX_IDX_UNDEF ((unsigned char)-1) 276#define MUX_IDX_UNDEF ((unsigned char)-1)
277 277
278struct alc_customize_define {
279 unsigned int sku_cfg;
280 unsigned char port_connectivity;
281 unsigned char check_sum;
282 unsigned char customization;
283 unsigned char external_amp;
284 unsigned int enable_pcbeep:1;
285 unsigned int platform_type:1;
286 unsigned int swap:1;
287 unsigned int override:1;
288};
289
278struct alc_spec { 290struct alc_spec {
279 /* codec parameterization */ 291 /* codec parameterization */
280 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */ 292 struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
@@ -332,6 +344,7 @@ struct alc_spec {
332 344
333 /* dynamic controls, init_verbs and input_mux */ 345 /* dynamic controls, init_verbs and input_mux */
334 struct auto_pin_cfg autocfg; 346 struct auto_pin_cfg autocfg;
347 struct alc_customize_define cdefine;
335 struct snd_array kctls; 348 struct snd_array kctls;
336 struct hda_input_mux private_imux[3]; 349 struct hda_input_mux private_imux[3];
337 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; 350 hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS];
@@ -1247,6 +1260,62 @@ static void alc_init_auto_mic(struct hda_codec *codec)
1247 spec->unsol_event = alc_sku_unsol_event; 1260 spec->unsol_event = alc_sku_unsol_event;
1248} 1261}
1249 1262
1263static int alc_auto_parse_customize_define(struct hda_codec *codec)
1264{
1265 unsigned int ass, tmp, i;
1266 unsigned nid = 0;
1267 struct alc_spec *spec = codec->spec;
1268
1269 ass = codec->subsystem_id & 0xffff;
1270 if (ass != codec->bus->pci->subsystem_device && (ass & 1))
1271 goto do_sku;
1272
1273 nid = 0x1d;
1274 if (codec->vendor_id == 0x10ec0260)
1275 nid = 0x17;
1276 ass = snd_hda_codec_get_pincfg(codec, nid);
1277
1278 if (!(ass & 1)) {
1279 printk(KERN_INFO "hda_codec: %s: SKU not ready 0x%08x\n",
1280 codec->chip_name, ass);
1281 return -1;
1282 }
1283
1284 /* check sum */
1285 tmp = 0;
1286 for (i = 1; i < 16; i++) {
1287 if ((ass >> i) & 1)
1288 tmp++;
1289 }
1290 if (((ass >> 16) & 0xf) != tmp)
1291 return -1;
1292
1293 spec->cdefine.port_connectivity = ass >> 30;
1294 spec->cdefine.enable_pcbeep = (ass & 0x100000) >> 20;
1295 spec->cdefine.check_sum = (ass >> 16) & 0xf;
1296 spec->cdefine.customization = ass >> 8;
1297do_sku:
1298 spec->cdefine.sku_cfg = ass;
1299 spec->cdefine.external_amp = (ass & 0x38) >> 3;
1300 spec->cdefine.platform_type = (ass & 0x4) >> 2;
1301 spec->cdefine.swap = (ass & 0x2) >> 1;
1302 spec->cdefine.override = ass & 0x1;
1303
1304 snd_printd("SKU: Nid=0x%x sku_cfg=0x%08x\n",
1305 nid, spec->cdefine.sku_cfg);
1306 snd_printd("SKU: port_connectivity=0x%x\n",
1307 spec->cdefine.port_connectivity);
1308 snd_printd("SKU: enable_pcbeep=0x%x\n", spec->cdefine.enable_pcbeep);
1309 snd_printd("SKU: check_sum=0x%08x\n", spec->cdefine.check_sum);
1310 snd_printd("SKU: customization=0x%08x\n", spec->cdefine.customization);
1311 snd_printd("SKU: external_amp=0x%x\n", spec->cdefine.external_amp);
1312 snd_printd("SKU: platform_type=0x%x\n", spec->cdefine.platform_type);
1313 snd_printd("SKU: swap=0x%x\n", spec->cdefine.swap);
1314 snd_printd("SKU: override=0x%x\n", spec->cdefine.override);
1315
1316 return 0;
1317}
1318
1250/* check subsystem ID and set up device-specific initialization; 1319/* check subsystem ID and set up device-specific initialization;
1251 * return 1 if initialized, 0 if invalid SSID 1320 * return 1 if initialized, 0 if invalid SSID
1252 */ 1321 */
@@ -3780,6 +3849,17 @@ static struct hda_codec_ops alc_patch_ops = {
3780 .reboot_notify = alc_shutup, 3849 .reboot_notify = alc_shutup,
3781}; 3850};
3782 3851
3852/* replace the codec chip_name with the given string */
3853static int alc_codec_rename(struct hda_codec *codec, const char *name)
3854{
3855 kfree(codec->chip_name);
3856 codec->chip_name = kstrdup(name, GFP_KERNEL);
3857 if (!codec->chip_name) {
3858 alc_free(codec);
3859 return -ENOMEM;
3860 }
3861 return 0;
3862}
3783 3863
3784/* 3864/*
3785 * Test configuration for debugging 3865 * Test configuration for debugging
@@ -10271,6 +10351,8 @@ static int patch_alc882(struct hda_codec *codec)
10271 10351
10272 codec->spec = spec; 10352 codec->spec = spec;
10273 10353
10354 alc_auto_parse_customize_define(codec);
10355
10274 switch (codec->vendor_id) { 10356 switch (codec->vendor_id) {
10275 case 0x10ec0882: 10357 case 0x10ec0882:
10276 case 0x10ec0885: 10358 case 0x10ec0885:
@@ -10366,7 +10448,9 @@ static int patch_alc882(struct hda_codec *codec)
10366 } 10448 }
10367 10449
10368 set_capture_mixer(codec); 10450 set_capture_mixer(codec);
10369 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 10451
10452 if (spec->cdefine.enable_pcbeep)
10453 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
10370 10454
10371 spec->vmaster_nid = 0x0c; 10455 spec->vmaster_nid = 0x0c;
10372 10456
@@ -12150,6 +12234,7 @@ static int patch_alc262(struct hda_codec *codec)
12150 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); 12234 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
12151 } 12235 }
12152#endif 12236#endif
12237 alc_auto_parse_customize_define(codec);
12153 12238
12154 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 12239 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
12155 12240
@@ -12228,7 +12313,7 @@ static int patch_alc262(struct hda_codec *codec)
12228 } 12313 }
12229 if (!spec->cap_mixer && !spec->no_analog) 12314 if (!spec->cap_mixer && !spec->no_analog)
12230 set_capture_mixer(codec); 12315 set_capture_mixer(codec);
12231 if (!spec->no_analog) 12316 if (!spec->no_analog && spec->cdefine.enable_pcbeep)
12232 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 12317 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
12233 12318
12234 spec->vmaster_nid = 0x0c; 12319 spec->vmaster_nid = 0x0c;
@@ -14098,17 +14183,17 @@ static int patch_alc269(struct hda_codec *codec)
14098 14183
14099 codec->spec = spec; 14184 codec->spec = spec;
14100 14185
14101 alc_fix_pll_init(codec, 0x20, 0x04, 15); 14186 alc_auto_parse_customize_define(codec);
14102 14187
14103 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ 14188 if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){
14104 kfree(codec->chip_name); 14189 if (codec->bus->pci->subsystem_vendor == 0x1025 &&
14105 codec->chip_name = kstrdup("ALC259", GFP_KERNEL); 14190 spec->cdefine.platform_type == 1)
14106 if (!codec->chip_name) { 14191 alc_codec_rename(codec, "ALC271X");
14107 alc_free(codec); 14192 else
14108 return -ENOMEM; 14193 alc_codec_rename(codec, "ALC259");
14109 }
14110 is_alc269vb = 1; 14194 is_alc269vb = 1;
14111 } 14195 } else
14196 alc_fix_pll_init(codec, 0x20, 0x04, 15);
14112 14197
14113 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, 14198 board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST,
14114 alc269_models, 14199 alc269_models,
@@ -14168,7 +14253,8 @@ static int patch_alc269(struct hda_codec *codec)
14168 14253
14169 if (!spec->cap_mixer) 14254 if (!spec->cap_mixer)
14170 set_capture_mixer(codec); 14255 set_capture_mixer(codec);
14171 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 14256 if (spec->cdefine.enable_pcbeep)
14257 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
14172 14258
14173 spec->vmaster_nid = 0x02; 14259 spec->vmaster_nid = 0x02;
14174 14260
@@ -18318,16 +18404,16 @@ static int patch_alc662(struct hda_codec *codec)
18318 18404
18319 codec->spec = spec; 18405 codec->spec = spec;
18320 18406
18407 alc_auto_parse_customize_define(codec);
18408
18321 alc_fix_pll_init(codec, 0x20, 0x04, 15); 18409 alc_fix_pll_init(codec, 0x20, 0x04, 15);
18322 18410
18323 if (alc_read_coef_idx(codec, 0)==0x8020){ 18411 if (alc_read_coef_idx(codec, 0) == 0x8020)
18324 kfree(codec->chip_name); 18412 alc_codec_rename(codec, "ALC661");
18325 codec->chip_name = kstrdup("ALC661", GFP_KERNEL); 18413 else if ((alc_read_coef_idx(codec, 0) & (1 << 14)) &&
18326 if (!codec->chip_name) { 18414 codec->bus->pci->subsystem_vendor == 0x1025 &&
18327 alc_free(codec); 18415 spec->cdefine.platform_type == 1)
18328 return -ENOMEM; 18416 alc_codec_rename(codec, "ALC272X");
18329 }
18330 }
18331 18417
18332 board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST, 18418 board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST,
18333 alc662_models, 18419 alc662_models,
@@ -18377,18 +18463,20 @@ static int patch_alc662(struct hda_codec *codec)
18377 if (!spec->cap_mixer) 18463 if (!spec->cap_mixer)
18378 set_capture_mixer(codec); 18464 set_capture_mixer(codec);
18379 18465
18380 switch (codec->vendor_id) { 18466 if (spec->cdefine.enable_pcbeep) {
18381 case 0x10ec0662: 18467 switch (codec->vendor_id) {
18382 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); 18468 case 0x10ec0662:
18383 break; 18469 set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
18384 case 0x10ec0272: 18470 break;
18385 case 0x10ec0663: 18471 case 0x10ec0272:
18386 case 0x10ec0665: 18472 case 0x10ec0663:
18387 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); 18473 case 0x10ec0665:
18388 break; 18474 set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
18389 case 0x10ec0273: 18475 break;
18390 set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); 18476 case 0x10ec0273:
18391 break; 18477 set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT);
18478 break;
18479 }
18392 } 18480 }
18393 spec->vmaster_nid = 0x02; 18481 spec->vmaster_nid = 0x02;
18394 18482