Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6210c9160dff82ceaaf5e59cf5f8fcd6bdefa38
Commit:     f6210c9160dff82ceaaf5e59cf5f8fcd6bdefa38
Parent:     ffb7394d51cf6f60a3753a5cc40613fc9d5c5c96
Author:     Trent Piepho <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 24 01:06:36 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:06:37 2007 -0300

    V4L/DVB (6085): cx88-alsa: Fix mmap support
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/cx88/cx88-alsa.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-alsa.c 
b/drivers/media/video/cx88/cx88-alsa.c
index ac317fb..85d6322 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/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>
 
@@ -423,6 +424,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:
@@ -500,6 +503,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 = {
@@ -511,6 +524,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,
 };
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to