diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-18 17:13:17 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-18 17:13:17 -0500 |
| commit | 54ef91dcf094313fb4fbe87713c11fb55bcf15a9 (patch) | |
| tree | 08a09236bb0af4a97b00c8bdf465c8dad958a3fd | |
| parent | 91302873bad9550ad06f09dd1ce9e283900ef84e (diff) | |
| parent | 6321bd634eb755c87ca18c3b1ef348a213c1f597 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: Remove warning message for invalid OSS minor ranges
ALSA: hda - Fix capture on Sony VAIO with single input
ALSA: hda - Fix mute led GPIO on HP dv-series notebooks
ALSA: use subsys_initcall for sound core instead of module_init
ALSA: hda - Fix missing capture mixer for ALC861/660 codecs
ALSA: hda - Improved MacBook (Pro) 5,1 / 5,2 support
ALSA: hda - Fix Toshiba NB20x quirk entry
| -rw-r--r-- | sound/core/sound.c | 4 | ||||
| -rw-r--r-- | sound/core/sound_oss.c | 2 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 94 | ||||
| -rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 61 | ||||
| -rw-r--r-- | sound/sound_core.c | 2 |
5 files changed, 132 insertions, 31 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index 7872a02f6ca9..563d1967a0ad 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
| @@ -468,5 +468,5 @@ static void __exit alsa_sound_exit(void) | |||
| 468 | unregister_chrdev(major, "alsa"); | 468 | unregister_chrdev(major, "alsa"); |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | module_init(alsa_sound_init) | 471 | subsys_initcall(alsa_sound_init); |
| 472 | module_exit(alsa_sound_exit) | 472 | module_exit(alsa_sound_exit); |
diff --git a/sound/core/sound_oss.c b/sound/core/sound_oss.c index 7fe12264ff80..0c164e5e4322 100644 --- a/sound/core/sound_oss.c +++ b/sound/core/sound_oss.c | |||
| @@ -93,7 +93,7 @@ static int snd_oss_kernel_minor(int type, struct snd_card *card, int dev) | |||
| 93 | default: | 93 | default: |
| 94 | return -EINVAL; | 94 | return -EINVAL; |
| 95 | } | 95 | } |
| 96 | if (snd_BUG_ON(minor < 0 || minor >= SNDRV_OSS_MINORS)) | 96 | if (minor < 0 || minor >= SNDRV_OSS_MINORS) |
| 97 | return -EINVAL; | 97 | return -EINVAL; |
| 98 | return minor; | 98 | return minor; |
| 99 | } | 99 | } |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index e3caa78ccd54..3f92def752fd 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -1230,6 +1230,8 @@ static void alc_init_auto_mic(struct hda_codec *codec) | |||
| 1230 | return; /* invalid entry */ | 1230 | return; /* invalid entry */ |
| 1231 | } | 1231 | } |
| 1232 | } | 1232 | } |
| 1233 | if (!ext || !fixed) | ||
| 1234 | return; | ||
| 1233 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) | 1235 | if (!(get_wcaps(codec, ext) & AC_WCAP_UNSOL_CAP)) |
| 1234 | return; /* no unsol support */ | 1236 | return; /* no unsol support */ |
| 1235 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", | 1237 | snd_printdd("realtek: Enable auto-mic switch on NID 0x%x/0x%x\n", |
| @@ -4812,6 +4814,49 @@ static void fixup_automic_adc(struct hda_codec *codec) | |||
| 4812 | spec->auto_mic = 0; /* disable auto-mic to be sure */ | 4814 | spec->auto_mic = 0; /* disable auto-mic to be sure */ |
| 4813 | } | 4815 | } |
| 4814 | 4816 | ||
| 4817 | /* choose the ADC/MUX containing the input pin and initialize the setup */ | ||
| 4818 | static void fixup_single_adc(struct hda_codec *codec) | ||
| 4819 | { | ||
| 4820 | struct alc_spec *spec = codec->spec; | ||
| 4821 | hda_nid_t pin; | ||
| 4822 | int i; | ||
| 4823 | |||
| 4824 | /* search for the input pin; there must be only one */ | ||
| 4825 | for (i = 0; i < AUTO_PIN_LAST; i++) { | ||
| 4826 | if (spec->autocfg.input_pins[i]) { | ||
| 4827 | pin = spec->autocfg.input_pins[i]; | ||
| 4828 | break; | ||
| 4829 | } | ||
| 4830 | } | ||
| 4831 | if (!pin) | ||
| 4832 | return; | ||
| 4833 | |||
| 4834 | /* set the default connection to that pin */ | ||
| 4835 | for (i = 0; i < spec->num_adc_nids; i++) { | ||
| 4836 | hda_nid_t cap = spec->capsrc_nids ? | ||
| 4837 | spec->capsrc_nids[i] : spec->adc_nids[i]; | ||
| 4838 | int idx; | ||
| 4839 | |||
| 4840 | idx = get_connection_index(codec, cap, pin); | ||
| 4841 | if (idx < 0) | ||
| 4842 | continue; | ||
| 4843 | /* use only this ADC */ | ||
| 4844 | if (spec->capsrc_nids) | ||
| 4845 | spec->capsrc_nids += i; | ||
| 4846 | spec->adc_nids += i; | ||
| 4847 | spec->num_adc_nids = 1; | ||
| 4848 | /* select or unmute this route */ | ||
| 4849 | if (get_wcaps_type(get_wcaps(codec, cap)) == AC_WID_AUD_MIX) { | ||
| 4850 | snd_hda_codec_amp_stereo(codec, cap, HDA_INPUT, idx, | ||
| 4851 | HDA_AMP_MUTE, 0); | ||
| 4852 | } else { | ||
| 4853 | snd_hda_codec_write_cache(codec, cap, 0, | ||
| 4854 | AC_VERB_SET_CONNECT_SEL, idx); | ||
| 4855 | } | ||
| 4856 | return; | ||
| 4857 | } | ||
| 4858 | } | ||
| 4859 | |||
| 4815 | static void set_capture_mixer(struct hda_codec *codec) | 4860 | static void set_capture_mixer(struct hda_codec *codec) |
| 4816 | { | 4861 | { |
| 4817 | struct alc_spec *spec = codec->spec; | 4862 | struct alc_spec *spec = codec->spec; |
| @@ -4824,14 +4869,15 @@ static void set_capture_mixer(struct hda_codec *codec) | |||
| 4824 | alc_capture_mixer3 }, | 4869 | alc_capture_mixer3 }, |
| 4825 | }; | 4870 | }; |
| 4826 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { | 4871 | if (spec->num_adc_nids > 0 && spec->num_adc_nids <= 3) { |
| 4827 | int mux; | 4872 | int mux = 0; |
| 4828 | if (spec->auto_mic) { | 4873 | if (spec->auto_mic) |
| 4829 | mux = 0; | ||
| 4830 | fixup_automic_adc(codec); | 4874 | fixup_automic_adc(codec); |
| 4831 | } else if (spec->input_mux && spec->input_mux->num_items > 1) | 4875 | else if (spec->input_mux) { |
| 4832 | mux = 1; | 4876 | if (spec->input_mux->num_items > 1) |
| 4833 | else | 4877 | mux = 1; |
| 4834 | mux = 0; | 4878 | else if (spec->input_mux->num_items == 1) |
| 4879 | fixup_single_adc(codec); | ||
| 4880 | } | ||
| 4835 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; | 4881 | spec->cap_mixer = caps[mux][spec->num_adc_nids - 1]; |
| 4836 | } | 4882 | } |
| 4837 | } | 4883 | } |
| @@ -7094,8 +7140,8 @@ static struct snd_kcontrol_new alc885_mb5_mixer[] = { | |||
| 7094 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), | 7140 | HDA_BIND_MUTE ("Surround Playback Switch", 0x0d, 0x02, HDA_INPUT), |
| 7095 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), | 7141 | HDA_CODEC_VOLUME("LFE Playback Volume", 0x0e, 0x00, HDA_OUTPUT), |
| 7096 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), | 7142 | HDA_BIND_MUTE ("LFE Playback Switch", 0x0e, 0x02, HDA_INPUT), |
| 7097 | HDA_CODEC_VOLUME("HP Playback Volume", 0x0f, 0x00, HDA_OUTPUT), | 7143 | HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0f, 0x00, HDA_OUTPUT), |
| 7098 | HDA_BIND_MUTE ("HP Playback Switch", 0x0f, 0x02, HDA_INPUT), | 7144 | HDA_BIND_MUTE ("Headphone Playback Switch", 0x0f, 0x02, HDA_INPUT), |
| 7099 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), | 7145 | HDA_CODEC_VOLUME("Line Playback Volume", 0x0b, 0x02, HDA_INPUT), |
| 7100 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), | 7146 | HDA_CODEC_MUTE ("Line Playback Switch", 0x0b, 0x02, HDA_INPUT), |
| 7101 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), | 7147 | HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x01, HDA_INPUT), |
| @@ -7496,6 +7542,7 @@ static struct hda_verb alc885_mb5_init_verbs[] = { | |||
| 7496 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, | 7542 | {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, |
| 7497 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 7543 | {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
| 7498 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, | 7544 | {0x14, AC_VERB_SET_CONNECT_SEL, 0x03}, |
| 7545 | {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN}, | ||
| 7499 | /* Front Mic pin: input vref at 80% */ | 7546 | /* Front Mic pin: input vref at 80% */ |
| 7500 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, | 7547 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80}, |
| 7501 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, | 7548 | {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, |
| @@ -7680,6 +7727,27 @@ static void alc885_mbp3_setup(struct hda_codec *codec) | |||
| 7680 | spec->autocfg.speaker_pins[0] = 0x14; | 7727 | spec->autocfg.speaker_pins[0] = 0x14; |
| 7681 | } | 7728 | } |
| 7682 | 7729 | ||
| 7730 | static void alc885_mb5_automute(struct hda_codec *codec) | ||
| 7731 | { | ||
| 7732 | unsigned int present; | ||
| 7733 | |||
| 7734 | present = snd_hda_codec_read(codec, 0x14, 0, | ||
| 7735 | AC_VERB_GET_PIN_SENSE, 0) & 0x80000000; | ||
| 7736 | snd_hda_codec_amp_stereo(codec, 0x18, HDA_OUTPUT, 0, | ||
| 7737 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
| 7738 | snd_hda_codec_amp_stereo(codec, 0x1a, HDA_OUTPUT, 0, | ||
| 7739 | HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); | ||
| 7740 | |||
| 7741 | } | ||
| 7742 | |||
| 7743 | static void alc885_mb5_unsol_event(struct hda_codec *codec, | ||
| 7744 | unsigned int res) | ||
| 7745 | { | ||
| 7746 | /* Headphone insertion or removal. */ | ||
| 7747 | if ((res >> 26) == ALC880_HP_EVENT) | ||
| 7748 | alc885_mb5_automute(codec); | ||
| 7749 | } | ||
| 7750 | |||
| 7683 | static void alc885_imac91_automute(struct hda_codec *codec) | 7751 | static void alc885_imac91_automute(struct hda_codec *codec) |
| 7684 | { | 7752 | { |
| 7685 | unsigned int present; | 7753 | unsigned int present; |
| @@ -9126,6 +9194,8 @@ static struct alc_config_preset alc882_presets[] = { | |||
| 9126 | .input_mux = &mb5_capture_source, | 9194 | .input_mux = &mb5_capture_source, |
| 9127 | .dig_out_nid = ALC882_DIGOUT_NID, | 9195 | .dig_out_nid = ALC882_DIGOUT_NID, |
| 9128 | .dig_in_nid = ALC882_DIGIN_NID, | 9196 | .dig_in_nid = ALC882_DIGIN_NID, |
| 9197 | .unsol_event = alc885_mb5_unsol_event, | ||
| 9198 | .init_hook = alc885_mb5_automute, | ||
| 9129 | }, | 9199 | }, |
| 9130 | [ALC885_MACPRO] = { | 9200 | [ALC885_MACPRO] = { |
| 9131 | .mixers = { alc882_macpro_mixer }, | 9201 | .mixers = { alc882_macpro_mixer }, |
| @@ -11179,7 +11249, | |||
