snd_printk("invalid dma1 %d\n", chip->dma1); 
snd_printk(KERN_ERR "invalid dma1 %d\n", chip->dma1); 
static int __devinit snd_es18xx_initialize(es18xx_t *chip){	int mask = 0;        /* enable extended mode */        snd_es18xx_dsp_command(chip, 0xC6);	/* Reset mixer registers */	snd_es18xx_mixer_write(chip, 0x00, 0x00);        /* Audio 1 DMA demand mode (4 bytes/request) */        snd_es18xx_write(chip, 0xB9, 2);	if (chip->caps & ES18XX_CONTROL) {		/* Hardware volume IRQ */		snd_es18xx_config_write(chip, 0x27, chip->irq);		if (chip->fm_port > 0 && chip->fm_port != SNDRV_AUTO_PORT) {			/* FM I/O */			snd_es18xx_config_write(chip, 0x62, chip->fm_port >> 8);			snd_es18xx_config_write(chip, 0x63, chip->fm_port & 0xff);		}		if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {			/* MPU-401 I/O */			snd_es18xx_config_write(chip, 0x64, chip->mpu_port >> 8);			snd_es18xx_config_write(chip, 0x65, chip->mpu_port & 0xff);			/* MPU-401 IRQ */			snd_es18xx_config_write(chip, 0x28, chip->irq);		}		/* Audio1 IRQ */		snd_es18xx_config_write(chip, 0x70, chip->irq);		/* Audio2 IRQ */		snd_es18xx_config_write(chip, 0x72, chip->irq);		/* Audio1 DMA */		snd_es18xx_config_write(chip, 0x74, chip->dma1);		/* Audio2 DMA */		snd_es18xx_config_write(chip, 0x75, chip->dma2);		/* Enable Audio 1 IRQ */		snd_es18xx_write(chip, 0xB1, 0x50);		/* Enable Audio 2 IRQ */		snd_es18xx_mixer_write(chip, 0x7A, 0x40);		/* Enable Audio 1 DMA */		snd_es18xx_write(chip, 0xB2, 0x50);		/* Enable MPU and hardware volume interrupt */		snd_es18xx_mixer_write(chip, 0x64, 0x42);	}	else {		int irqmask, dma1mask, dma2mask;		switch (chip->irq) {		case 2:		case 9:			irqmask = 0;			break;		case 5:			irqmask = 1;			break;		case 7:			irqmask = 2;			break;		case 10:			irqmask = 3;			break;		default:			snd_printk("invalid irq %d\n", chip->irq);			return -ENODEV;		}		switch (chip->dma1) {		case 0:			dma1mask = 1;			break;		case 1:			dma1mask = 2;			break;		case 3:			dma1mask = 3;			break;		default:			snd_printk("invalid dma1 %d\n", chip->dma1);			return -ENODEV;		}		switch (chip->dma2) {		case 0:			dma2mask = 0;			break;		case 1:			dma2mask = 1;			break;		case 3:			dma2mask = 2;			break;		case 5:			dma2mask = 3;			break;		default:			snd_printk("invalid dma2 %d\n", chip->dma2);			return -ENODEV;		}		/* Enable and set Audio 1 IRQ */		snd_es18xx_write(chip, 0xB1, 0x50 | (irqmask << 2));		/* Enable and set Audio 1 DMA */		snd_es18xx_write(chip, 0xB2, 0x50 | (dma1mask << 2));		/* Set Audio 2 DMA */		snd_es18xx_mixer_bits(chip, 0x7d, 0x07, 0x04 | dma2mask);		/* Enable Audio 2 IRQ and DMA		   Set capture mixer input */		snd_es18xx_mixer_write(chip, 0x7A, 0x68);		/* Enable and set hardware volume interrupt */		snd_es18xx_mixer_write(chip, 0x64, 0x06);		if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {			/* MPU401 share irq with audio			   Joystick enabled			   FM enabled */			snd_es18xx_mixer_write(chip, 0x40, 0x43 | (chip->mpu_port & 0xf0) >> 1);		}		snd_es18xx_mixer_write(chip, 0x7f, ((irqmask + 1) << 1) | 0x01);	}	if (chip->caps & ES18XX_NEW_RATE) {		/* Change behaviour of register A1		   4x oversampling		   2nd channel DAC asynchronous */		snd_es18xx_mixer_write(chip, 0x71, 0x32);	}	if (!(chip->caps & ES18XX_PCM2)) {		/* Enable DMA FIFO */		snd_es18xx_write(chip, 0xB7, 0x80);	}	if (chip->caps & ES18XX_SPATIALIZER) {		/* Set spatializer parameters to recommended values */		snd_es18xx_mixer_write(chip, 0x54, 0x8f);		snd_es18xx_mixer_write(chip, 0x56, 0x95);		snd_es18xx_mixer_write(chip, 0x58, 0x94);		snd_es18xx_mixer_write(chip, 0x5a, 0x80);	}	/* Mute input source */	if (chip->caps & ES18XX_MUTEREC)		mask = 0x10;	if (chip->caps & ES18XX_RECMIX)		snd_es18xx_mixer_write(chip, 0x1c, 0x05 | mask);	else {		snd_es18xx_mixer_write(chip, 0x1c, 0x00 | mask);		snd_es18xx_write(chip, 0xb4, 0x00);	}#ifndef AVOID_POPS	/* Enable PCM output */	snd_es18xx_dsp_command(chip, 0xD1);#endif        return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/es18xx.c/buggy/sound/isa/es18xx.c