if ((ac97->ext_id & AC97_EI_DRA) && reg == AC97_PCM_FRONT_DAC_RATE) { /* Intel controllers require double rate data to be put in * slots 7+8 */ snd_ac97_update_bits(ac97, AC97_GENERAL_PURPOSE, AC97_GP_DRSS_MASK, dbl ? AC97_GP_DRSS_78 : 0); snd_ac97_read(ac97, AC97_GENERAL_PURPOSE); } 
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate){	int dbl;	unsigned int tmp;		dbl = rate > 48000;	if (dbl) {		if (!(ac97->flags & AC97_DOUBLE_RATE))			return -EINVAL;		if (reg != AC97_PCM_FRONT_DAC_RATE)			return -EINVAL;	}	switch (reg) {	case AC97_PCM_MIC_ADC_RATE:		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRM) == 0)	/* MIC VRA */			if (rate != 48000)				return -EINVAL;		break;	case AC97_PCM_FRONT_DAC_RATE:	case AC97_PCM_LR_ADC_RATE:		if ((ac97->regs[AC97_EXTENDED_STATUS] & AC97_EA_VRA) == 0)	/* VRA */			if (rate != 48000 && rate != 96000)				return -EINVAL;		break;	case AC97_PCM_SURR_DAC_RATE:		if (! (ac97->scaps & AC97_SCAP_SURROUND_DAC))			return -EINVAL;		break;	case AC97_PCM_LFE_DAC_RATE:		if (! (ac97->scaps & AC97_SCAP_CENTER_LFE_DAC))			return -EINVAL;		break;	case AC97_SPDIF:		/* special case */		return set_spdif_rate(ac97, rate);	default:		return -EINVAL;	}	if (dbl)		rate /= 2;	tmp = (rate * ac97->bus->clock) / 48000;	if (tmp > 65535)		return -EINVAL;	if ((ac97->ext_id & AC97_EI_DRA) && reg == AC97_PCM_FRONT_DAC_RATE)		snd_ac97_update_bits(ac97, AC97_EXTENDED_STATUS,				     AC97_EA_DRA, dbl ? AC97_EA_DRA : 0);	snd_ac97_update(ac97, reg, tmp & 0xffff);	snd_ac97_read(ac97, reg);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/091e95ee7febf894603475c44d51f8ec4fab4328/ac97_pcm.c/buggy/sound/pci/ac97/ac97_pcm.c