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: hda - Fix ALC861-VD capture source mixer
ALSA: ac97: add AC97 STMicroelectronics' codecs
ALSA: ac97: Add Dell Dimension 2400 to Headphone/Line Jack Sense blacklist
ASoC: Fix WM8350 DSP mode B configuration
sbawe: fix memory detection part 2
sound: oss: off by one bug
ALSA: usb-audio - Avoid Oops after disconnect
ALSA: test off by one in setsamplerate()
ALSA: atiixp: Specify codec for Foxconn RC4107MA-RS2

+38 -17
+7 -4
sound/isa/sb/emu8000.c
··· 377 377 static void __devinit 378 378 size_dram(struct snd_emu8000 *emu) 379 379 { 380 - int i, size; 380 + int i, size, detected_size; 381 381 382 382 if (emu->dram_checked) 383 383 return; 384 384 385 385 size = 0; 386 + detected_size = 0; 386 387 387 388 /* write out a magic number */ 388 389 snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE); ··· 393 392 snd_emu8000_init_fm(emu); /* This must really be here and not 2 lines back even */ 394 393 395 394 while (size < EMU8000_MAX_DRAM) { 395 + 396 + size += 512 * 1024; /* increment 512kbytes */ 396 397 397 398 /* Write a unique data on the test address. 398 399 * if the address is out of range, the data is written on ··· 417 414 if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) 418 415 break; /* no memory at this address */ 419 416 420 - size += 512 * 1024; /* increment 512kbytes */ 417 + detected_size = size; 421 418 422 419 snd_emu8000_read_wait(emu); 423 420 ··· 445 442 snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE); 446 443 447 444 snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n", 448 - emu->port1, size/1024); 445 + emu->port1, detected_size/1024); 449 446 450 - emu->mem_size = size; 447 + emu->mem_size = detected_size; 451 448 emu->dram_checked = 1; 452 449 } 453 450
+9 -7
sound/oss/dev_table.c
··· 67 67 return -(EBUSY); 68 68 } 69 69 d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver))); 70 - 71 - if (sound_nblocks < 1024) 72 - sound_nblocks++; 70 + sound_nblocks++; 71 + if (sound_nblocks >= MAX_MEM_BLOCKS) 72 + sound_nblocks = MAX_MEM_BLOCKS - 1; 73 73 74 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 79 if (d == NULL || op == NULL) { 79 80 printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name); 80 81 sound_unload_audiodev(num); ··· 129 128 until you unload sound! */ 130 129 131 130 op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); 131 + sound_nblocks++; 132 + if (sound_nblocks >= MAX_MEM_BLOCKS) 133 + sound_nblocks = MAX_MEM_BLOCKS - 1; 132 134 133 - if (sound_nblocks < 1024) 134 - sound_nblocks++; 135 135 if (op == NULL) { 136 136 printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); 137 137 return -ENOMEM;
+2
sound/oss/sound_config.h
··· 142 142 #define TIMER_ARMED 121234 143 143 #define TIMER_NOT_ARMED 1 144 144 145 + #define MAX_MEM_BLOCKS 1024 146 + 145 147 #endif
+2 -2
sound/oss/soundcard.c
··· 56 56 /* 57 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 60 int sound_nblocks = 0; 61 61 62 62 /* Persistent DMA buffers */ ··· 574 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 578 printk(KERN_ERR "Sound warning: Deallocation table was too small.\n"); 579 579 580 580 return 0;
+10
sound/pci/ac97/ac97_codec.c
··· 83 83 { 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL }, 84 84 { 0x50534300, 0xffffff00, "Philips", NULL, NULL }, 85 85 { 0x53494c00, 0xffffff00, "Silicon Laboratory", NULL, NULL }, 86 + { 0x53544d00, 0xffffff00, "STMicroelectronics", NULL, NULL }, 86 87 { 0x54524100, 0xffffff00, "TriTech", NULL, NULL }, 87 88 { 0x54584e00, 0xffffff00, "Texas Instruments", NULL, NULL }, 88 89 { 0x56494100, 0xffffff00, "VIA Technologies", NULL, NULL }, ··· 162 161 { 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix 163 162 { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL }, 164 163 { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, 164 + { 0x53544d02, 0xffffffff, "ST7597", NULL, NULL }, 165 165 { 0x54524102, 0xffffffff, "TR28022", NULL, NULL }, 166 166 { 0x54524103, 0xffffffff, "TR28023", NULL, NULL }, 167 167 { 0x54524106, 0xffffffff, "TR28026", NULL, NULL }, ··· 215 213 { 216 214 /* filter some registers for buggy codecs */ 217 215 switch (ac97->id) { 216 + case AC97_ID_ST_AC97_ID4: 217 + if (reg == 0x08) 218 + return 0; 219 + /* fall through */ 220 + case AC97_ID_ST7597: 221 + if (reg == 0x22 || reg == 0x7a) 222 + return 1; 223 + /* fall through */ 218 224 case AC97_ID_AK4540: 219 225 case AC97_ID_AK4542: 220 226 if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c)
+2
sound/pci/ac97/ac97_id.h
··· 62 62 #define AC97_ID_CM9761_78 0x434d4978 63 63 #define AC97_ID_CM9761_82 0x434d4982 64 64 #define AC97_ID_CM9761_83 0x434d4983 65 + #define AC97_ID_ST7597 0x53544d02 66 + #define AC97_ID_ST_AC97_ID4 0x53544d04
+1
sound/pci/ac97/ac97_patch.c
··· 1870 1870 0x10140554, /* Thinkpad T42p/R50p */ 1871 1871 0x10140567, /* Thinkpad T43p 2668-G7U */ 1872 1872 0x10140581, /* Thinkpad X41-2527 */ 1873 + 0x10280160, /* Dell Dimension 2400 */ 1873 1874 0x104380b0, /* Asus A7V8X-MX */ 1874 1875 0x11790241, /* Toshiba Satellite A-15 S127 */ 1875 1876 0x144dc01a, /* Samsung NP-X20C004/SEG */
+1
sound/pci/atiixp.c
··· 297 297 MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); 298 298 299 299 static struct snd_pci_quirk atiixp_quirks[] __devinitdata = { 300 + SND_PCI_QUIRK(0x105b, 0x0c81, "Foxconn RC4107MA-RS2", 0), 300 301 SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), 301 302 { } /* terminator */ 302 303 };
+1 -1
sound/pci/hda/patch_realtek.c
··· 15493 15493 static int alc861vd_auto_create_input_ctls(struct hda_codec *codec, 15494 15494 const struct auto_pin_cfg *cfg) 15495 15495 { 15496 - return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x09, 0); 15496 + return alc_auto_create_input_ctls(codec, cfg, 0x15, 0x22, 0); 15497 15497 } 15498 15498 15499 15499
+1 -1
sound/pci/riptide/riptide.c
··· 1058 1058 rptr.retwords[2] != M && 1059 1059 rptr.retwords[3] != N && 1060 1060 i++ < MAX_WRITE_RETRY); 1061 - if (i == MAX_WRITE_RETRY) { 1061 + if (i > MAX_WRITE_RETRY) { 1062 1062 snd_printdd("sent samplerate %d: %d failed\n", 1063 1063 *intdec, rate); 1064 1064 return -EIO;
+1 -1
sound/soc/codecs/wm8350.c
··· 925 925 iface |= 0x3 << 8; 926 926 break; 927 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 929 break; 930 930 default: 931 931 return -EINVAL;
+1 -1
sound/usb/usbaudio.c
··· 1936 1936 struct snd_usb_stream *as = snd_pcm_substream_chip(substream); 1937 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 1940 usb_set_interface(subs->dev, subs->interface, 0); 1941 1941 subs->interface = -1; 1942 1942 }