diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-03-26 10:28:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-03-26 10:28:41 -0400 |
commit | 5266874b09c8a9de744813dd0f7387f02e8191bf (patch) | |
tree | c30530ae29e10f18f497040ab087a91651166e6f /sound/pci | |
parent | 05471e4c446ca42d474b89df55bd48b0ce802717 (diff) | |
parent | 079e683ebd882655b6d6e0b17989e51bae2d77d6 (diff) |
Merge remote branch 'alsa/devel' into topic/hda
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 24 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 21 |
2 files changed, 31 insertions, 14 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 8b2915631cc3..a33c1c50b310 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); |
@@ -2573,7 +2577,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, | |||
2573 | 2577 | ||
2574 | /* initialize chip */ | 2578 | /* initialize chip */ |
2575 | azx_init_pci(chip); | 2579 | azx_init_pci(chip); |
2576 | azx_init_chip(chip); | 2580 | azx_init_chip(chip, (probe_only[dev] & 2) == 0); |
2577 | 2581 | ||
2578 | /* codec detection */ | 2582 | /* codec detection */ |
2579 | if (!chip->codec_mask) { | 2583 | if (!chip->codec_mask) { |
@@ -2662,7 +2666,7 @@ static int __devinit azx_probe(struct pci_dev *pci, | |||
2662 | goto out_free; | 2666 | goto out_free; |
2663 | } | 2667 | } |
2664 | #endif | 2668 | #endif |
2665 | if (!probe_only[dev]) { | 2669 | if ((probe_only[dev] & 1) == 0) { |
2666 | err = azx_codec_configure(chip); | 2670 | err = azx_codec_configure(chip); |
2667 | if (err < 0) | 2671 | if (err < 0) |
2668 | goto out_free; | 2672 | 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; |