diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-08-23 21:06:36 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2007-08-23 21:06:36 -0700 |
commit | c2b360cb71e99d5c5f9c12330e57cedb39336244 (patch) | |
tree | 84b1145aa35db8030b5b804665969ad9fd8d4eff /linux/drivers | |
parent | 90a08471201250a55f584ca6b7b17548260c2c33 (diff) | |
download | mediapointer-dvb-s2-c2b360cb71e99d5c5f9c12330e57cedb39336244.tar.gz mediapointer-dvb-s2-c2b360cb71e99d5c5f9c12330e57cedb39336244.tar.bz2 |
cx88-alsa: Fix mmap support
From: Trent Piepho <xyzzy@speakeasy.org>
The driver has long claimed to support mmap, but it didn't work at all. Some
of the dma buffer parameters weren't set, and since video_buf uses vmalloc to
allocate the buffer, a page callback is needed too.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-alsa.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c index 1482762bd..67d17e753 100644 --- a/linux/drivers/media/video/cx88/cx88-alsa.c +++ b/linux/drivers/media/video/cx88/cx88-alsa.c @@ -28,6 +28,7 @@ #include <linux/init.h> #include <linux/device.h> #include <linux/interrupt.h> +#include <linux/vmalloc.h> #include <linux/dma-mapping.h> #include <linux/pci.h> @@ -462,6 +463,8 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream, chip->dma_risc = buf->vb.dma; substream->runtime->dma_area = chip->dma_risc.vmalloc; + substream->runtime->dma_bytes = chip->dma_size; + substream->runtime->dma_addr = 0; return 0; error: @@ -545,6 +548,16 @@ static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream) } /* + * page callback (needed for mmap) + */ +static struct page *snd_cx88_page(struct snd_pcm_substream *substream, + unsigned long offset) +{ + void *pageptr = substream->runtime->dma_area + offset; + return vmalloc_to_page(pageptr); +} + +/* * operators */ static struct snd_pcm_ops snd_cx88_pcm_ops = { @@ -556,6 +569,7 @@ static struct snd_pcm_ops snd_cx88_pcm_ops = { .prepare = snd_cx88_prepare, .trigger = snd_cx88_card_trigger, .pointer = snd_cx88_pointer, + .page = snd_cx88_page, }; /* |