int snd_ak4114_check_rate_and_errors(ak4114_t *ak4114, unsigned int flags){	snd_pcm_runtime_t *runtime = ak4114->capture_substream ? ak4114->capture_substream->runtime : NULL;	unsigned long _flags;	int res = 0;	unsigned char rcs0, rcs1;	unsigned char c0, c1;	rcs1 = reg_read(ak4114, AK4114_REG_RCS1);	if (flags & AK4114_CHECK_NO_STAT)		goto __rate;	rcs0 = reg_read(ak4114, AK4114_REG_RCS0);	spin_lock_irqsave(&ak4114->lock, _flags);	if (rcs0 & AK4114_PAR)		ak4114->parity_errors++;	if (rcs1 & AK4114_V)		ak4114->v_bit_errors++;	if (rcs1 & AK4114_CCRC)		ak4114->ccrc_errors++;	if (rcs1 & AK4114_QCRC)		ak4114->qcrc_errors++;	c0 = (ak4114->rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK)) ^                     (rcs0 & (AK4114_QINT | AK4114_CINT | AK4114_PEM | AK4114_AUDION | AK4114_AUTO | AK4114_UNLCK));	c1 = (ak4114->rcs1 & 0xf0) ^ (rcs1 & 0xf0);	ak4114->rcs0 = rcs0 & ~(AK4114_QINT | AK4114_CINT);	ak4114->rcs1 = rcs1;	spin_unlock_irqrestore(&ak4114->lock, _flags);	if (rcs0 & AK4114_PAR)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[0]->id);	if (rcs0 & AK4114_V)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[1]->id);	if (rcs1 & AK4114_CCRC)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[2]->id);	if (rcs1 & AK4114_QCRC)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[3]->id);	/* rate change */	if (c1 & 0xf0)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[4]->id);	if ((c0 & AK4114_PEM) | (c0 & AK4114_CINT))		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[9]->id);	if (c0 & AK4114_QINT)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[10]->id);	if (c0 & AK4114_AUDION)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[11]->id);	if (c0 & AK4114_AUTO)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[12]->id);	if (c0 & AK4114_DTSCD)		snd_ctl_notify(ak4114->card, SNDRV_CTL_EVENT_MASK_VALUE, &ak4114->kctls[13]->id);	if (ak4114->change_callback && (c0 | c1) != 0)		ak4114->change_callback(ak4114, c0, c1);      __rate:	/* compare rate */	res = external_rate(rcs1);	if (!(flags & AK4114_CHECK_NO_RATE) && runtime && runtime->rate != res) {		snd_pcm_stream_lock_irqsave(ak4114->capture_substream, _flags);		if (snd_pcm_running(ak4114->capture_substream)) {			// printk("rate changed (%i <- %i)\n", runtime->rate, res);			snd_pcm_stop(ak4114->capture_substream, SNDRV_PCM_STATE_DRAINING);			res = 1;		}		snd_pcm_stream_unlock_irqrestore(ak4114->capture_substream, _flags);	}	return res;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ak4114.c/clean/sound/i2c/other/ak4114.c