Commit 3fd43858 authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Takashi Iwai

ALSA: au88x0: fix .pointer callback

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: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cd86a536
...@@ -1255,8 +1255,8 @@ static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma) ...@@ -1255,8 +1255,8 @@ static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
int temp; int temp;
temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2));
temp = (dma->period_virt * dma->period_bytes) + (temp & POS_MASK); temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1));
return (temp); return temp;
} }
static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
...@@ -1504,8 +1504,7 @@ static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma) ...@@ -1504,8 +1504,7 @@ static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
int temp; int temp;
temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)); 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 = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1));
temp = (temp & POS_MASK) + ((dma->period_virt) * (dma->period_bytes));
return temp; return temp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment