snd_printk("Writing to ADC failed!\n"); 
snd_printk(KERN_ERR "Writing to ADC failed!\n"); 
int snd_ca0106_i2c_write(ca0106_t *emu,				u32 reg,				u32 value){	u32 tmp;	int timeout=0;	int status;	int retry;	if ((reg > 0x7f) || (value > 0x1ff))	{                snd_printk("i2c_write: invalid values.\n");		return -EINVAL;	}	tmp = reg << 25 | value << 16;	/* Not sure what this I2C channel controls. */	/* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */	/* This controls the I2C connected to the WM8775 ADC Codec */	snd_ca0106_ptr_write(emu, I2C_D1, 0, tmp);	for(retry=0;retry<10;retry++)	{		/* Send the data to i2c */		tmp = snd_ca0106_ptr_read(emu, I2C_A, 0);		tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK);		tmp = tmp | (I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD);		snd_ca0106_ptr_write(emu, I2C_A, 0, tmp);		/* Wait till the transaction ends */		while(1)		{			status = snd_ca0106_ptr_read(emu, I2C_A, 0);                	//snd_printk("I2C:status=0x%x\n", status);			timeout++;			if((status & I2C_A_ADC_START)==0)				break;			if(timeout>1000)				break;		}		//Read back and see if the transaction is successful		if((status & I2C_A_ADC_ABORT)==0)			break;	}	if(retry==10)	{                snd_printk("Writing to ADC failed!\n");		return -EINVAL;	}        	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ca0106_main.c/buggy/sound/pci/ca0106/ca0106_main.c