Skip to content

Commit

Permalink
video: mxsfb: remove fb_phys/fb_size from platform_data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn Guo committed Apr 4, 2013
1 parent 9e54857 commit 4aa02c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 41 deletions.
39 changes: 7 additions & 32 deletions drivers/video/mxsfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ struct mxsfb_info {
unsigned ld_intf_width;
unsigned dotclk_delay;
const struct mxsfb_devdata *devdata;
int mapped;
u32 sync;
};

Expand Down Expand Up @@ -686,7 +685,7 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host)
struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data;
dma_addr_t fb_phys;
void *fb_virt;
unsigned fb_size = pdata->fb_size;
unsigned fb_size;

fb_info->fbops = &mxsfb_ops;
fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST;
Expand All @@ -706,30 +705,12 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host)
host->ld_intf_width = pdata->ld_intf_width;

/* Memory allocation for framebuffer */
if (pdata->fb_phys) {
if (!fb_size)
return -EINVAL;

fb_phys = pdata->fb_phys;
fb_size = SZ_2M;
fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
if (!fb_virt)
return -ENOMEM;

if (!request_mem_region(fb_phys, fb_size, host->pdev->name))
return -ENOMEM;

fb_virt = ioremap(fb_phys, fb_size);
if (!fb_virt) {
release_mem_region(fb_phys, fb_size);
return -ENOMEM;
}
host->mapped = 1;
} else {
if (!fb_size)
fb_size = SZ_2M; /* default */
fb_virt = alloc_pages_exact(fb_size, GFP_DMA);
if (!fb_virt)
return -ENOMEM;

fb_phys = virt_to_phys(fb_virt);
}
fb_phys = virt_to_phys(fb_virt);

fb_info->fix.smem_start = fb_phys;
fb_info->screen_base = fb_virt;
Expand All @@ -745,13 +726,7 @@ static void mxsfb_free_videomem(struct mxsfb_info *host)
{
struct fb_info *fb_info = &host->fb_info;

if (host->mapped) {
iounmap(fb_info->screen_base);
release_mem_region(fb_info->fix.smem_start,
fb_info->screen_size);
} else {
free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
}
free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len);
}

static struct platform_device_id mxsfb_devtype[] = {
Expand Down
9 changes: 0 additions & 9 deletions include/linux/mxsfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ struct mxsfb_platform_data {

unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
unsigned ld_intf_width; /* refer STMLCDIF_* macros */

unsigned fb_size; /* Size of the video memory. If zero a
* default will be used
*/
unsigned long fb_phys; /* physical address for the video memory. If
* zero the framebuffer memory will be dynamically
* allocated. If specified,fb_size must also be specified.
* fb_phys must be unused by Linux.
*/
u32 sync; /* sync mask, contains MXSFB specifics not
* carried in fb_info->var.sync
*/
Expand Down

0 comments on commit 4aa02c7

Please sign in to comment.