snd_printk("AC'97 write problem, codec_index = %d, reg = 0x%x, val = 0x%x\n", codec_index, reg, val); 
snd_printk(KERN_ERR "AC'97 write problem, codec_index = %d, reg = 0x%x, val = 0x%x\n", codec_index, reg, val); 
static void snd_cs46xx_codec_write(cs46xx_t *chip,				   unsigned short reg,				   unsigned short val,				   int codec_index){	int count;	snd_assert ((codec_index == CS46XX_PRIMARY_CODEC_INDEX) ||		    (codec_index == CS46XX_SECONDARY_CODEC_INDEX),		    return);	chip->active_ctrl(chip, 1);	/*	 *  1. Write ACCAD = Command Address Register = 46Ch for AC97 register address	 *  2. Write ACCDA = Command Data Register = 470h    for data to write to AC97	 *  3. Write ACCTL = Control Register = 460h for initiating the write	 *  4. Read ACCTL = 460h, DCV should be reset by now and 460h = 07h	 *  5. if DCV not cleared, break and return error	 */	/*	 *  Setup the AC97 control registers on the CS461x to send the	 *  appropriate command to the AC97 to perform the read.	 *  ACCAD = Command Address Register = 46Ch	 *  ACCDA = Command Data Register = 470h	 *  ACCTL = Control Register = 460h	 *  set DCV - will clear when process completed	 *  reset CRW - Write command	 *  set VFRM - valid frame enabled	 *  set ESYN - ASYNC generation enabled	 *  set RSTN - ARST# inactive, AC97 codec not reset         */	snd_cs46xx_pokeBA0(chip, BA0_ACCAD , reg);	snd_cs46xx_pokeBA0(chip, BA0_ACCDA , val);	snd_cs46xx_peekBA0(chip, BA0_ACCTL);	if (codec_index == CS46XX_PRIMARY_CODEC_INDEX) {		snd_cs46xx_pokeBA0(chip, BA0_ACCTL, /* clear ACCTL_DCV */ ACCTL_VFRM |				   ACCTL_ESYN | ACCTL_RSTN);		snd_cs46xx_pokeBA0(chip, BA0_ACCTL, ACCTL_DCV | ACCTL_VFRM |				   ACCTL_ESYN | ACCTL_RSTN);	} else {		snd_cs46xx_pokeBA0(chip, BA0_ACCTL, ACCTL_DCV | ACCTL_TC |				   ACCTL_VFRM | ACCTL_ESYN | ACCTL_RSTN);	}	for (count = 0; count < 4000; count++) {		/*		 *  First, we want to wait for a short time.		 */		udelay(10);		/*		 *  Now, check to see if the write has completed.		 *  ACCTL = 460h, DCV should be reset by now and 460h = 07h		 */		if (!(snd_cs46xx_peekBA0(chip, BA0_ACCTL) & ACCTL_DCV)) {			goto end;		}	}	snd_printk("AC'97 write problem, codec_index = %d, reg = 0x%x, val = 0x%x\n", codec_index, reg, val); end:	chip->active_ctrl(chip, -1);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/cs46xx_lib.c/clean/sound/pci/cs46xx/cs46xx_lib.c