提交 fc8df752 编写于 作者: A Archit Taneja 提交者: Tony Lindgren

ARM: OMAP2+: display: Create omapvrfb and omapfb devices inside omap_display_init

Move omapfb and omapvrfb device creation inside the omap_display_init so that
we can correctly create the device based on the presence of omapdss within the
platform.

For example, on a kernel image supporting multiple platforms, omap_init_vrfb and
omap_init_fb will create omapvrfb and omapfb platform devices respectively on a
AM33xx platform even though it doesn't have a VRFB or DSS block.
Signed-off-by: NArchit Taneja <archit@ti.com>
Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: NTony Lindgren <tony@atomide.com>
上级 7a59743d
...@@ -423,6 +423,20 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) ...@@ -423,6 +423,20 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
return r; return r;
} }
/* create vrfb device */
r = omap_init_vrfb();
if (r < 0) {
pr_err("Unable to register omapvrfb device\n");
return r;
}
/* create FB device */
r = omap_init_fb();
if (r < 0) {
pr_err("Unable to register omapfb device\n");
return r;
}
return 0; return 0;
} }
......
...@@ -27,4 +27,6 @@ struct omap_dss_dispc_dev_attr { ...@@ -27,4 +27,6 @@ struct omap_dss_dispc_dev_attr {
}; };
int omap_init_drm(void); int omap_init_drm(void);
int omap_init_vrfb(void);
int omap_init_fb(void);
#endif #endif
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "soc.h" #include "soc.h"
#include "display.h"
#ifdef CONFIG_OMAP2_VRFB #ifdef CONFIG_OMAP2_VRFB
...@@ -64,7 +65,7 @@ static const struct resource omap3_vrfb_resources[] = { ...@@ -64,7 +65,7 @@ static const struct resource omap3_vrfb_resources[] = {
DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"), DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
}; };
static int __init omap_init_vrfb(void) int __init omap_init_vrfb(void)
{ {
struct platform_device *pdev; struct platform_device *pdev;
const struct resource *res; const struct resource *res;
...@@ -85,8 +86,8 @@ static int __init omap_init_vrfb(void) ...@@ -85,8 +86,8 @@ static int __init omap_init_vrfb(void)
return PTR_RET(pdev); return PTR_RET(pdev);
} }
#else
omap_arch_initcall(omap_init_vrfb); int __init omap_init_vrfb(void) { return 0; }
#endif #endif
#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
...@@ -105,11 +106,10 @@ static struct platform_device omap_fb_device = { ...@@ -105,11 +106,10 @@ static struct platform_device omap_fb_device = {
.num_resources = 0, .num_resources = 0,
}; };
static int __init omap_init_fb(void) int __init omap_init_fb(void)
{ {
return platform_device_register(&omap_fb_device); return platform_device_register(&omap_fb_device);
} }
#else
omap_arch_initcall(omap_init_fb); int __init omap_init_fb(void) { return 0; }
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册