From 3fd43858c7937801134bd70ef1d411e44f9c0c1c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 28 May 2009 14:12:27 +0200 Subject: 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: Jaroslav Kysela Signed-off-by: Takashi Iwai --- sound/pci/au88x0/au88x0_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sound/pci') diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 3906f5afe27..f84bb19c7fd 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -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) @@ -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; } -- cgit v1.2.3 From e9ab33d03eb721a632214c0bbaa18652de88aa2d Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 28 May 2009 14:20:00 +0200 Subject: ALSA: au88x0: fix wrong period_elapsed() call The period_elapsed() call should be called when position moves. The idea was taken from ALSA bug#4455. Signed-off-by: Jaroslav Kysela Signed-off-by: Takashi Iwai --- sound/pci/au88x0/au88x0_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/pci') diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index f84bb19c7fd..23f49f356e0 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -2440,7 +2440,8 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id) spin_lock(&vortex->lock); for (i = 0; i < NR_ADB; i++) { if (vortex->dma_adb[i].fifo_status == FIFO_START) { - if (vortex_adbdma_bufshift(vortex, i)) ; + if (!vortex_adbdma_bufshift(vortex, i)) + continue; spin_unlock(&vortex->lock); snd_pcm_period_elapsed(vortex->dma_adb[i]. substream); -- cgit v1.2.3