Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7113578a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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
parents 597d8c71 f59bb4b6
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -377,12 +377,13 @@ init_arrays(struct snd_emu8000 *emu)
static void __devinit
static void __devinit
size_dram(struct snd_emu8000 *emu)
size_dram(struct snd_emu8000 *emu)
{
{
	int i, size;
	int i, size, detected_size;


	if (emu->dram_checked)
	if (emu->dram_checked)
		return;
		return;


	size = 0;
	size = 0;
	detected_size = 0;


	/* write out a magic number */
	/* write out a magic number */
	snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);
	snd_emu8000_dma_chan(emu, 0, EMU8000_RAM_WRITE);
@@ -393,6 +394,8 @@ size_dram(struct snd_emu8000 *emu)


	while (size < EMU8000_MAX_DRAM) {
	while (size < EMU8000_MAX_DRAM) {


		size += 512 * 1024;  /* increment 512kbytes */

		/* Write a unique data on the test address.
		/* Write a unique data on the test address.
		 * if the address is out of range, the data is written on
		 * if the address is out of range, the data is written on
		 * 0x200000(=EMU8000_DRAM_OFFSET).  Then the id word is
		 * 0x200000(=EMU8000_DRAM_OFFSET).  Then the id word is
@@ -414,7 +417,7 @@ size_dram(struct snd_emu8000 *emu)
		if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
		if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
			break; /* no memory at this address */
			break; /* no memory at this address */


		size += 512 * 1024;  /* increment 512kbytes */
		detected_size = size;


		snd_emu8000_read_wait(emu);
		snd_emu8000_read_wait(emu);


@@ -442,9 +445,9 @@ size_dram(struct snd_emu8000 *emu)
	snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE);
	snd_emu8000_dma_chan(emu, 1, EMU8000_RAM_CLOSE);


	snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n",
	snd_printdd("EMU8000 [0x%lx]: %d Kb on-board memory detected\n",
		    emu->port1, size/1024);
		    emu->port1, detected_size/1024);


	emu->mem_size = size;
	emu->mem_size = detected_size;
	emu->dram_checked = 1;
	emu->dram_checked = 1;
}
}


+9 −7
Original line number Original line Diff line number Diff line
@@ -67,14 +67,15 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
		return -(EBUSY);
		return -(EBUSY);
	}
	}
	d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver)));
	d = (struct audio_driver *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_driver)));

	if (sound_nblocks < 1024)
	sound_nblocks++;
	sound_nblocks++;
	if (sound_nblocks >= MAX_MEM_BLOCKS)
		sound_nblocks = MAX_MEM_BLOCKS - 1;


	op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));
	op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations)));

	if (sound_nblocks < 1024)
	sound_nblocks++;
	sound_nblocks++;
	if (sound_nblocks >= MAX_MEM_BLOCKS)
		sound_nblocks = MAX_MEM_BLOCKS - 1;

	if (d == NULL || op == NULL) {
	if (d == NULL || op == NULL) {
		printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name);
		printk(KERN_ERR "Sound: Can't allocate driver for (%s)\n", name);
		sound_unload_audiodev(num);
		sound_unload_audiodev(num);
@@ -128,9 +129,10 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
	   until you unload sound! */
	   until you unload sound! */
	   
	   
	op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations)));
	op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations)));

	if (sound_nblocks < 1024)
	sound_nblocks++;
	sound_nblocks++;
	if (sound_nblocks >= MAX_MEM_BLOCKS)
		sound_nblocks = MAX_MEM_BLOCKS - 1;

	if (op == NULL) {
	if (op == NULL) {
		printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
		printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
		return -ENOMEM;
		return -ENOMEM;
+2 −0
Original line number Original line Diff line number Diff line
@@ -142,4 +142,6 @@ static inline int translate_mode(struct file *file)
#define TIMER_ARMED	121234
#define TIMER_ARMED	121234
#define TIMER_NOT_ARMED	1
#define TIMER_NOT_ARMED	1


#define MAX_MEM_BLOCKS 1024

#endif
#endif
+2 −2
Original line number Original line Diff line number Diff line
@@ -56,7 +56,7 @@
/*
/*
 * Table for permanently allocated memory (used when unloading the module)
 * Table for permanently allocated memory (used when unloading the module)
 */
 */
void *          sound_mem_blocks[1024];
void *          sound_mem_blocks[MAX_MEM_BLOCKS];
int             sound_nblocks = 0;
int             sound_nblocks = 0;


/* Persistent DMA buffers */
/* Persistent DMA buffers */
@@ -574,7 +574,7 @@ static int __init oss_init(void)
				      NULL, "%s%d", dev_list[i].name, j);
				      NULL, "%s%d", dev_list[i].name, j);
	}
	}


	if (sound_nblocks >= 1024)
	if (sound_nblocks >= MAX_MEM_BLOCKS - 1)
		printk(KERN_ERR "Sound warning: Deallocation table was too small.\n");
		printk(KERN_ERR "Sound warning: Deallocation table was too small.\n");
	
	
	return 0;
	return 0;
+10 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,7 @@ static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
{ 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL },
{ 0x4e534300, 0xffffff00, "National Semiconductor", NULL, NULL },
{ 0x50534300, 0xffffff00, "Philips",		NULL,	NULL },
{ 0x50534300, 0xffffff00, "Philips",		NULL,	NULL },
{ 0x53494c00, 0xffffff00, "Silicon Laboratory",	NULL,	NULL },
{ 0x53494c00, 0xffffff00, "Silicon Laboratory",	NULL,	NULL },
{ 0x53544d00, 0xffffff00, "STMicroelectronics",	NULL,	NULL },
{ 0x54524100, 0xffffff00, "TriTech",		NULL,	NULL },
{ 0x54524100, 0xffffff00, "TriTech",		NULL,	NULL },
{ 0x54584e00, 0xffffff00, "Texas Instruments",	NULL,	NULL },
{ 0x54584e00, 0xffffff00, "Texas Instruments",	NULL,	NULL },
{ 0x56494100, 0xffffff00, "VIA Technologies",   NULL,	NULL },
{ 0x56494100, 0xffffff00, "VIA Technologies",   NULL,	NULL },
@@ -161,6 +162,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
{ 0x4e534350, 0xffffffff, "LM4550",		patch_lm4550,  	NULL }, // volume wrap fix 
{ 0x4e534350, 0xffffffff, "LM4550",		patch_lm4550,  	NULL }, // volume wrap fix 
{ 0x50534304, 0xffffffff, "UCB1400",		patch_ucb1400,	NULL },
{ 0x50534304, 0xffffffff, "UCB1400",		patch_ucb1400,	NULL },
{ 0x53494c20, 0xffffffe0, "Si3036,8",		mpatch_si3036,	mpatch_si3036, AC97_MODEM_PATCH },
{ 0x53494c20, 0xffffffe0, "Si3036,8",		mpatch_si3036,	mpatch_si3036, AC97_MODEM_PATCH },
{ 0x53544d02, 0xffffffff, "ST7597",		NULL,		NULL },
{ 0x54524102, 0xffffffff, "TR28022",		NULL,		NULL },
{ 0x54524102, 0xffffffff, "TR28022",		NULL,		NULL },
{ 0x54524103, 0xffffffff, "TR28023",		NULL,		NULL },
{ 0x54524103, 0xffffffff, "TR28023",		NULL,		NULL },
{ 0x54524106, 0xffffffff, "TR28026",		NULL,		NULL },
{ 0x54524106, 0xffffffff, "TR28026",		NULL,		NULL },
@@ -213,6 +215,14 @@ static int snd_ac97_valid_reg(struct snd_ac97 *ac97, unsigned short reg)
{
{
	/* filter some registers for buggy codecs */
	/* filter some registers for buggy codecs */
	switch (ac97->id) {
	switch (ac97->id) {
	case AC97_ID_ST_AC97_ID4:
		if (reg == 0x08)
			return 0;
		/* fall through */
	case AC97_ID_ST7597:
		if (reg == 0x22 || reg == 0x7a)
			return 1;
		/* fall through */
	case AC97_ID_AK4540:
	case AC97_ID_AK4540:
	case AC97_ID_AK4542:
	case AC97_ID_AK4542:
		if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c)
		if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c)
Loading