提交 c0b90a31 编写于 作者: S Sascha Hauer

imxfb: add platform specific init/exit functions

Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
上级 879fea1b
...@@ -76,6 +76,9 @@ struct imx_fb_platform_data { ...@@ -76,6 +76,9 @@ struct imx_fb_platform_data {
u_char * fixed_screen_cpu; u_char * fixed_screen_cpu;
dma_addr_t fixed_screen_dma; dma_addr_t fixed_screen_dma;
int (*init)(struct platform_device*);
int (*exit)(struct platform_device*);
void (*lcd_power)(int); void (*lcd_power)(int);
void (*backlight_power)(int); void (*backlight_power)(int);
}; };
......
...@@ -650,6 +650,12 @@ static int __init imxfb_probe(struct platform_device *pdev) ...@@ -650,6 +650,12 @@ static int __init imxfb_probe(struct platform_device *pdev)
info->fix.smem_start = fbi->screen_dma; info->fix.smem_start = fbi->screen_dma;
} }
if (pdata->init) {
ret = pdata->init(fbi->pdev);
if (ret)
goto failed_platform_init;
}
/* /*
* This makes sure that our colour bitfield * This makes sure that our colour bitfield
* descriptors are correctly initialised. * descriptors are correctly initialised.
...@@ -674,6 +680,9 @@ static int __init imxfb_probe(struct platform_device *pdev) ...@@ -674,6 +680,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
failed_register: failed_register:
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
failed_cmap: failed_cmap:
if (pdata->exit)
pdata->exit(fbi->pdev);
failed_platform_init:
if (!pdata->fixed_screen_cpu) if (!pdata->fixed_screen_cpu)
dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
fbi->map_dma); fbi->map_dma);
...@@ -691,6 +700,7 @@ static int __init imxfb_probe(struct platform_device *pdev) ...@@ -691,6 +700,7 @@ static int __init imxfb_probe(struct platform_device *pdev)
static int __devexit imxfb_remove(struct platform_device *pdev) static int __devexit imxfb_remove(struct platform_device *pdev)
{ {
struct imx_fb_platform_data *pdata;
struct fb_info *info = platform_get_drvdata(pdev); struct fb_info *info = platform_get_drvdata(pdev);
struct imxfb_info *fbi = info->par; struct imxfb_info *fbi = info->par;
struct resource *res; struct resource *res;
...@@ -701,6 +711,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev) ...@@ -701,6 +711,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
unregister_framebuffer(info); unregister_framebuffer(info);
pdata = pdev->dev.platform_data;
if (pdata->exit)
pdata->exit(fbi->pdev);
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
kfree(info->pseudo_palette); kfree(info->pseudo_palette);
framebuffer_release(info); framebuffer_release(info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册