diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/sound.c | 4 | ||||
-rw-r--r-- | sound/core/sound_oss.c | 2 | ||||
-rw-r--r-- | sound/isa/sb/emu8000.c | 11 | ||||
-rw-r--r-- | sound/oss/dev_table.c | 16 | ||||
-rw-r--r-- | sound/oss/sound_config.h | 2 | ||||
-rw-r--r-- | sound/oss/soundcard.c | 4 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_codec.c | 10 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_id.h | 2 | ||||
-rw-r--r-- | sound/pci/ac97/ac97_patch.c | 1 | ||||
-rw-r--r-- | sound/pci/atiixp.c | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 96 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 61 | ||||
-rw-r--r-- | sound/pci/riptide/riptide.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8350.c | 2 | ||||
-rw-r--r-- | sound/sound_core.c | 2 | ||||
-rw-r--r-- | sound/usb/usbaudio.c | 2 |
16 files changed, 170 insertions, 48 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/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 751762f1c59a..0c40951b6523 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c | |||
@@ -377,12 +377,13 @@ init_arrays(struct snd_emu8000 *emu) | |||
377 | static void __devinit | 377 | static void __devinit |
378 | size_dram(struct snd_emu8000 *emu) | 378 | size_dram(struct snd_emu8000 *emu) |
379 | { | 379 | { |
380 | int i, size; | 380 | int i, size, detected_size; |
381 | 381 | ||
382 | if (emu->dram_checked) | 382 | if (emu->dram_checked) |
383 | return; | 383 | return; |
384 | 384 | ||
385 | size = 0; | 385 | size = 0; |
386 | detected_size = 0; | ||
386 | 387 | ||
387 | /* write out a magic number */ | 388 | /* write out a magic number */ |
388 | snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE); | 389 | snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE); |
@@ -393,6 +394,8 @@ size_dram(struct snd_emu8000 *emu) | |||
393 | 394 | ||
394 | while (size < EMU8000_MAX_DRAM) { | 395 | while (size < EMU8000_MAX_DRAM) { |
395 | 396 | ||
397 | size += 512 * 1024; /* increment 512kbytes */ | ||
398 | |||
396 | /* Write a unique data on the test address. | 399 | /* Write a unique data on the test address. |
397 | * if the address is out of range, the data is written on | 400 | * if the address is out of range, the data is written on |
398 | * 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is | 401 | * 0x200000(=EMU8000_DRAM_OFFSET). Then the id word is |
@@ -414,7 +417,7 @@ size_dram(struct snd_emu8000 *emu) | |||
414 | if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) | 417 | if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) |
415 | break; /* no memory at this address */ | 418 | break; /* no memory at this address */ |
416 | 419 | ||
417 | size += 512 * 1024; /* increment 512kbytes */ | 420 | detected_size = size; |
418 | 421 | ||
419 | snd_emu8000_read_wait(emu); | 422 | snd_emu8000_read_wait(emu); |
420 | 423 | ||
@@ -442,9 +445,9 @@ size_dram(struct snd_emu8000 *emu) | |||
442 | snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE); | 445 | snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE); |
443 | 446 | ||
444 | snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n", | 447 | snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n", |
445 | emu->port1, size/1024); | 448 | emu->port1, detected_size/1024); |
446 | 449 | ||
447 | emu->mem_size = size; | 450 | emu->mem_size = detected_size; |
448 | emu->dram_checked = 1; | 451 | emu->dram_checked = 1; |
449 | } | 452 | } |
450 | 453 | ||
diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c index 08274c995d06..727bdb9ba2dc 100644 --- a/sound/oss/dev_table.c +++ b/sound/oss/dev_table.c | |||
@@ -67,14 +67,15 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver, | |||
67 | return -(EBUSY); | 67 | return -(EBUSY); |
68 | } | 68 | } |
69 | d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver))); | 69 | d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver))); |
70 | 70 | sound_nblocks++; | |
71 | if (sound_nblocks < 1024) | 71 | if (sound_nblocks >= MAX_MEM_BLOCKS) |
72 | sound_nblocks++; | 72 | sound_nblocks = MAX_MEM_BLOCKS - 1; |
73 | 73 | ||
74 | op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); | 74 | op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); |
75 | sound_nblocks++; | ||
76 | if (sound_nblocks >= MAX_MEM_BLOCKS) | ||
77 | sound_nblocks = MAX_MEM_BLOCKS - 1; | ||
75 | 78 | ||
76 | if (sound_nblocks < 1024) | ||
77 | sound_nblocks++; | ||
78 | if (d == NULL || op == NULL) { | 79 | if (d == NULL || op == NULL) { |
79 | printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); | 80 | printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); |
80 | sound_unload_audiodev(num); | 81 | sound_unload_audiodev(num); |
@@ -128,9 +129,10 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver, | |||
128 | until you unload sound! */ | 129 | until you unload sound! */ |
129 | 130 | ||
130 | op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); | 131 | op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); |
132 | sound_nblocks++; | ||
133 | if (sound_nblocks >= MAX_MEM_BLOCKS) | ||
134 | sound_nblocks = MAX_MEM_BLOCKS - 1; | ||
131 | 135 | ||
132 | if (sound_nblocks < 1024) | ||
133 | sound_nblocks++; | ||
134 | if (op == NULL) { | 136 | if (op == NULL) { |
135 | printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); | 137 | printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); |
136 | return -ENOMEM; | 138 | return -ENOMEM; |
diff --git a/sound/oss/sound_config.h b/sound/oss/sound_config.h index 55271fbe7f49..9d35c4c65b9b 100644 --- a/sound/oss/sound_config.h +++ b/sound/oss/sound_config.h | |||
@@ -142,4 +142,6 @@ static inline int translate_mode(struct file *file) | |||
142 | #define TIMER_ARMED 121234 | 142 | #define TIMER_ARMED 121234 |
143 | #define TIMER_NOT_ARMED 1 | 143 | #define TIMER_NOT_ARMED 1 |
144 | 144 | ||
145 | #define MAX_MEM_BLOCKS 1024 | ||
146 | |||
145 | #endif | 147 | #endif |
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c index 61aaedae6b7e..c62530943888 100644 --- a/sound/oss/soundcard.c +++ b/sound/oss/soundcard.c | |||
@@ -56,7 +56,7 @@ | |||
56 | /* | 56 | /* |
57 | * Table for permanently allocated memory (used when unloading the module) | 57 | * Table for permanently allocated memory (used when unloading the module) |
58 | */ | 58 | */ |
59 | void * sound_mem_blocks[1024]; | 59 | void * sound_mem_blocks[MAX_MEM_BLOCKS]; |
60 | int sound_nblocks = 0; | 60 | int sound_nblocks = 0; |
61 | 61 | ||
62 | /* Persistent DMA buffers */ | 62 | /* Persistent DMA buffers */ |
@@ -574,7 +574,7 @@ static int __init oss_init(void) | |||
574 | NULL, "%s%d", dev_list[i].name, j); | 574 | NULL, "%s%d", dev_list[i].name, j); |
575 | } | 575 | } |
576 | 576 | ||
577 | if (sound_nblocks >= 1024) | 577 | if (sound_nblocks >= MAX_MEM_BLOCKS - 1) |
578 | printk(KERN_ERR "Sound warning: Deallocation table was too small.\n"); | 578 | printk(KERN_ERR "Sound warning: Deallocation table was too small.\n"); |
579 | 579 | ||
580 | return 0; | 580 | return 0; |
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index c11920623009..a7630e9edf8a 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c | |||
@@ -83,6 +83,7 @@ static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = { | |||
83 | { 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL }, | 83 | { 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL }, |
84 | { 0x50534300, 0xffffff00, "Philips", NULL, NULL }, | 84 | { 0x50534300, 0xffffff00, "Philips", NULL, NULL }, |
85 | { 0x53494c00, 0xffffff00, "Silicon Laboratory", NULL, NULL }, | 85 | { 0x53494c00, 0xffffff00, "Silicon Laboratory", NULL, NULL }, |
86 | { 0x53544d00, 0xffffff00, "STMicroelectronics", NULL, NULL }, | ||
86 | { 0x54524100, 0xffffff00, "TriTech", NULL, NULL }, | 87 | { 0x54524100, 0xffffff00, "TriTech", NULL, NULL }, |
87 | { 0x54584e00, 0xffffff00, "Texas Instruments", NULL, NULL }, | 88 | { 0x54584e00, 0xffffff00, "Texas Instruments", NULL, NULL }, |
88 | { 0x56494100, 0xffffff00, "VIA Technologies", NULL, NULL }, | 89 | { 0x56494100, 0xffffff00, "VIA Technologies", NULL, NULL }, |
@@ -161,6 +162,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { | |||
161 | { 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix | 162 | { 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix |
162 | { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, | 163 | { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, |
163 | { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, | 164 | { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, |
165 | { 0x53544d02, 0xffffffff, "ST7597", NULL, NULL }, | ||
164 | { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, | 166 | { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, |
165 | { 0x54524103, 0xffffffff, "TR28023", NULL, NULL }, | 167 | { 0x54524103, 0xffffffff, "TR28023", NULL, NULL }, |
166 | { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, | 168 | { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, |
@@ -213,6 +215,14 @@ static int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg) | |||
213 | { | 215 | { |
214 | /* filter some registers for buggy codecs */ | 216 | /* filter some registers for buggy codecs */ |
215 | switch (ac97->id) { | 217 | switch (ac97->id) { |
218 | case AC97_ID_ST_AC97_ID4: | ||
219 | if (reg == 0x08) | ||
220 | return 0; | ||
221 | /* fall through */ | ||
222 | case AC97_ID_ST7597: | ||
223 | if (reg == 0x22 || reg == 0x7a) | ||
224 | return 1; | ||
225 | /* fall through */ | ||
216 | case AC97_ID_AK4540: | 226 | case AC97_ID_AK4540: |
217 | case AC97_ID_AK4542: | 227 | case AC97_ID_AK4542: |
218 | if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c) | 228 | if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c) |
diff --git a/sound/pci/ac97/ac97_id.h b/sound/pci/ac97/ac97_id.h index c129492c82b3..d603147c4a96 100644 --- a/sound/pci/ac97/ac97_id.h +++ b/sound/pci/ac97/ac97_id.h | |||
@@ -62,3 +62,5 @@ | |||
62 | #define AC97_ID_CM9761_78 0x434d4978 | 62 | #define AC97_ID_CM9761_78 0x434d4978 |
63 | #define AC97_ID_CM9761_82 0x434d4982 | 63 | #define AC97_ID_CM9761_82 0x434d4982 |
64 | #define AC97_ID_CM9761_83 0x434d4983 | 64 | #define AC97_ID_CM9761_83 0x434d4983 |
65 | #define AC97_ID_ST7597 0x53544d02 | ||
66 | #define AC97_ID_ST_AC97_ID4 0x53544d04 | ||
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 139cf3b2b9d7..d9266bae2849 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -1870,6 +1870,7 @@ static unsigned int ad1981_jacks_blacklist[] = { | |||
1870 | 0x10140554, /* Thinkpad T42p/R50p */ | 1870 | 0x10140554, /* Thinkpad T42p/R50p */ |
1871 | 0x10140567, /* Thinkpad T43p 2668-G7U */ | 1871 | 0x10140567, /* Thinkpad T43p 2668-G7U */ |
1872 | 0x10140581, /* Thinkpad X41-2527 */ | 1872 | 0x10140581, /* Thinkpad X41-2527 */ |
1873 | 0x10280160, /* Dell Dimension 2400 */ | ||
1873 | 0x104380b0, /* Asus A7V8X-MX */ | 1874 | 0x104380b0, /* Asus A7V8X-MX */ |
1874 | 0x11790241, /* Toshiba Satellite A-15 S127 */ | 1875 | 0x11790241, /* Toshiba Satellite A-15 S127 */ |
1875 | 0x144dc01a, /* Samsung NP-X20C004/SEG */ | 1876 | 0x144dc01a, /* Samsung NP-X20C004/SEG */ |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index d6752dff2a44..42b4fbbd8e2b 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -297,6 +297,7 @@ static struct pci_device_id snd_atiixp_ids[] = { | |||
297 | MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); | 297 | MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); |
298 | 298 | ||
299 | static struct snd_pci_quirk atiixp_quirks[] __devinitdata = { | 299 | static struct snd_pci_quirk atiixp_quirks[] __devinitdata = { |
300 | SND_PCI_QUIRK(0x105b, 0x0c81, "Foxconn RC4107MA-RS2", 0), | ||
300 | SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), | 301 | SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), |
301 | { } /* terminator */ | 302 | { } /* terminator */ |
302 | }; | 303 | }; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c7465053d6bb..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,7 @@ static int alc262_auto_create_multi_out_ctls(struct alc_spec *spec, | |||
11179 | } | 11249 | } |
11180 | 11250 | ||
11181 | #define alc262_auto_create_input_ctls \ | 11251 | #define alc262_auto_create_input_ctls \ |
11182 | alc880_auto_create_input_ctls | 11252 | alc882_auto_create_input_ctls |
11183 | 11253 | ||
11184 | /* | 11254 | /* |
11185 | * generic initialization of ADC, input mixers and output mixers | 11255 | * generic initialization of ADC, input mixers and output mixers |
@@ -14855,6 +14925,8 @@ static int patch_alc861(struct hda_codec *codec) | |||
14855 | spec->stream_digital_playback = &alc861_pcm_digital_playback; | 14925 | spec->stream_digital_playback = &alc861_pcm_digital_playback; |
14856 | spec->stream_digital_capture = &alc861_pcm_digital_capture; | 14926 | spec->stream_digital_capture = &alc861_pcm_digital_capture; |
14857 | 14927 | ||
14928 | if (!spec->cap_mixer) | ||
14929 | set_capture_mixer(codec); | ||
14858 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); | 14930 | set_beep_amp(spec, 0x23, 0, HDA_OUTPUT); |
14859 | 14931 | ||
14860 | spec->vmaster_nid = 0x03; | 14932 | spec->vmaster_nid = 0x03; |
@@ -15493,7 +15565,7 @@ static struct alc_config_preset alc861vd_presets[] = { | |||
15493 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, | 15565 | static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, |
15494 | const struct auto_pin_cfg *cfg) | 15566 | const struct auto_pin_cfg *cfg) |
15495 | { | 15567 | { |
15496 | return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); | 15568 | return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); |
15497 | } | 15569 | } |
15498 | 15570 | ||
15499 | 15571 | ||
@@ -17251,7 +17323,7 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { | |||
17251 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), | 17323 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_ECS), |
17252 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", | 17324 | SND_PCI_QUIRK(0x105b, 0x0d47, "Foxconn 45CMX/45GMX/45CMX-K", |
17253 | ALC662_3ST_6ch_DIG), | 17325 | ALC662_3ST_6ch_DIG), |
17254 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB200", ALC663_ASUS_MODE4), | 17326 | SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO), |
17255 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), | 17327 | SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), |
17256 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", | 17328 | SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L", |
17257 | ALC662_3ST_6ch_DIG), | 17329 | ALC662_3ST_6ch_DIG), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 2291a8396817..799ba2570902 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4730,6 +4730,26 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4730 | } | 4730 | } |
4731 | } | 4731 | } |
4732 | 4732 | ||
4733 | static int hp_blike_system(u32 subsystem_id); | ||
4734 | |||
4735 | static void set_hp_led_gpio(struct hda_codec *codec) | ||
4736 | { | ||
4737 | struct sigmatel_spec *spec = codec->spec; | ||
4738 | switch (codec->vendor_id) { | ||
4739 | case 0x111d7608: | ||
4740 | /* GPIO 0 */ | ||
4741 | spec->gpio_led = 0x01; | ||
4742 | break; | ||
4743 | case 0x111d7600: | ||
4744 | case 0x111d7601: | ||
4745 | case 0x111d7602: | ||
4746 | case 0x111d7603: | ||
4747 | /* GPIO 3 */ | ||
4748 | spec->gpio_led = 0x08; | ||
4749 | break; | ||
4750 | } | ||
4751 | } | ||
4752 | |||
4733 | /* | 4753 | /* |
4734 | * This method searches for the mute LED GPIO configuration | 4754 | * This method searches for the mute LED GPIO configuration |
4735 | * provided as OEM string in SMBIOS. The format of that string | 4755 | * provided as OEM string in SMBIOS. The format of that string |
@@ -4741,6 +4761,14 @@ static void stac92xx_unsol_event(struct hda_codec *codec, unsigned int res) | |||
4741 | * | 4761 | * |
4742 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) | 4762 | * So, HP B-series like systems may have HP_Mute_LED_0 (current models) |
4743 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings | 4763 | * or HP_Mute_LED_0_3 (future models) OEM SMBIOS strings |
4764 | * | ||
4765 | * | ||
4766 | * The dv-series laptops don't seem to have the HP_Mute_LED* strings in | ||
4767 | * SMBIOS - at least the ones I have seen do not have them - which include | ||
4768 | * my own system (HP Pavilion dv6-1110ax) and my cousin's | ||
4769 | * HP Pavilion dv9500t CTO. | ||
4770 | * Need more information on whether it is true across the entire series. | ||
4771 | * -- kunal | ||
4744 | */ | 4772 | */ |
4745 | static int find_mute_led_gpio(struct hda_codec *codec) | 4773 | static int find_mute_led_gpio(struct hda_codec *codec) |
4746 | { | 4774 | { |
@@ -4751,28 +4779,27 @@ static int find_mute_led_gpio(struct hda_codec *codec) | |||
4751 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 4779 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, |
4752 | NULL, dev))) { | 4780 | NULL, dev))) { |
4753 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", | 4781 | if (sscanf(dev->name, "HP_Mute_LED_%d_%d", |
4754 | &spec->gpio_led_polarity, | 4782 | &spec->gpio_led_polarity, |
4755 | &spec->gpio_led) == 2) { | 4783 | &spec->gpio_led) == 2) { |
4756 | spec->gpio_led = 1 << spec->gpio_led; | 4784 | spec->gpio_led = 1 << spec->gpio_led; |
4757 | return 1; | 4785 | return 1; |
4758 | } | 4786 | } |
4759 | if (sscanf(dev->name, "HP_Mute_LED_%d", | 4787 | if (sscanf(dev->name, "HP_Mute_LED_%d", |
4760 | &spec->gpio_led_polarity) == 1) { | 4788 | &spec->gpio_led_polarity) == 1) { |
4761 | switch (codec->vendor_id) { | 4789 | set_hp_led_gpio(codec); |
4762 | case 0x111d7608: | 4790 | return 1; |
4763 | /* GPIO 0 */ | ||
4764 | spec->gpio_led = 0x01; | ||
4765 | return 1; | ||
4766 | case 0x111d7600: | ||
4767 | case 0x111d7601: | ||
4768 | case 0x111d7602: | ||
4769 | case 0x111d7603: | ||
4770 | /* GPIO 3 */ | ||
4771 | spec->gpio_led = 0x08; | ||
4772 | return 1; | ||
4773 | } | ||
4774 | } | 4791 | } |
4775 | } | 4792 | } |
4793 | |||
4794 | /* | ||
4795 | * Fallback case - if we don't find the DMI strings, | ||
4796 | * we statically set the GPIO - if not a B-series system. | ||
4797 | */ | ||
4798 | if (!hp_blike_system(codec->subsystem_id)) { | ||
4799 | set_hp_led_gpio(codec); | ||
4800 | spec->gpio_led_polarity = 1; | ||
4801 | return 1; | ||
4802 | } | ||
4776 | } | 4803 | } |
4777 | return 0; | 4804 | return 0; |
4778 | } | 4805 | } |
@@ -5548,6 +5575,8 @@ again: | |||
5548 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); | 5575 | spec->num_dmuxes = ARRAY_SIZE(stac92hd71bxx_dmux_nids); |
5549 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); | 5576 | spec->num_smuxes = stac92hd71bxx_connected_smuxes(codec, 0x1e); |
5550 | 5577 | ||
5578 | snd_printdd("Found board config: %d\n", spec->board_config); | ||
5579 | |||
5551 | switch (spec->board_config) { | 5580 | switch (spec->board_config) { |
5552 | case STAC_HP_M4: | 5581 | case STAC_HP_M4: |
5553 | /* enable internal microphone */ | 5582 | /* enable internal microphone */ |
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index b5ca02e2038c..e66ef2b69b5d 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c | |||
@@ -1058,7 +1058,7 @@ setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate) | |||
1058 | rptr.retwords[2] != M && | 1058 | rptr.retwords[2] != M && |
1059 | rptr.retwords[3] != N && | 1059 | rptr.retwords[3] != N && |
1060 | i++ < MAX_WRITE_RETRY); | 1060 | i++ < MAX_WRITE_RETRY); |
1061 | if (i == MAX_WRITE_RETRY) { | 1061 | if (i > MAX_WRITE_RETRY) { |
1062 | snd_printdd("sent samplerate %d: %d failed\n", | 1062 | snd_printdd("sent samplerate %d: %d failed\n", |
1063 | *intdec, rate); | 1063 | *intdec, rate); |
1064 | return -EIO; | 1064 | return -EIO; |
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index ebbf11b653a4..718ef912e758 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -925,7 +925,7 @@ static int wm8350_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) | |||
925 | iface |= 0x3 << 8; | 925 | iface |= 0x3 << 8; |
926 | break; | 926 | break; |
927 | case SND_SOC_DAIFMT_DSP_B: | 927 | case SND_SOC_DAIFMT_DSP_B: |
928 | iface |= 0x3 << 8; /* lg not sure which mode */ | 928 | iface |= 0x3 << 8 | WM8350_AIF_LRCLK_INV; |
929 | break; | 929 | break; |
930 | default: | 930 | default: |
931 | return -EINVAL; | 931 | return -EINVAL; |
diff --git a/sound/sound_core.c b/sound/sound_core.c index dbca7c909a31..7c2d677a2df5 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c | |||
@@ -61,7 +61,7 @@ static void __exit cleanup_soundcore(void) | |||
61 | class_destroy(sound_class); | 61 | class_destroy(sound_class); |
62 | } | 62 | } |
63 | 63 | ||
64 | module_init(init_soundcore); | 64 | subsys_initcall(init_soundcore); |
65 | module_exit(cleanup_soundcore); | 65 | module_exit(cleanup_soundcore); |
66 | 66 | ||
67 | 67 | ||
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 4963defee18a..9edef4684978 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -1936,7 +1936,7 @@ static int snd_usb_pcm_close(struct snd_pcm_substream *substream, int direction) | |||
1936 | struct snd_usb_stream *as = snd_pcm_substream_chip(substream); | 1936 | struct snd_usb_stream *as = snd_pcm_substream_chip(substream); |
1937 | struct snd_usb_substream *subs = &as->substream[direction]; | 1937 | struct snd_usb_substream *subs = &as->substream[direction]; |
1938 | 1938 | ||
1939 | if (subs->interface >= 0) { | 1939 | if (!as->chip->shutdown && subs->interface >= 0) { |
1940 | usb_set_interface(subs->dev, subs->interface, 0); | 1940 | usb_set_interface(subs->dev, subs->interface, 0); |
1941 | subs->interface = -1; | 1941 | subs->interface = -1; |
1942 | } | 1942 | } |