aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/fb.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-20 08:23:13 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-23 02:39:23 -0500
commitddba6c7f7ec6a82ccbce4126d615e73e00b4be12 (patch)
tree6dfd41afcce098982958c2cd137f57a85fc25462 /arch/arm/plat-omap/fb.c
parentf060f95365ce71acbf29ef5dac580ab067600f4c (diff)
OMAP1: pass LCD config with omapfb_set_lcd_config()
LCD config for old omapfb driver is passed with OMAP_TAG_LCD from board files or from the bootloader. In an effort to remove OMAP_TAG_LCD, this patch adds omapfb_set_lcd_config() function that the board files can call to set the LCD config. This has the drawback that configuration can no longer come from the bootloader. Of the boards supported by the kernel, this should only affect N770 which depends on the data from the bootloader. This patch adds an LCD config for N770 to its board files, but that is most probably broken. Fixing this would need information about the HW setup in N770 boards. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Tony Lindgren <tony@atomide.com>
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