Skip to content

Commit

Permalink
ALSA: au88x0 - Modify pointer callback to give accurate playback posi…
Browse files Browse the repository at this point in the history
…tion

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Raymond Yau authored and Takashi Iwai committed Feb 14, 2011
1 parent 6146124 commit 5e5677f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions sound/pci/au88x0/au88x0_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,11 +1252,19 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
{
stream_t *dma = &vortex->dma_adb[adbdma];
int temp;
int temp, page, delta;

temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2));
temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1));
return temp;
page = (temp & ADB_SUBBUF_MASK) >> ADB_SUBBUF_SHIFT;
if (dma->nr_periods >= 4)
delta = (page - dma->period_real) & 3;
else {
delta = (page - dma->period_real);
if (delta < 0)
delta += dma->nr_periods;
}
return (dma->period_virt + delta) * dma->period_bytes
+ (temp & (dma->period_bytes - 1));
}

static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
Expand Down

0 comments on commit 5e5677f

Please sign in to comment.