| .. | .. |
|---|
| 147 | 147 | struct au1200fb_device { |
|---|
| 148 | 148 | struct fb_info *fb_info; /* FB driver info record */ |
|---|
| 149 | 149 | struct au1200fb_platdata *pd; |
|---|
| 150 | + struct device *dev; |
|---|
| 150 | 151 | |
|---|
| 151 | 152 | int plane; |
|---|
| 152 | 153 | unsigned char* fb_mem; /* FrameBuffer memory map */ |
|---|
| .. | .. |
|---|
| 1232 | 1233 | { |
|---|
| 1233 | 1234 | struct au1200fb_device *fbdev = info->par; |
|---|
| 1234 | 1235 | |
|---|
| 1235 | | - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
|---|
| 1236 | | - pgprot_val(vma->vm_page_prot) |= _CACHE_MASK; /* CCA=7 */ |
|---|
| 1237 | | - |
|---|
| 1238 | | - return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len); |
|---|
| 1236 | + return dma_mmap_attrs(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys, |
|---|
| 1237 | + fbdev->fb_len, 0); |
|---|
| 1239 | 1238 | } |
|---|
| 1240 | 1239 | |
|---|
| 1241 | 1240 | static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata) |
|---|
| .. | .. |
|---|
| 1484 | 1483 | } |
|---|
| 1485 | 1484 | |
|---|
| 1486 | 1485 | |
|---|
| 1487 | | -static struct fb_ops au1200fb_fb_ops = { |
|---|
| 1486 | +static const struct fb_ops au1200fb_fb_ops = { |
|---|
| 1488 | 1487 | .owner = THIS_MODULE, |
|---|
| 1489 | 1488 | .fb_check_var = au1200fb_fb_check_var, |
|---|
| 1490 | 1489 | .fb_set_par = au1200fb_fb_set_par, |
|---|
| .. | .. |
|---|
| 1647 | 1646 | struct au1200fb_device *fbdev; |
|---|
| 1648 | 1647 | struct au1200fb_platdata *pd; |
|---|
| 1649 | 1648 | struct fb_info *fbi = NULL; |
|---|
| 1650 | | - unsigned long page; |
|---|
| 1651 | 1649 | int bpp, plane, ret, irq; |
|---|
| 1652 | 1650 | |
|---|
| 1653 | 1651 | print_info("" DRIVER_DESC ""); |
|---|
| .. | .. |
|---|
| 1685 | 1683 | fbdev = fbi->par; |
|---|
| 1686 | 1684 | fbdev->fb_info = fbi; |
|---|
| 1687 | 1685 | fbdev->pd = pd; |
|---|
| 1686 | + fbdev->dev = &dev->dev; |
|---|
| 1688 | 1687 | |
|---|
| 1689 | 1688 | fbdev->plane = plane; |
|---|
| 1690 | 1689 | |
|---|
| .. | .. |
|---|
| 1693 | 1692 | |
|---|
| 1694 | 1693 | fbdev->fb_mem = dmam_alloc_attrs(&dev->dev, |
|---|
| 1695 | 1694 | PAGE_ALIGN(fbdev->fb_len), |
|---|
| 1696 | | - &fbdev->fb_phys, GFP_KERNEL, |
|---|
| 1697 | | - DMA_ATTR_NON_CONSISTENT); |
|---|
| 1695 | + &fbdev->fb_phys, GFP_KERNEL, 0); |
|---|
| 1698 | 1696 | if (!fbdev->fb_mem) { |
|---|
| 1699 | 1697 | print_err("fail to allocate framebuffer (size: %dK))", |
|---|
| 1700 | 1698 | fbdev->fb_len / 1024); |
|---|
| .. | .. |
|---|
| 1702 | 1700 | goto failed; |
|---|
| 1703 | 1701 | } |
|---|
| 1704 | 1702 | |
|---|
| 1705 | | - /* |
|---|
| 1706 | | - * Set page reserved so that mmap will work. This is necessary |
|---|
| 1707 | | - * since we'll be remapping normal memory. |
|---|
| 1708 | | - */ |
|---|
| 1709 | | - for (page = (unsigned long)fbdev->fb_phys; |
|---|
| 1710 | | - page < PAGE_ALIGN((unsigned long)fbdev->fb_phys + |
|---|
| 1711 | | - fbdev->fb_len); |
|---|
| 1712 | | - page += PAGE_SIZE) { |
|---|
| 1713 | | - SetPageReserved(pfn_to_page(page >> PAGE_SHIFT)); /* LCD DMA is NOT coherent on Au1200 */ |
|---|
| 1714 | | - } |
|---|
| 1715 | 1703 | print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); |
|---|
| 1716 | 1704 | print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024); |
|---|
| 1717 | 1705 | |
|---|