aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-omap/fb.c')
-rw-r--r--arch/arm/plat-omap/fb.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c
index 45f35c983f44..24e62693b809 100644
--- a/arch/arm/plat-omap/fb.c
+++ b/arch/arm/plat-omap/fb.c
@@ -37,6 +37,7 @@
37 37
38#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) 38#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
39 39
40static bool omapfb_lcd_configured;
40static struct omapfb_platform_data omapfb_config; 41static struct omapfb_platform_data omapfb_config;
41 42
42static u64 omap_fb_dma_mask = ~(u32)0; 43static u64 omap_fb_dma_mask = ~(u32)0;
@@ -52,16 +53,21 @@ static struct platform_device omap_fb_device = {
52 .num_resources = 0, 53 .num_resources = 0,
53}; 54};
54 55
55static int __init omap_init_fb(void) 56void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
56{ 57{
57 const struct omap_lcd_config *conf; 58 omapfb_config.lcd = *config;
59 omapfb_lcd_configured = true;
60}
58 61
59 conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config); 62static int __init omap_init_fb(void)
60 if (conf == NULL) 63{
64 /*
65 * If the board file has not set the lcd config with
66 * omapfb_set_lcd_config(), don't bother registering the omapfb device
67 */
68 if (!omapfb_lcd_configured)
61 return 0; 69 return 0;
62 70
63 omapfb_config.lcd = *conf;
64
65 return platform_device_register(&omap_fb_device); 71 return platform_device_register(&omap_fb_device);
66} 72}
67 73
@@ -90,4 +96,8 @@ static int __init omap_init_fb(void)
90 96
91arch_initcall(omap_init_fb); 97arch_initcall(omap_init_fb);
92 98
99#else
100
101void __init omapfb_set_lcd_config(omap_lcd_config *config) { }
102
93#endif 103#endif