diff options
Diffstat (limited to 'drivers/video/fbdev/omap')
-rw-r--r-- | drivers/video/fbdev/omap/Kconfig | 9 | ||||
-rw-r--r-- | drivers/video/fbdev/omap/Makefile | 23 | ||||
-rw-r--r-- | drivers/video/fbdev/omap/lcdc.c | 67 | ||||
-rw-r--r-- | drivers/video/fbdev/omap/omapfb_main.c | 1 |
4 files changed, 24 insertions, 76 deletions
diff --git a/drivers/video/fbdev/omap/Kconfig b/drivers/video/fbdev/omap/Kconfig index 0bc3a936ce2b..18c4cb0d5690 100644 --- a/drivers/video/fbdev/omap/Kconfig +++ b/drivers/video/fbdev/omap/Kconfig @@ -39,6 +39,15 @@ config FB_OMAP_LCD_MIPID the Mobile Industry Processor Interface DBI-C/DCS specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) +config FB_OMAP_LCD_H3 + bool "TPS65010 LCD controller on OMAP-H3" + depends on MACH_OMAP_H3 + depends on TPS65010 + default y + help + Say Y here if you want to have support for the LCD on the + H3 board. + config FB_OMAP_DMA_TUNE bool "Set DMA SDRAM access priority high" depends on FB_OMAP diff --git a/drivers/video/fbdev/omap/Makefile b/drivers/video/fbdev/omap/Makefile index 1927faffb5bc..732e0718be53 100644 --- a/drivers/video/fbdev/omap/Makefile +++ b/drivers/video/fbdev/omap/Makefile @@ -10,17 +10,18 @@ objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o -objs-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o -objs-y$(CONFIG_MACH_OMAP_H3) += lcd_h3.o -objs-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o -objs-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o -objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o -objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o -objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o -objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o - -objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o -objs-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o +lcds-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o +lcds-y$(CONFIG_FB_OMAP_LCD_H3) += lcd_h3.o +lcds-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o +lcds-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o +lcds-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o +lcds-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o +lcds-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o +lcds-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o + +lcds-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o +lcds-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o omapfb-objs := $(objs-yy) +obj-$(CONFIG_FB_OMAP) += $(lcds-yy) 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 { void (*dma_callback)(void *data); void *dma_callback_data; - int fbmem_allocated; dma_addr_t vram_phys; void *vram_virt; unsigned long vram_size; @@ -611,42 +610,6 @@ static void lcdc_dma_handler(u16 status, void *data) lcdc.dma_callback(lcdc.dma_callback_data); } -static int mmap_kern(void) -{ - struct vm_struct *kvma; - struct vm_area_struct vma; - pgprot_t pgprot; - unsigned long vaddr; - - kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP); - if (kvma == NULL) { - dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n"); - return -ENOMEM; - } - vma.vm_mm = &init_mm; - - vaddr = (unsigned long)kvma->addr; - vma.vm_start = vaddr; - vma.vm_end = vaddr + lcdc.vram_size; - - pgprot = pgprot_writecombine(pgprot_kernel); - if (io_remap_pfn_range(&vma, vaddr, - lcdc.vram_phys >> PAGE_SHIFT, - lcdc.vram_size, pgprot) < 0) { - dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n"); - return -EAGAIN; - } - - lcdc.vram_virt = (void *)vaddr; - - return 0; -} - -static void unmap_kern(void) -{ - vunmap(lcdc.vram_virt); -} - static int alloc_palette_ram(void) { lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev, @@ -703,8 +666,6 @@ static void free_fbmem(void) static int setup_fbmem(struct omapfb_mem_desc *req_md) { - int r; - if (!req_md->region_cnt) { dev_err(lcdc.fbdev->dev, "no memory regions defined\n"); return -EINVAL; @@ -715,31 +676,7 @@ static int setup_fbmem(struct omapfb_mem_desc *req_md) req_md->region_cnt = 1; } - if (req_md->region[0].paddr == 0) { - lcdc.fbmem_allocated = 1; - if ((r = alloc_fbmem(&req_md->region[0])) < 0) - return r; - return 0; - } - - lcdc.vram_phys = req_md->region[0].paddr; - lcdc.vram_size = req_md->region[0].size; - - if ((r = mmap_kern()) < 0) - return r; - - dev_dbg(lcdc.fbdev->dev, "vram at %08x size %08lx mapped to 0x%p\n", - lcdc.vram_phys, lcdc.vram_size, lcdc.vram_virt); - - return 0; -} - -static void cleanup_fbmem(void) -{ - if (lcdc.fbmem_allocated) - free_fbmem(); - else - unmap_kern(); + return alloc_fbmem(&req_md->region[0]); } static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, @@ -833,7 +770,7 @@ static void omap_lcdc_cleanup(void) { if (!lcdc.ext_mode) free_palette_ram(); - cleanup_fbmem(); + free_fbmem(); omap_free_lcd_dma(); free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); clk_disable(lcdc.lcd_ck); diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index e4fc6d9b5371..d8d028d98711 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1823,6 +1823,7 @@ void omapfb_register_panel(struct lcd_panel *panel) if (fbdev_pdev != NULL) omapfb_do_probe(fbdev_pdev, fbdev_panel); } +EXPORT_SYMBOL_GPL(omapfb_register_panel); /* Called when the device is being detached from the driver */ static int omapfb_remove(struct platform_device *pdev) |