diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-03-11 16:48:09 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-11 16:48:09 +0300 |
commit | cc99a0861fa1c72335dc91a2e06d0b431911d55e (patch) | |
tree | b5bba9600470f8a5e417519b7c2d5fd13d079c3b /sound/pci/au88x0 | |
parent | bc3a8a01def4fb0ec0ef8a20d097277b9c6b2a1f (diff) | |
parent | 382225e62bdb8059b7f915b133426425516dd300 (diff) | |
download | linux-cc99a0861fa1c72335dc91a2e06d0b431911d55e.tar.xz |
Merge branch 'fix/misc' into topic/misc
Diffstat (limited to 'sound/pci/au88x0')
-rw-r--r-- | sound/pci/au88x0/au88x0_core.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index 23f49f356e0f..16c0bdfbb164 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -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) |