diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-05-28 08:12:27 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-29 02:15:57 -0400 |
commit | 3fd43858c7937801134bd70ef1d411e44f9c0c1c (patch) | |
tree | 01469fbd03e06e4705d1e7cf2537cc76f3d8cea9 /sound/pci/au88x0 | |
parent | cd86a536c81e9300d984327517548ca0652eebf9 (diff) |
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 <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/au88x0')
-rw-r--r-- | sound/pci/au88x0/au88x0_core.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 3906f5afe27a..f84bb19c7fdd 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) | |||
1255 | int temp; | 1255 | int temp; |
1256 | 1256 | ||
1257 | temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); | 1257 | temp = hwread(vortex->mmio, VORTEX_ADBDMA_STAT + (adbdma << 2)); |
1258 | temp = (dma->period_virt * dma->period_bytes) + (temp & POS_MASK); | 1258 | temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); |
1259 | return (temp); | 1259 | return temp; |
1260 | } | 1260 | } |
1261 | 1261 | ||
1262 | static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma) | 1262 | 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 | int temp; | 1504 | int temp; |
1505 | 1505 | ||
1506 | temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)); | 1506 | temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2)); |
1507 | //temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK)); | 1507 | temp = (dma->period_virt * dma->period_bytes) + (temp & (dma->period_bytes - 1)); |
1508 | temp = (temp & POS_MASK) + ((dma->period_virt) * (dma->period_bytes)); | ||
1509 | return temp; | 1508 | return temp; |
1510 | } | 1509 | } |
1511 | 1510 | ||