viadev->lastpos = res; /* remember the last position */ 
static snd_pcm_uframes_t snd_via686_pcm_pointer(snd_pcm_substream_t *substream){	via82xx_t *chip = snd_pcm_substream_chip(substream);	viadev_t *viadev = (viadev_t *)substream->runtime->private_data;	unsigned int idx, ptr, count, res;	snd_assert(viadev->tbl_entries, return 0);	if (!(inb(VIADEV_REG(viadev, OFFSET_STATUS)) & VIA_REG_STAT_ACTIVE))		return 0;	spin_lock(&chip->reg_lock);	count = inl(VIADEV_REG(viadev, OFFSET_CURR_COUNT)) & 0xffffff;	/* The via686a does not have the current index register,	 * so we need to calculate the index from CURR_PTR.	 */	ptr = inl(VIADEV_REG(viadev, OFFSET_CURR_PTR));	if (ptr <= (unsigned int)viadev->table.addr)		idx = 0;	else /* CURR_PTR holds the address + 8 */		idx = ((ptr - (unsigned int)viadev->table.addr) / 8 - 1) % viadev->tbl_entries;	res = calc_linear_pos(viadev, idx, count);	spin_unlock(&chip->reg_lock);	return bytes_to_frames(substream->runtime, res);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4f550df58f4758ea023704b409830ad9c3b47771/via82xx.c/clean/sound/pci/via82xx.c