summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-01-15 15:37:22 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-03-13 10:34:07 +0100
commitc0b90a31efe30987ab4bb21298b410913779e62f (patch)
treee7af49770ed004899663582ad931aae2d076102f
parent879fea1b486d2b6fa399c40b8aed172b0dfdedb9 (diff)
downloadop-kernel-dev-c0b90a31efe30987ab4bb21298b410913779e62f.zip
op-kernel-dev-c0b90a31efe30987ab4bb21298b410913779e62f.tar.gz
imxfb: add platform specific init/exit functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/plat-mxc/include/mach/imxfb.h3
-rw-r--r--drivers/video/imxfb.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/include/mach/imxfb.h b/arch/arm/plat-mxc/include/mach/imxfb.h
index 870d0d9..762a7b0 100644
--- a/arch/arm/plat-mxc/include/mach/imxfb.h
+++ b/arch/arm/plat-mxc/include/mach/imxfb.h
@@ -76,6 +76,9 @@ struct imx_fb_platform_data {
u_char * fixed_screen_cpu;
dma_addr_t fixed_screen_dma;
+ int (*init)(struct platform_device*);
+ int (*exit)(struct platform_device*);
+
void (*lcd_power)(int);
void (*backlight_power)(int);
};
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index d58c68c..629d66f 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -650,6 +650,12 @@ static int __init imxfb_probe(struct platform_device *pdev)
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
* descriptors are correctly initialised.
@@ -674,6 +680,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
failed_register:
fb_dealloc_cmap(&info->cmap);
failed_cmap:
+ if (pdata->exit)
+ pdata->exit(fbi->pdev);
+failed_platform_init:
if (!pdata->fixed_screen_cpu)
dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
fbi->map_dma);
@@ -691,6 +700,7 @@ failed_init:
static int __devexit imxfb_remove(struct platform_device *pdev)
{
+ struct imx_fb_platform_data *pdata;
struct fb_info *info = platform_get_drvdata(pdev);
struct imxfb_info *fbi = info->par;
struct resource *res;
@@ -701,6 +711,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
unregister_framebuffer(info);
+ pdata = pdev->dev.platform_data;
+ if (pdata->exit)
+ pdata->exit(fbi->pdev);
+
fb_dealloc_cmap(&info->cmap);
kfree(info->pseudo_palette);
framebuffer_release(info);
OpenPOWER on IntegriCloud