summaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctatc.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2010-02-02 19:58:25 +0100
committerJaroslav Kysela <perex@perex.cz>2010-02-04 21:48:00 +0100
commit21956b61f594f7924d98240da74bc81c28601fa9 (patch)
tree0514becc673bcd8b952af728700af5cdfef15e0d /sound/pci/ctxfi/ctatc.c
parentc68db7175f4dcb3d5789bb50bea6376fb81f87fe (diff)
ALSA: ctxfi - fix PTP address initialization
After hours of debugging, I finally found the reason why some source and runtime combination does not work. The PTP (page table pages) address must be aligned. I am not sure how much, but alignment to PAGE_SIZE is sufficient. Also, use ALSA's page allocation routines to ensure proper virtual -> physical address translation. Cc: <stable@kernel.org> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/ctxfi/ctatc.c')
-rw-r--r--sound/pci/ctxfi/ctatc.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index cb65bd0dd35..459c1f62783 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -166,18 +166,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index)
{
- struct ct_vm *vm;
- void *kvirt_addr;
- unsigned long phys_addr;
-
- vm = atc->vm;
- kvirt_addr = vm->get_ptp_virt(vm, index);
- if (kvirt_addr == NULL)
- phys_addr = (~0UL);
- else
- phys_addr = virt_to_phys(kvirt_addr);
-
- return phys_addr;
+ return atc->vm->get_ptp_phys(atc->vm, index);
}
static unsigned int convert_format(snd_pcm_format_t snd_format)
@@ -1669,7 +1658,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
}
/* Set up device virtual memory management object */
- err = ct_vm_create(&atc->vm);
+ err = ct_vm_create(&atc->vm, pci);
if (err < 0)
goto error1;