snd_printk("AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); 
snd_printk(KERN_ERR "AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT))); 
static int snd_intel8x0_ich_chip_init(intel8x0_t *chip, int probing){	unsigned long end_time;	unsigned int cnt, status, nstatus;		/* put logic to right state */	/* first clear status bits */	status = ICH_RCS | ICH_MCINT | ICH_POINT | ICH_PIINT;	if (chip->device_type == DEVICE_NFORCE)		status |= ICH_NVSPINT;	cnt = igetdword(chip, ICHREG(GLOB_STA));	iputdword(chip, ICHREG(GLOB_STA), cnt & status);	/* ACLink on, 2 channels */	cnt = igetdword(chip, ICHREG(GLOB_CNT));	cnt &= ~(ICH_ACLINK | ICH_PCM_246_MASK);	/* finish cold or do warm reset */	cnt |= (cnt & ICH_AC97COLD) == 0 ? ICH_AC97COLD : ICH_AC97WARM;	iputdword(chip, ICHREG(GLOB_CNT), cnt);	end_time = (jiffies + (HZ / 4)) + 1;	do {		if ((igetdword(chip, ICHREG(GLOB_CNT)) & ICH_AC97WARM) == 0)			goto __ok;		do_delay(chip);	} while (time_after_eq(end_time, jiffies));	snd_printk("AC'97 warm reset still in progress? [0x%x]\n", igetdword(chip, ICHREG(GLOB_CNT)));	return -EIO;      __ok:	if (probing) {		/* wait for any codec ready status.		 * Once it becomes ready it should remain ready		 * as long as we do not disable the ac97 link.		 */		end_time = jiffies + HZ;		do {			status = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);			if (status)				break;			do_delay(chip);		} while (time_after_eq(end_time, jiffies));		if (! status) {			/* no codec is found */			snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n", igetdword(chip, ICHREG(GLOB_STA)));			return -EIO;		}		if (chip->device_type == DEVICE_INTEL_ICH4)			/* ICH4 can have three codecs */			nstatus = ICH_PCR | ICH_SCR | ICH_TCR;		else			/* others up to two codecs */			nstatus = ICH_PCR | ICH_SCR;		/* wait for other codecs ready status. */		end_time = jiffies + HZ / 4;		while (status != nstatus && time_after_eq(end_time, jiffies)) {			do_delay(chip);			status |= igetdword(chip, ICHREG(GLOB_STA)) & nstatus;		}	} else {		/* resume phase */		int i;		status = 0;		for (i = 0; i < 3; i++)			if (chip->ac97[i])				status |= get_ich_codec_bit(chip, i);		/* wait until all the probed codecs are ready */		end_time = jiffies + HZ;		do {			nstatus = igetdword(chip, ICHREG(GLOB_STA)) & (ICH_PCR | ICH_SCR | ICH_TCR);			if (status == nstatus)				break;			do_delay(chip);		} while (time_after_eq(end_time, jiffies));	}	if (chip->device_type == DEVICE_SIS) {		/* unmute the output on SIS7012 */		iputword(chip, 0x4c, igetword(chip, 0x4c) | 1);	}	if (chip->device_type == DEVICE_NFORCE) {		/* enable SPDIF interrupt */		unsigned int val;		pci_read_config_dword(chip->pci, 0x4c, &val);		val |= 0x1000000;		pci_write_config_dword(chip->pci, 0x4c, val);	}      	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/intel8x0.c/clean/sound/pci/intel8x0.c