| .. | .. |
|---|
| 340 | 340 | */ |
|---|
| 341 | 341 | int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) |
|---|
| 342 | 342 | { |
|---|
| 343 | | - struct au1100fb_device *fbdev; |
|---|
| 343 | + struct au1100fb_device *fbdev = to_au1100fb_device(fbi); |
|---|
| 344 | 344 | |
|---|
| 345 | | - fbdev = to_au1100fb_device(fbi); |
|---|
| 346 | | - |
|---|
| 347 | | - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
|---|
| 348 | 345 | pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6 |
|---|
| 349 | 346 | |
|---|
| 350 | | - return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); |
|---|
| 347 | + return dma_mmap_coherent(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys, |
|---|
| 348 | + fbdev->fb_len); |
|---|
| 351 | 349 | } |
|---|
| 352 | 350 | |
|---|
| 353 | | -static struct fb_ops au1100fb_ops = |
|---|
| 351 | +static const struct fb_ops au1100fb_ops = |
|---|
| 354 | 352 | { |
|---|
| 355 | 353 | .owner = THIS_MODULE, |
|---|
| 356 | 354 | .fb_setcolreg = au1100fb_fb_setcolreg, |
|---|
| .. | .. |
|---|
| 412 | 410 | { |
|---|
| 413 | 411 | struct au1100fb_device *fbdev; |
|---|
| 414 | 412 | struct resource *regs_res; |
|---|
| 415 | | - unsigned long page; |
|---|
| 416 | 413 | struct clk *c; |
|---|
| 417 | 414 | |
|---|
| 418 | 415 | /* Allocate new device private */ |
|---|
| .. | .. |
|---|
| 424 | 421 | goto failed; |
|---|
| 425 | 422 | |
|---|
| 426 | 423 | platform_set_drvdata(dev, (void *)fbdev); |
|---|
| 424 | + fbdev->dev = &dev->dev; |
|---|
| 427 | 425 | |
|---|
| 428 | 426 | /* Allocate region for our registers and map them */ |
|---|
| 429 | 427 | regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
|---|
| .. | .. |
|---|
| 471 | 469 | |
|---|
| 472 | 470 | au1100fb_fix.smem_start = fbdev->fb_phys; |
|---|
| 473 | 471 | au1100fb_fix.smem_len = fbdev->fb_len; |
|---|
| 474 | | - |
|---|
| 475 | | - /* |
|---|
| 476 | | - * Set page reserved so that mmap will work. This is necessary |
|---|
| 477 | | - * since we'll be remapping normal memory. |
|---|
| 478 | | - */ |
|---|
| 479 | | - for (page = (unsigned long)fbdev->fb_mem; |
|---|
| 480 | | - page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len); |
|---|
| 481 | | - page += PAGE_SIZE) { |
|---|
| 482 | | -#ifdef CONFIG_DMA_NONCOHERENT |
|---|
| 483 | | - SetPageReserved(virt_to_page(CAC_ADDR((void *)page))); |
|---|
| 484 | | -#else |
|---|
| 485 | | - SetPageReserved(virt_to_page(page)); |
|---|
| 486 | | -#endif |
|---|
| 487 | | - } |
|---|
| 488 | 472 | |
|---|
| 489 | 473 | print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); |
|---|
| 490 | 474 | print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); |
|---|