diff options
Diffstat (limited to 'sound/pci/hda/patch_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index af34606c30c3..afbe314a5bf3 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) |
@@ -519,14 +527,6 @@ static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) | |||
519 | ad198x_power_eapd(codec); | 527 | ad198x_power_eapd(codec); |
520 | return 0; | 528 | return 0; |
521 | } | 529 | } |
522 | |||
523 | static int ad198x_resume(struct hda_codec *codec) | ||
524 | { | ||
525 | ad198x_init(codec); | ||
526 | snd_hda_codec_resume_amp(codec); | ||
527 | snd_hda_codec_resume_cache(codec); | ||
528 | return 0; | ||
529 | } | ||
530 | #endif | 530 | #endif |
531 | 531 | ||
532 | static struct hda_codec_ops ad198x_patch_ops = { | 532 | static struct hda_codec_ops ad198x_patch_ops = { |
@@ -539,7 +539,6 @@ static struct hda_codec_ops ad198x_patch_ops = { | |||
539 | #endif | 539 | #endif |
540 | #ifdef SND_HDA_NEEDS_RESUME | 540 | #ifdef SND_HDA_NEEDS_RESUME |
541 | .suspend = ad198x_suspend, | 541 | .suspend = ad198x_suspend, |
542 | .resume = ad198x_resume, | ||
543 | #endif | 542 | #endif |
544 | .reboot_notify = ad198x_shutup, | 543 | .reboot_notify = ad198x_shutup, |
545 | }; | 544 | }; |
@@ -3490,6 +3489,8 @@ static struct snd_kcontrol_new ad1984_thinkpad_mixers[] = { | |||
3490 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT), | 3489 | HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x00, HDA_INPUT), |
3491 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT), | 3490 | HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x20, 0x01, HDA_INPUT), |
3492 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT), | 3491 | HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x20, 0x01, HDA_INPUT), |
3492 | HDA_CODEC_VOLUME("Beep Playback Volume", 0x20, 0x03, HDA_INPUT), | ||
3493 | HDA_CODEC_MUTE("Beep Playback Switch", 0x20, 0x03, HDA_INPUT), | ||
3493 | HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT), | 3494 | HDA_CODEC_VOLUME("Docking Mic Playback Volume", 0x20, 0x04, HDA_INPUT), |
3494 | HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT), | 3495 | HDA_CODEC_MUTE("Docking Mic Playback Switch", 0x20, 0x04, HDA_INPUT), |
3495 | HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), | 3496 | HDA_CODEC_VOLUME("Mic Boost", 0x14, 0x0, HDA_INPUT), |
@@ -3531,6 +3532,8 @@ static struct hda_verb ad1984_thinkpad_init_verbs[] = { | |||
3531 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 3532 | {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
3532 | /* docking mic boost */ | 3533 | /* docking mic boost */ |
3533 | {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, | 3534 | {0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, |
3535 | /* Analog PC Beeper - allow firmware/ACPI beeps */ | ||
3536 | {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(3) | 0x1a}, | ||
3534 | /* Analog mixer - docking mic; mute as default */ | 3537 | /* Analog mixer - docking mic; mute as default */ |
3535 | {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, | 3538 | {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(4)}, |
3536 | /* enable EAPD bit */ | 3539 | /* enable EAPD bit */ |
@@ -3663,6 +3666,7 @@ static int patch_ad1984(struct hda_codec *codec) | |||
3663 | spec->input_mux = &ad1984_thinkpad_capture_source; | 3666 | spec->input_mux = &ad1984_thinkpad_capture_source; |
3664 | spec->mixers[0] = ad1984_thinkpad_mixers; | 3667 | spec->mixers[0] = ad1984_thinkpad_mixers; |
3665 | spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs; | 3668 | spec->init_verbs[spec->num_init_verbs++] = ad1984_thinkpad_init_verbs; |
3669 | spec->analog_beep = 1; | ||
3666 | break; | 3670 | break; |
3667 | case AD1984_DELL_DESKTOP: | 3671 | case AD1984_DELL_DESKTOP: |
3668 | spec->multiout.dig_out_nid = 0; | 3672 | spec->multiout.dig_out_nid = 0; |