diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-03-13 02:03:12 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2013-04-04 09:22:41 -0400 |
commit | 4aa02c7cbb6816913554dc18ff750a70a4ace796 (patch) | |
tree | eb27f8b4e307ac1d4f185b2797f9ec5f0382e520 /drivers/video | |
parent | 9e5485791b805e3235ba5fb53d140881dbbe79be (diff) |
video: mxsfb: remove fb_phys/fb_size from platform_data
There is no in-tree users of mxsfb_platform_data fb_phys/fb_size.
With CMA support in the kernel, there is no real need for platform to
reserve memory and pass address and size into driver via platform_data.
So let's remove fb_phys/fb_size from mxsfb_platform_data to ease full
device tree adoption.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/mxsfb.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 69fb3f1d1e12..9e8740bade32 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c | |||
@@ -168,7 +168,6 @@ struct mxsfb_info { | |||
168 | unsigned ld_intf_width; | 168 | unsigned ld_intf_width; |
169 | unsigned dotclk_delay; | 169 | unsigned dotclk_delay; |
170 | const struct mxsfb_devdata *devdata; | 170 | const struct mxsfb_devdata *devdata; |
171 | int mapped; | ||
172 | u32 sync; | 171 | u32 sync; |
173 | }; | 172 | }; |
174 | 173 | ||
@@ -686,7 +685,7 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host) | |||
686 | struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data; | 685 | struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data; |
687 | dma_addr_t fb_phys; | 686 | dma_addr_t fb_phys; |
688 | void *fb_virt; | 687 | void *fb_virt; |
689 | unsigned fb_size = pdata->fb_size; | 688 | unsigned fb_size; |
690 | 689 | ||
691 | fb_info->fbops = &mxsfb_ops; | 690 | fb_info->fbops = &mxsfb_ops; |
692 | fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; | 691 | fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; |
@@ -706,30 +705,12 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host) | |||
706 | host->ld_intf_width = pdata->ld_intf_width; | 705 | host->ld_intf_width = pdata->ld_intf_width; |
707 | 706 | ||
708 | /* Memory allocation for framebuffer */ | 707 | /* Memory allocation for framebuffer */ |
709 | if (pdata->fb_phys) { | 708 | fb_size = SZ_2M; |
710 | if (!fb_size) | 709 | fb_virt = alloc_pages_exact(fb_size, GFP_DMA); |
711 | return -EINVAL; | 710 | if (!fb_virt) |
712 | 711 | return -ENOMEM; | |
713 | fb_phys = pdata->fb_phys; | ||
714 | 712 | ||
715 | if (!request_mem_region(fb_phys, fb_size, host->pdev->name)) | 713 | fb_phys = virt_to_phys(fb_virt); |
716 | return -ENOMEM; | ||
717 | |||
718 | fb_virt = ioremap(fb_phys, fb_size); | ||
719 | if (!fb_virt) { | ||
720 | release_mem_region(fb_phys, fb_size); | ||
721 | return -ENOMEM; | ||
722 | } | ||
723 | host->mapped = 1; | ||
724 | } else { | ||
725 | if (!fb_size) | ||
726 | fb_size = SZ_2M; /* default */ | ||
727 | fb_virt = alloc_pages_exact(fb_size, GFP_DMA); | ||
728 | if (!fb_virt) | ||
729 | return -ENOMEM; | ||
730 | |||
731 | fb_phys = virt_to_phys(fb_virt); | ||
732 | } | ||
733 | 714 | ||
734 | fb_info->fix.smem_start = fb_phys; | 715 | fb_info->fix.smem_start = fb_phys; |
735 | fb_info->screen_base = fb_virt; | 716 | fb_info->screen_base = fb_virt; |
@@ -745,13 +726,7 @@ static void mxsfb_free_videomem(struct mxsfb_info *host) | |||
745 | { | 726 | { |
746 | struct fb_info *fb_info = &host->fb_info; | 727 | struct fb_info *fb_info = &host->fb_info; |
747 | 728 | ||
748 | if (host->mapped) { | 729 | free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len); |
749 | iounmap(fb_info->screen_base); | ||
750 | release_mem_region(fb_info->fix.smem_start, | ||
751 | fb_info->screen_size); | ||
752 | } else { | ||
753 | free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len); | ||
754 | } | ||
755 | } | 730 | } |
756 | 731 | ||
757 | static struct platform_device_id mxsfb_devtype[] = { | 732 | static struct platform_device_id mxsfb_devtype[] = { |