ts-7000
[Top] [All Lists]

[ts-7000] strange problem mmap

To:
Subject: [ts-7000] strange problem mmap
From: "chaisc97" <>
Date: Sat, 29 Sep 2007 23:13:09 -0000
i try to write a video driver for ts7200 using s1d13506. now the lcd
has start, now the problem is i can write the data to the video
memeory however when i read the data i get the wrong value, what's
wrong with my code?

the **_mmap like this
s1d13xxx_mmap(struct fb_info *info, struct file *file, struct
vm_area_struct *vma)
{

       unsigned long off, start;
        u32 len;
        unsigned long size  = vma->vm_end - vma->vm_start;
        off = vma->vm_pgoff << PAGE_SHIFT;
        start = S1D_PHYSICAL_VMEM_ADDR;
        unsigned long page, pos;

        len = PAGE_ALIGN(start & ~PAGE_MASK) + S1D_PHYSICAL_VMEM_SIZE;
/*
S1D_PHYSICAL_VMEM_ADDR=0x20000000
S1D_PHYSICAL_VMEM_SIZE=0x200000L
*/

        start &= PAGE_MASK;

        if ((vma->vm_end - vma->vm_start + off) > len)
                return -EINVAL;

        off += start;

        vma->vm_pgoff = off >> PAGE_SHIFT;

        vma->vm_flags |= VM_IO;

        start=vma->vm_start;
        size=vma->vm_end - vma->vm_start;
        pos=off;//S1D_PHYSICAL_VMEM_ADDR;
        while(size>0)
while(size>0)
        {
                 if (io_remap_page_range(start,pos,PAGE_SIZE,
PAGE_SHARED))
                        return -EAGAIN;
                        start += PAGE_SIZE;
                         pos += PAGE_SIZE;
                 if (size > PAGE_SIZE)
                        size -= PAGE_SIZE;
                else
                        size = 0;
        }



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] strange problem mmap, chaisc97 <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU