snd_printk("ali_capture_preapre: spdif rate detect err!\n"); 
snd_printk(KERN_WARNING "ali_capture_preapre: spdif rate detect err!\n"); 
static int snd_ali_prepare(snd_pcm_substream_t * substream){	ali_t *codec = snd_pcm_substream_chip(substream);	snd_pcm_runtime_t *runtime = substream->runtime;	snd_ali_voice_t *pvoice = (snd_ali_voice_t *) runtime->private_data;	unsigned long flags;	unsigned int LBA;	unsigned int Delta;	unsigned int ESO;	unsigned int CTRL;	unsigned int GVSEL;	unsigned int PAN;	unsigned int VOL;	unsigned int EC;	u8	 bValue;	spin_lock_irqsave(&codec->reg_lock, flags);	snd_ali_printk("ali_prepare...\n");	snd_ali_enable_special_channel(codec,pvoice->number);	Delta = (pvoice->number == ALI_MODEM_IN_CHANNEL ||		 pvoice->number == ALI_MODEM_OUT_CHANNEL) ? 		0x1000 : snd_ali_convert_rate(runtime->rate, pvoice->mode);	// Prepare capture intr channel	if (pvoice->number == ALI_SPDIF_IN_CHANNEL) {		unsigned int rate;				if (codec->revision != ALI_5451_V02) {			spin_unlock_irqrestore(&codec->reg_lock, flags);						return -1;		}		rate = snd_ali_get_spdif_in_rate(codec);		if (rate == 0) {			snd_printk("ali_capture_preapre: spdif rate detect err!\n");			rate = 48000;		}		bValue = inb(ALI_REG(codec,ALI_SPDIF_CTRL));		if (bValue & 0x10) {			outb(bValue,ALI_REG(codec,ALI_SPDIF_CTRL));			printk("clear SPDIF parity error flag.\n");		}		if (rate != 48000)			Delta = ((rate << 12)/runtime->rate)&0x00ffff;	}	// set target ESO for channel 	pvoice->eso = runtime->buffer_size; 	// set interrupt count size 	pvoice->count = runtime->period_size;	// set Loop Back Address 	LBA = runtime->dma_addr;	// set ESO to capture first MIDLP interrupt 	ESO = pvoice->eso - 1;	CTRL = snd_ali_control_mode(substream);	GVSEL = 0;	PAN = 0x00;	VOL = 0x00;	EC = 0;	snd_ali_write_voice_regs(    codec,				     pvoice->number,				     LBA,				     0,	/* cso */				     ESO,				     Delta,				     0,	/* alpha */				     GVSEL,				     PAN,				     VOL,				     CTRL,				     EC);	spin_unlock_irqrestore(&codec->reg_lock, flags);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ali5451.c/buggy/sound/pci/ali5451/ali5451.c