snd_printk("ali_detect_spdif_rate: timeout!\n"); 
snd_printk(KERN_ERR "ali_detect_spdif_rate: timeout!\n"); 
static void snd_ali_detect_spdif_rate(ali_t *codec){	u16 wval  = 0;	u16 count = 0;	u8  bval = 0, R1 = 0, R2 = 0;	bval  = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1));	bval |= 0x1F;	outb(bval,ALI_REG(codec,ALI_SPDIF_CTRL + 1));	while (((R1 < 0x0B )||(R1 > 0x0E)) && (R1 != 0x12) && count <= 50000) {		count ++;		snd_ali_delay(codec, 6);		bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1));		R1 = bval & 0x1F;	}	if (count > 50000) {		snd_printk("ali_detect_spdif_rate: timeout!\n");		return;	}	count = 0;	while (count++ <= 50000) {		snd_ali_delay(codec, 6);		bval = inb(ALI_REG(codec,ALI_SPDIF_CTRL + 1));		R2 = bval & 0x1F;		if (R2 != R1) R1 = R2; else break;	}	if (count > 50000) {		snd_printk("ali_detect_spdif_rate: timeout!\n");		return;	}	if (R2 >= 0x0b && R2 <= 0x0e) {		wval  = inw(ALI_REG(codec,ALI_SPDIF_CTRL + 2));		wval &= 0xE0F0;		wval |= (u16)0x09 << 8 | (u16)0x05;		outw(wval,ALI_REG(codec,ALI_SPDIF_CTRL + 2));		bval  = inb(ALI_REG(codec,ALI_SPDIF_CS +3)) & 0xF0;		outb(bval|0x02,ALI_REG(codec,ALI_SPDIF_CS + 3));	} else if (R2 == 0x12) {		wval  = inw(ALI_REG(codec,ALI_SPDIF_CTRL + 2));		wval &= 0xE0F0;		wval |= (u16)0x0E << 8 | (u16)0x08;		outw(wval,ALI_REG(codec,ALI_SPDIF_CTRL + 2));		bval  = inb(ALI_REG(codec,ALI_SPDIF_CS +3)) & 0xF0;		outb(bval|0x03,ALI_REG(codec,ALI_SPDIF_CS + 3));	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ali5451.c/buggy/sound/pci/ali5451/ali5451.c