diff options
-rw-r--r-- | arch/arm/plat-mxc/include/mach/imxfb.h | 3 | ||||
-rw-r--r-- | drivers/video/imxfb.c | 14 |
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 870d0d939616..762a7b0430e2 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 { | |||
76 | u_char * fixed_screen_cpu; | 76 | u_char * fixed_screen_cpu; |
77 | dma_addr_t fixed_screen_dma; | 77 | dma_addr_t fixed_screen_dma; |
78 | 78 | ||
79 | int (*init)(struct platform_device*); | ||
80 | int (*exit)(struct platform_device*); | ||
81 | |||
79 | void (*lcd_power)(int); | 82 | void (*lcd_power)(int); |
80 | void (*backlight_power)(int); | 83 | void (*backlight_power)(int); |
81 | }; | 84 | }; |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index d58c68cd456e..629d66f32300 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -650,6 +650,12 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
650 | info->fix.smem_start = fbi->screen_dma; | 650 | info->fix.smem_start = fbi->screen_dma; |
651 | } | 651 | } |
652 | 652 | ||
653 | if (pdata->init) { | ||
654 | ret = pdata->init(fbi->pdev); | ||
655 | if (ret) | ||
656 | goto failed_platform_init; | ||
657 | } | ||
658 | |||
653 | /* | 659 | /* |
654 | * This makes sure that our colour bitfield | 660 | * This makes sure that our colour bitfield |
655 | * descriptors are correctly initialised. | 661 | * descriptors are correctly initialised. |
@@ -674,6 +680,9 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
674 | failed_register: | 680 | failed_register: |
675 | fb_dealloc_cmap(&info->cmap); | 681 | fb_dealloc_cmap(&info->cmap); |
676 | failed_cmap: | 682 | failed_cmap: |
683 | if (pdata->exit) | ||
684 | pdata->exit(fbi->pdev); | ||
685 | failed_platform_init: | ||
677 | if (!pdata->fixed_screen_cpu) | 686 | if (!pdata->fixed_screen_cpu) |
678 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, | 687 | dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, |
679 | fbi->map_dma); | 688 | fbi->map_dma); |
@@ -691,6 +700,7 @@ failed_init: | |||
691 | 700 | ||
692 | static int __devexit imxfb_remove(struct platform_device *pdev) | 701 | static int __devexit imxfb_remove(struct platform_device *pdev) |
693 | { | 702 | { |
703 | struct imx_fb_platform_data *pdata; | ||
694 | struct fb_info *info = platform_get_drvdata(pdev); | 704 | struct fb_info *info = platform_get_drvdata(pdev); |
695 | struct imxfb_info *fbi = info->par; | 705 | struct imxfb_info *fbi = info->par; |
696 | struct resource *res; | 706 | struct resource *res; |
@@ -701,6 +711,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev) | |||
701 | 711 | ||
702 | unregister_framebuffer(info); | 712 | unregister_framebuffer(info); |
703 | 713 | ||
714 | pdata = pdev->dev.platform_data; | ||
715 | if (pdata->exit) | ||
716 | pdata->exit(fbi->pdev); | ||
717 | |||
704 | fb_dealloc_cmap(&info->cmap); | 718 | fb_dealloc_cmap(&info->cmap); |
705 | kfree(info->pseudo_palette); | 719 | kfree(info->pseudo_palette); |
706 | framebuffer_release(info); | 720 | framebuffer_release(info); |