summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/fb.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-20 15:23:13 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-23 09:39:23 +0200
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 @@
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
+static bool omapfb_lcd_configured;
static struct omapfb_platform_data omapfb_config;
static u64 omap_fb_dma_mask = ~(u32)0;
@@ -52,16 +53,21 @@ static struct platform_device omap_fb_device = {
.num_resources = 0,
};
-static int __init omap_init_fb(void)
+void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
{
- const struct omap_lcd_config *conf;
+ omapfb_config.lcd = *config;
+ omapfb_lcd_configured = true;
+}
- conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
- if (conf == NULL)
+static int __init omap_init_fb(void)
+{
+ /*
+ * If the board file has not set the lcd config with
+ * omapfb_set_lcd_config(), don't bother registering the omapfb device
+ */
+ if (!omapfb_lcd_configured)
return 0;
- omapfb_config.lcd = *conf;
-
return platform_device_register(&omap_fb_device);
}
@@ -90,4 +96,8 @@ static int __init omap_init_fb(void)
arch_initcall(omap_init_fb);
+#else
+
+void __init omapfb_set_lcd_config(omap_lcd_config *config) { }
+
#endif