Skip to content

Commit

Permalink
ALSA: au88x0: fix .pointer callback
Browse files Browse the repository at this point in the history
Appearently, the used mask in the .pointer callback is invalid. It should
be in period_bytes range. The period_bytes is pow(2), so simple bitwise
operation is used.

Idea was taken from ALSA bug#4455.

Signed-off-by: Jaroslav Kysela <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
perexg authored and tiwai committed May 29, 2009
1 parent cd86a53 commit 3fd4385
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sound/pci/au88x0/au88x0_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,8 @@ static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
int temp;

temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2));
temp = (dma->period_virt * dma->period_bytes) + (temp & POS_MASK);
return (temp);
temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1));
return temp;
}

static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
Expand Down Expand Up @@ -1504,8 +1504,7 @@ static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
int temp;

temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2));
//temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK));
temp = (temp & POS_MASK) + ((dma->period_virt) * (dma->period_bytes));
temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1));
return temp;
}

Expand Down

0 comments on commit 3fd4385

Please sign in to comment.