int snd_ak4117_check_rate_and_errors(ak4117_t *ak4117, unsigned int flags){	snd_pcm_runtime_t *runtime = ak4117->substream ? ak4117->substream->runtime : NULL;	unsigned long _flags;	int res = 0;	unsigned char rcs0, rcs1, rcs2;	unsigned char c0, c1;	rcs1 = reg_read(ak4117, AK4117_REG_RCS1);	if (flags & AK4117_CHECK_NO_STAT)		goto __rate;	rcs0 = reg_read(ak4117, AK4117_REG_RCS0);	rcs2 = reg_read(ak4117, AK4117_REG_RCS2);	// printk("AK IRQ: rcs0 = 0x%x, rcs1 = 0x%x, rcs2 = 0x%x\n", rcs0, rcs1, rcs2);	spin_lock_irqsave(&ak4117->lock, _flags);	if (rcs0 & AK4117_PAR)		ak4117->parity_errors++;	if (rcs0 & AK4117_V)		ak4117->v_bit_errors++;	if (rcs2 & AK4117_CCRC)		ak4117->ccrc_errors++;	if (rcs2 & AK4117_QCRC)		ak4117->qcrc_errors++;	c0 = (ak4117->rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK)) ^                     (rcs0 & (AK4117_QINT | AK4117_CINT | AK4117_STC | AK4117_AUDION | AK4117_AUTO | AK4117_UNLCK));	c1 = (ak4117->rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f)) ^	             (rcs1 & (AK4117_DTSCD | AK4117_NPCM | AK4117_PEM | 0x0f));	ak4117->rcs0 = rcs0 & ~(AK4117_QINT | AK4117_CINT | AK4117_STC);	ak4117->rcs1 = rcs1;	ak4117->rcs2 = rcs2;	spin_unlock_irqrestore(&ak4117->lock, _flags);	if (rcs0 & AK4117_PAR)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[0]->id);	if (rcs0 & AK4117_V)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[1]->id);	if (rcs2 & AK4117_CCRC)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[2]->id);	if (rcs2 & AK4117_QCRC)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[3]->id);	/* rate change */	if (c1 & 0x0f)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[4]->id);	if ((c1 & AK4117_PEM) | (c0 & AK4117_CINT))		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[6]->id);	if (c0 & AK4117_QINT)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[8]->id);	if (c0 & AK4117_AUDION)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[9]->id);	if (c1 & AK4117_NPCM)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[10]->id);	if (c1 & AK4117_DTSCD)		snd_ctl_notify(ak4117->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4117->kctls[11]->id);			if (ak4117->change_callback && (c0 | c1) != 0)		ak4117->change_callback(ak4117, c0, c1);      __rate:	/* compare rate */	res = external_rate(rcs1);	if (!(flags & AK4117_CHECK_NO_RATE) && runtime && runtime->rate != res) {		snd_pcm_stream_lock_irqsave(ak4117->substream, _flags);		if (snd_pcm_running(ak4117->substream)) {			// printk("rate changed (%i <- %i)\n", runtime->rate, res);			snd_pcm_stop(ak4117->substream, SNDRV_PCM_STATE_DRAINING);			wake_up(&runtime->sleep);			res = 1;		}		snd_pcm_stream_unlock_irqrestore(ak4117->substream, _flags);	}	return res;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ak4117.c/clean/sound/i2c/other/ak4117.c