OMAPDSS: Add methods for skipping display initialization
[android-sdk/kernel-video.git] / drivers / video / fbdev / omap2 / dss / core.c
index 6b74f73fb5245bef81031ae40d810bd2a6fa8d2d..9fd540257cad093b7a5fb9992ec5c781fbf7a148 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/suspend.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <video/omapdss.h>
 
@@ -46,6 +47,9 @@ static struct {
        const char *default_display_name;
 } core;
 
+static uint g_display_skip_init;
+static uint g_display_share;
+
 static char *def_disp_name;
 module_param_named(def_disp, def_disp_name, charp, 0);
 MODULE_PARM_DESC(def_disp, "default display name");
@@ -65,6 +69,18 @@ enum omapdss_version omapdss_get_version(void)
 }
 EXPORT_SYMBOL(omapdss_get_version);
 
+int omapdss_skipinit(void)
+{
+       return g_display_skip_init;
+}
+EXPORT_SYMBOL(omapdss_skipinit);
+
+int omapdss_display_share(void)
+{
+       return g_display_share;
+}
+EXPORT_SYMBOL(omapdss_display_share);
+
 bool omapdss_is_initialized(void)
 {
        return dss_initialized;
@@ -198,10 +214,16 @@ static struct notifier_block omap_dss_pm_notif_block = {
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
        struct omap_dss_board_info *pdata = pdev->dev.platform_data;
+       struct device_node *node = pdev->dev.of_node;
        int r;
 
        core.pdev = pdev;
 
+       of_property_read_u32(node, "skip_init",
+                                        &g_display_skip_init);
+       if (g_display_skip_init)
+               g_display_share = 1;
+
        dss_features_init(omapdss_get_version());
 
        r = dss_initialize_debugfs();