diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2014-05-09 18:52:44 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-05-16 04:56:12 -0400 |
commit | 7ceb1892c04c6c27765cc6139d6057b72dc86e95 (patch) | |
tree | dabc8ebef9488c350d582e7af33f5dd4ad4424e2 /drivers/video | |
parent | dc42715fafed88f44e01eadb965fafa3ceea72bc (diff) |
video: omap: delete support for early fbmem allocation
Commit 1e434f9318efc3dddc0c0b8d2071712668154c2b (OMAPFB: remove early mem
alloc from old omapfb) deleted the support for early fbmem allocation
from the platform code, but some code still remains in the driver side.
Delete this code now, as it repotedly causes build issues on !MMU.
The patch was tested on Amstrad E3 and Nokia 770 and framebuffer
functionality is not affected.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/omap/lcdc.c | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index b52f62595f65..6efa2591eaa8 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c | |||
@@ -74,7 +74,6 @@ static struct omap_lcd_controller { | |||
74 | void (*dma_callback)(void *data); | 74 | void (*dma_callback)(void *data); |
75 | void *dma_callback_data; | 75 | void *dma_callback_data; |
76 | 76 | ||
77 | int fbmem_allocated; | ||
78 | dma_addr_t vram_phys; | 77 | dma_addr_t vram_phys; |
79 | void *vram_virt; | 78 | void *vram_virt; |
80 | unsigned long vram_size; | 79 | unsigned long vram_size; |
@@ -611,42 +610,6 @@ static void lcdc_dma_handler(u16 status, void *data) | |||
611 | lcdc.dma_callback(lcdc.dma_callback_data); | 610 | lcdc.dma_callback(lcdc.dma_callback_data); |
612 | } | 611 | } |
613 | 612 | ||
614 | static int mmap_kern(void) | ||
615 | { | ||
616 | struct vm_struct *kvma; | ||
617 | struct vm_area_struct vma; | ||
618 | pgprot_t pgprot; | ||
619 | unsigned long vaddr; | ||
620 | |||
621 | kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP); | ||
622 | if (kvma == NULL) { | ||
623 | dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n"); | ||
624 | return -ENOMEM; | ||
625 | } | ||
626 | vma.vm_mm = &init_mm; | ||
627 | |||
628 | vaddr = (unsigned long)kvma->addr; | ||
629 | vma.vm_start = vaddr; | ||
630 | vma.vm_end = vaddr + lcdc.vram_size; | ||
631 | |||
632 | pgprot = pgprot_writecombine(pgprot_kernel); | ||
633 | if (io_remap_pfn_range(&vma, vaddr, | ||
634 | lcdc.vram_phys >> PAGE_SHIFT, | ||
635 | lcdc.vram_size, pgprot) < 0) { | ||
636 | dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n"); | ||
637 | return -EAGAIN; | ||
638 | } | ||
639 | |||
640 | lcdc.vram_virt = (void *)vaddr; | ||
641 | |||
642 | return 0; | ||
643 | } | ||
644 | |||
645 | static void unmap_kern(void) | ||
646 | { | ||
647 | vunmap(lcdc.vram_virt); | ||
648 | } | ||
649 | |||
650 | static int alloc_palette_ram(void) | 613 | static int alloc_palette_ram(void) |
651 | { | 614 | { |
652 | lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev, | 615 | lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev, |
@@ -703,8 +666,6 @@ static void free_fbmem(void) | |||
703 | 666 | ||
704 | static int setup_fbmem(struct omapfb_mem_desc *req_md) | 667 | static int setup_fbmem(struct omapfb_mem_desc *req_md) |
705 | { | 668 | { |
706 | int r; | ||
707 | |||
708 | if (!req_md->region_cnt) { | 669 | if (!req_md->region_cnt) { |
709 | dev_err(lcdc.fbdev->dev, "no memory regions defined\n"); | 670 | dev_err(lcdc.fbdev->dev, "no memory regions defined\n"); |
710 | return -EINVAL; | 671 | return -EINVAL; |
@@ -715,31 +676,7 @@ static int setup_fbmem(struct omapfb_mem_desc *req_md) | |||
715 | req_md->region_cnt = 1; | 676 | req_md->region_cnt = 1; |
716 | } | 677 | } |
717 | 678 | ||
718 | if (req_md->region[0].paddr == 0) { | 679 | return alloc_fbmem(&req_md->region[0]); |
719 | lcdc.fbmem_allocated = 1; | ||
720 | if ((r = alloc_fbmem(&req_md->region[0])) < 0) | ||
721 | return r; | ||
722 | return 0; | ||
723 | } | ||
724 | |||
725 | lcdc.vram_phys = req_md->region[0].paddr; | ||
726 | lcdc.vram_size = req_md->region[0].size; | ||
727 | |||
728 | if ((r = mmap_kern()) < 0) | ||
729 | return r; | ||
730 | |||
731 | dev_dbg(lcdc.fbdev->dev, "vram at %08x size %08lx mapped to 0x%p\n", | ||
732 | lcdc.vram_phys, lcdc.vram_size, lcdc.vram_virt); | ||
733 | |||
734 | return 0; | ||
735 | } | ||
736 | |||
737 | static void cleanup_fbmem(void) | ||
738 | { | ||
739 | if (lcdc.fbmem_allocated) | ||
740 | free_fbmem(); | ||
741 | else | ||
742 | unmap_kern(); | ||
743 | } | 680 | } |
744 | 681 | ||
745 | static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, | 682 | static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, |
@@ -833,7 +770,7 @@ static void omap_lcdc_cleanup(void) | |||
833 | { | 770 | { |
834 | if (!lcdc.ext_mode) | 771 | if (!lcdc.ext_mode) |
835 | free_palette_ram(); | 772 | free_palette_ram(); |
836 | cleanup_fbmem(); | 773 | free_fbmem(); |
837 | omap_free_lcd_dma(); | 774 | omap_free_lcd_dma(); |
838 | free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); | 775 | free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); |
839 | clk_disable(lcdc.lcd_ck); | 776 | clk_disable(lcdc.lcd_ck); |