#if 0 printk("(4) jiffies = %li\n", jiffies); snd_printk("mce_down - exit = 0x%x\n", __cs4231_readb(chip, CS4231P(chip, REGSEL))); #endif 
static void snd_cs4231_mce_down(cs4231_t *chip){	unsigned long flags;	int timeout;	spin_lock_irqsave(&chip->lock, flags);	snd_cs4231_busy_wait(chip);#if 0	printk("(1) timeout = %i\n", timeout);#endif#ifdef CONFIG_SND_DEBUG	if (__cs4231_readb(chip, CS4231P(chip, REGSEL)) & CS4231_INIT)		snd_printk("mce_down [%p] - auto calibration time out (0)\n", CS4231P(chip, REGSEL));#endif	chip->mce_bit &= ~CS4231_MCE;	timeout = __cs4231_readb(chip, CS4231P(chip, REGSEL));	__cs4231_writeb(chip, chip->mce_bit | (timeout & 0x1f), CS4231P(chip, REGSEL));	if (timeout == 0x80)		snd_printk("mce_down [%p]: serious init problem - codec still busy\n", chip->port);	if ((timeout & CS4231_MCE) == 0) {		spin_unlock_irqrestore(&chip->lock, flags);		return;	}	snd_cs4231_busy_wait(chip);	/* calibration process */	for (timeout = 500; timeout > 0 && (snd_cs4231_in(chip, CS4231_TEST_INIT) & CS4231_CALIB_IN_PROGRESS) == 0; timeout--)		udelay(100);	if ((snd_cs4231_in(chip, CS4231_TEST_INIT) & CS4231_CALIB_IN_PROGRESS) == 0) {		snd_printd("cs4231_mce_down - auto calibration time out (1)\n");		spin_unlock_irqrestore(&chip->lock, flags);		return;	}#if 0	printk("(2) timeout = %i, jiffies = %li\n", timeout, jiffies);#endif	/* in 10ms increments, check condition, up to 250ms */	timeout = 25;	while (snd_cs4231_in(chip, CS4231_TEST_INIT) & CS4231_CALIB_IN_PROGRESS) {		spin_unlock_irqrestore(&chip->lock, flags);		if (--timeout < 0) {			snd_printk("mce_down - auto calibration time out (2)\n");			return;		}		msleep(10);		spin_lock_irqsave(&chip->lock, flags);	}#if 0	printk("(3) jiffies = %li\n", jiffies);#endif	/* in 10ms increments, check condition, up to 100ms */	timeout = 10;	while (__cs4231_readb(chip, CS4231P(chip, REGSEL)) & CS4231_INIT) {		spin_unlock_irqrestore(&chip->lock, flags);		if (--timeout < 0) {			snd_printk("mce_down - auto calibration time out (3)\n");			return;		}		msleep(10);		spin_lock_irqsave(&chip->lock, flags);	}	spin_unlock_irqrestore(&chip->lock, flags);#if 0	printk("(4) jiffies = %li\n", jiffies);	snd_printk("mce_down - exit = 0x%x\n", __cs4231_readb(chip, CS4231P(chip, REGSEL)));#endif}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a131430c200f6bda313bf5d0a8e238c41afdfe0a/cs4231.c/clean/sound/sparc/cs4231.c