Commit 5ce78302 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

ARM: OMAP2+: Don't register omapdss device for omapdrm

The omapdrm driver doesn't need the omapdss device anymore. Although it
can't be removed completely as the fbdev driver still requires it, we
can condition its registration to the usage of the omapfb driver.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent d86bd82c
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
*/ */
#define FRAMEDONE_IRQ_TIMEOUT 100 #define FRAMEDONE_IRQ_TIMEOUT 100
#if defined(CONFIG_FB_OMAP2)
static struct platform_device omap_display_device = { static struct platform_device omap_display_device = {
.name = "omapdss", .name = "omapdss",
.id = -1, .id = -1,
...@@ -163,6 +164,64 @@ static enum omapdss_version __init omap_display_get_version(void) ...@@ -163,6 +164,64 @@ static enum omapdss_version __init omap_display_get_version(void)
return OMAPDSS_VER_UNKNOWN; return OMAPDSS_VER_UNKNOWN;
} }
static int __init omapdss_init_fbdev(void)
{
static struct omap_dss_board_info board_data = {
.dsi_enable_pads = omap_dsi_enable_pads,
.dsi_disable_pads = omap_dsi_disable_pads,
.set_min_bus_tput = omap_dss_set_min_bus_tput,
};
struct device_node *node;
board_data.version = omap_display_get_version();
if (board_data.version == OMAPDSS_VER_UNKNOWN) {
pr_err("DSS not supported on this SoC\n");
return -ENODEV;
}
omap_display_device.dev.platform_data = &board_data;
r = platform_device_register(&omap_display_device);
if (r < 0) {
pr_err("Unable to register omapdss device\n");
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;
}
/* create V4L2 display device */
r = omap_init_vout();
if (r < 0) {
pr_err("Unable to register omap_vout device\n");
return r;
}
/* add DSI info for omap4 */
node = of_find_node_by_name(NULL, "omap4_padconf_global");
if (node)
omap4_dsi_mux_syscon = syscon_node_to_regmap(node);
return 0;
}
#else
static inline int omapdss_init_fbdev(void)
{
return 0;
}
#endif /* CONFIG_FB_OMAP2 */
static void dispc_disable_outputs(void) static void dispc_disable_outputs(void)
{ {
u32 v, irq_mask = 0; u32 v, irq_mask = 0;
...@@ -335,16 +394,9 @@ static struct device_node * __init omapdss_find_dss_of_node(void) ...@@ -335,16 +394,9 @@ static struct device_node * __init omapdss_find_dss_of_node(void)
int __init omapdss_init_of(void) int __init omapdss_init_of(void)
{ {
int r; int r;
enum omapdss_version ver;
struct device_node *node; struct device_node *node;
struct platform_device *pdev; struct platform_device *pdev;
static struct omap_dss_board_info board_data = {
.dsi_enable_pads = omap_dsi_enable_pads,
.dsi_disable_pads = omap_dsi_disable_pads,
.set_min_bus_tput = omap_dss_set_min_bus_tput,
};
/* only create dss helper devices if dss is enabled in the .dts */ /* only create dss helper devices if dss is enabled in the .dts */
node = omapdss_find_dss_of_node(); node = omapdss_find_dss_of_node();
...@@ -354,13 +406,6 @@ int __init omapdss_init_of(void) ...@@ -354,13 +406,6 @@ int __init omapdss_init_of(void)
if (!of_device_is_available(node)) if (!of_device_is_available(node))
return 0; return 0;
ver = omap_display_get_version();
if (ver == OMAPDSS_VER_UNKNOWN) {
pr_err("DSS not supported on this SoC\n");
return -ENODEV;
}
pdev = of_find_device_by_node(node); pdev = of_find_device_by_node(node);
if (!pdev) { if (!pdev) {
...@@ -374,41 +419,5 @@ int __init omapdss_init_of(void) ...@@ -374,41 +419,5 @@ int __init omapdss_init_of(void)
return r; return r;
} }
board_data.version = ver; return omapdss_init_fbdev();
omap_display_device.dev.platform_data = &board_data;
r = platform_device_register(&omap_display_device);
if (r < 0) {
pr_err("Unable to register omapdss device\n");
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;
}
/* create V4L2 display device */
r = omap_init_vout();
if (r < 0) {
pr_err("Unable to register omap_vout device\n");
return r;
}
/* add DSI info for omap4 */
node = of_find_node_by_name(NULL, "omap4_padconf_global");
if (node)
omap4_dsi_mux_syscon = syscon_node_to_regmap(node);
return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment