diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 24 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 21 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 150 |
4 files changed, 157 insertions, 46 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 0e76ac2b2ace..d1424e7b9f3d 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1461,6 +1461,8 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, | |||
1461 | info = get_alloc_amp_hash(codec, HDA_HASH_KEY(nid, direction, idx)); | 1461 | info = get_alloc_amp_hash(codec, HDA_HASH_KEY(nid, direction, idx)); |
1462 | if (!info) | 1462 | if (!info) |
1463 | return 0; | 1463 | return 0; |
1464 | if (snd_BUG_ON(mask & ~0xff)) | ||
1465 | mask &= 0xff; | ||
1464 | val &= mask; | 1466 | val &= mask; |
1465 | val |= get_vol_mute(codec, info, nid, ch, direction, idx) & ~mask; | 1467 | val |= get_vol_mute(codec, info, nid, ch, direction, idx) & ~mask; |
1466 | if (info->vol[ch] == val) | 1468 | if (info->vol[ch] == val) |
@@ -1486,6 +1488,9 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, | |||
1486 | int direction, int idx, int mask, int val) | 1488 | int direction, int idx, int mask, int val) |
1487 | { | 1489 | { |
1488 | int ch, ret = 0; | 1490 | int ch, ret = 0; |
1491 | |||
1492 | if (snd_BUG_ON(mask & ~0xff)) | ||
1493 | mask &= 0xff; | ||
1489 | for (ch = 0; ch < 2; ch++) | 1494 | for (ch = 0; ch < 2; ch++) |
1490 | ret |= snd_hda_codec_amp_update(codec, nid, ch, direction, | 1495 | ret |= snd_hda_codec_amp_update(codec, nid, ch, direction, |
1491 | idx, mask, val); | 1496 | idx, mask, val); |
@@ -4218,7 +4223,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
4218 | break; | 4223 | break; |
4219 | case AC_JACK_MIC_IN: { | 4224 | case AC_JACK_MIC_IN: { |
4220 | int preferred, alt; | 4225 | int preferred, alt; |
4221 | if (loc == AC_JACK_LOC_FRONT) { | 4226 | if (loc == AC_JACK_LOC_FRONT || |
4227 | (loc & 0x30) == AC_JACK_LOC_INTERNAL) { | ||
4222 | preferred = AUTO_PIN_FRONT_MIC; | 4228 | preferred = AUTO_PIN_FRONT_MIC; |
4223 | alt = AUTO_PIN_MIC; | 4229 | alt = AUTO_PIN_MIC; |
4224 | } else { | 4230 | } 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); | |||
84 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); | 84 | MODULE_PARM_DESC(bdl_pos_adj, "BDL position adjustment offset."); |
85 | module_param_array(probe_mask, int, NULL, 0444); | 85 | module_param_array(probe_mask, int, NULL, 0444); |
86 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); | 86 | MODULE_PARM_DESC(probe_mask, "Bitmask to probe codecs (default = -1)."); |
87 | module_param_array(probe_only, bool, NULL, 0444); | 87 | module_param_array(probe_only, int, NULL, 0444); |
88 | MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); | 88 | MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); |
89 | module_param(single_cmd, bool, 0444); | 89 | module_param(single_cmd, bool, 0444); |
90 | MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " | 90 | MODULE_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 */ |
861 | static int azx_reset(struct azx *chip) | 861 | static 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 | */ |
1001 | static void azx_init_chip(struct azx *chip) | 1005 | static 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 | ||
169 | static 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 ca93c4cc144e..1694f60631a1 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 | ||
278 | struct 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 | |||
278 | struct alc_spec { | 290 | struct 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 | ||
1263 | static 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; | ||
1297 | do_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 */ | ||
3853 | static 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 |
@@ -10335,6 +10415,8 @@ static int patch_alc882(struct hda_codec *codec) | |||
10335 | 10415 | ||
10336 | codec->spec = spec; | 10416 | codec->spec = spec; |
10337 | 10417 | ||
10418 | alc_auto_parse_customize_define(codec); | ||
10419 | |||
10338 | switch (codec->vendor_id) { | 10420 | switch (codec->vendor_id) { |
10339 | case 0x10ec0882: | 10421 | case 0x10ec0882: |
10340 | case 0x10ec0885: | 10422 | case 0x10ec0885: |
@@ -10430,7 +10512,9 @@ static int patch_alc882(struct hda_codec *codec) | |||
10430 | } | 10512 | } |
10431 | 10513 | ||
10432 | set_capture_mixer(codec); | 10514 | set_capture_mixer(codec); |
10433 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10515 | |
10516 | if (spec->cdefine.enable_pcbeep) | ||
10517 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | ||
10434 | 10518 | ||
10435 | spec->vmaster_nid = 0x0c; | 10519 | spec->vmaster_nid = 0x0c; |
10436 | 10520 | ||
@@ -12214,6 +12298,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12214 | snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); | 12298 | snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); |
12215 | } | 12299 | } |
12216 | #endif | 12300 | #endif |
12301 | alc_auto_parse_customize_define(codec); | ||
12217 | 12302 | ||
12218 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); | 12303 | alc_fix_pll_init(codec, 0x20, 0x0a, 10); |
12219 | 12304 | ||
@@ -12292,7 +12377,7 @@ static int patch_alc262(struct hda_codec *codec) | |||
12292 | } | 12377 | } |
12293 | if (!spec->cap_mixer && !spec->no_analog) | 12378 | if (!spec->cap_mixer && !spec->no_analog) |
12294 | set_capture_mixer(codec); | 12379 | set_capture_mixer(codec); |
12295 | if (!spec->no_analog) | 12380 | if (!spec->no_analog && spec->cdefine.enable_pcbeep) |
12296 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 12381 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
12297 | 12382 | ||
12298 | spec->vmaster_nid = 0x0c; | 12383 | spec->vmaster_nid = 0x0c; |
@@ -14162,17 +14247,17 @@ static int patch_alc269(struct hda_codec *codec) | |||
14162 | 14247 | ||
14163 | codec->spec = spec; | 14248 | codec->spec = spec; |
14164 | 14249 | ||
14165 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 14250 | alc_auto_parse_customize_define(codec); |
14166 | 14251 | ||
14167 | if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ | 14252 | if ((alc_read_coef_idx(codec, 0) & 0x00f0) == 0x0010){ |
14168 | kfree(codec->chip_name); | 14253 | if (codec->bus->pci->subsystem_vendor == 0x1025 && |
14169 | codec->chip_name = kstrdup("ALC259", GFP_KERNEL); | 14254 | spec->cdefine.platform_type == 1) |
14170 | if (!codec->chip_name) { | 14255 | alc_codec_rename(codec, "ALC271X"); |
14171 | alc_free(codec); | 14256 | else |
14172 | return -ENOMEM; | 14257 | alc_codec_rename(codec, "ALC259"); |
14173 | } | ||
14174 | is_alc269vb = 1; | 14258 | is_alc269vb = 1; |
14175 | } | 14259 | } else |
14260 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | ||
14176 | 14261 | ||
14177 | board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, | 14262 | board_config = snd_hda_check_board_config(codec, ALC269_MODEL_LAST, |
14178 | alc269_models, | 14263 | alc269_models, |
@@ -14234,7 +14319,8 @@ static int patch_alc269(struct hda_codec *codec) | |||
14234 | 14319 | ||
14235 | if (!spec->cap_mixer) | 14320 | if (!spec->cap_mixer) |
14236 | set_capture_mixer(codec); | 14321 | set_capture_mixer(codec); |
14237 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14322 | if (spec->cdefine.enable_pcbeep) |
14323 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | ||
14238 | 14324 | ||
14239 | spec->vmaster_nid = 0x02; | 14325 | spec->vmaster_nid = 0x02; |
14240 | 14326 | ||
@@ -18384,16 +18470,16 @@ static int patch_alc662(struct hda_codec *codec) | |||
18384 | 18470 | ||
18385 | codec->spec = spec; | 18471 | codec->spec = spec; |
18386 | 18472 | ||
18473 | alc_auto_parse_customize_define(codec); | ||
18474 | |||
18387 | alc_fix_pll_init(codec, 0x20, 0x04, 15); | 18475 | alc_fix_pll_init(codec, 0x20, 0x04, 15); |
18388 | 18476 | ||
18389 | if (alc_read_coef_idx(codec, 0)==0x8020){ | 18477 | if (alc_read_coef_idx(codec, 0) == 0x8020) |
18390 | kfree(codec->chip_name); | 18478 | alc_codec_rename(codec, "ALC661"); |
18391 | codec->chip_name = kstrdup("ALC661", GFP_KERNEL); | 18479 | else if ((alc_read_coef_idx(codec, 0) & (1 << 14)) && |
18392 | if (!codec->chip_name) { | 18480 | codec->bus->pci->subsystem_vendor == 0x1025 && |
18393 | alc_free(codec); | 18481 | spec->cdefine.platform_type == 1) |
18394 | return -ENOMEM; | 18482 | alc_codec_rename(codec, "ALC272X"); |
18395 | } | ||
18396 | } | ||
18397 | 18483 | ||
18398 | board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST, | 18484 | board_config = snd_hda_check_board_config(codec, ALC662_MODEL_LAST, |
18399 | alc662_models, | 18485 | alc662_models, |
@@ -18443,18 +18529,20 @@ static int patch_alc662(struct hda_codec *codec) | |||
18443 | if (!spec->cap_mixer) | 18529 | if (!spec->cap_mixer) |
18444 | set_capture_mixer(codec); | 18530 | set_capture_mixer(codec); |
18445 | 18531 | ||
18446 | switch (codec->vendor_id) { | 18532 | if (spec->cdefine.enable_pcbeep) { |
18447 | case 0x10ec0662: | 18533 | switch (codec->vendor_id) { |
18448 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 18534 | case 0x10ec0662: |
18449 | break; | 18535 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
18450 | case 0x10ec0272: | 18536 | break; |
18451 | case 0x10ec0663: | 18537 | case 0x10ec0272: |
18452 | case 0x10ec0665: | 18538 | case 0x10ec0663: |
18453 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 18539 | case 0x10ec0665: |
18454 | break; | 18540 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
18455 | case 0x10ec0273: | 18541 | break; |
18456 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); | 18542 | case 0x10ec0273: |
18457 | break; | 18543 | set_beep_amp(spec, 0x0b, 0x03, HDA_INPUT); |
18544 | break; | ||
18545 | } | ||
18458 | } | 18546 | } |
18459 | spec->vmaster_nid = 0x02; | 18547 | spec->vmaster_nid = 0x02; |
18460 | 18548 | ||