|
@@ -209,11 +209,61 @@ static int __init omapdss_init_fbdev(void)
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
-#else
|
|
|
-static inline int omapdss_init_fbdev(void)
|
|
|
+
|
|
|
+static const char * const omapdss_compat_names[] __initconst = {
|
|
|
+ "ti,omap2-dss",
|
|
|
+ "ti,omap3-dss",
|
|
|
+ "ti,omap4-dss",
|
|
|
+ "ti,omap5-dss",
|
|
|
+ "ti,dra7-dss",
|
|
|
+};
|
|
|
+
|
|
|
+static struct device_node * __init omapdss_find_dss_of_node(void)
|
|
|
{
|
|
|
- return 0;
|
|
|
+ struct device_node *node;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
|
|
|
+ node = of_find_compatible_node(NULL, NULL,
|
|
|
+ omapdss_compat_names[i]);
|
|
|
+ if (node)
|
|
|
+ return node;
|
|
|
+ }
|
|
|
+
|
|
|
+ return NULL;
|
|
|
}
|
|
|
+
|
|
|
+static int __init omapdss_init_of(void)
|
|
|
+{
|
|
|
+ int r;
|
|
|
+ struct device_node *node;
|
|
|
+ struct platform_device *pdev;
|
|
|
+
|
|
|
+ /* only create dss helper devices if dss is enabled in the .dts */
|
|
|
+
|
|
|
+ node = omapdss_find_dss_of_node();
|
|
|
+ if (!node)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ if (!of_device_is_available(node))
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ pdev = of_find_device_by_node(node);
|
|
|
+
|
|
|
+ if (!pdev) {
|
|
|
+ pr_err("Unable to find DSS platform device\n");
|
|
|
+ return -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
+ r = of_platform_populate(node, NULL, NULL, &pdev->dev);
|
|
|
+ if (r) {
|
|
|
+ pr_err("Unable to populate DSS submodule devices\n");
|
|
|
+ return r;
|
|
|
+ }
|
|
|
+
|
|
|
+ return omapdss_init_fbdev();
|
|
|
+}
|
|
|
+omap_device_initcall(omapdss_init_of);
|
|
|
#endif /* CONFIG_FB_OMAP2 */
|
|
|
|
|
|
static void dispc_disable_outputs(void)
|
|
@@ -361,58 +411,3 @@ int omap_dss_reset(struct omap_hwmod *oh)
|
|
|
|
|
|
return r;
|
|
|
}
|
|
|
-
|
|
|
-static const char * const omapdss_compat_names[] __initconst = {
|
|
|
- "ti,omap2-dss",
|
|
|
- "ti,omap3-dss",
|
|
|
- "ti,omap4-dss",
|
|
|
- "ti,omap5-dss",
|
|
|
- "ti,dra7-dss",
|
|
|
-};
|
|
|
-
|
|
|
-static struct device_node * __init omapdss_find_dss_of_node(void)
|
|
|
-{
|
|
|
- struct device_node *node;
|
|
|
- int i;
|
|
|
-
|
|
|
- for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
|
|
|
- node = of_find_compatible_node(NULL, NULL,
|
|
|
- omapdss_compat_names[i]);
|
|
|
- if (node)
|
|
|
- return node;
|
|
|
- }
|
|
|
-
|
|
|
- return NULL;
|
|
|
-}
|
|
|
-
|
|
|
-static int __init omapdss_init_of(void)
|
|
|
-{
|
|
|
- int r;
|
|
|
- struct device_node *node;
|
|
|
- struct platform_device *pdev;
|
|
|
-
|
|
|
- /* only create dss helper devices if dss is enabled in the .dts */
|
|
|
-
|
|
|
- node = omapdss_find_dss_of_node();
|
|
|
- if (!node)
|
|
|
- return 0;
|
|
|
-
|
|
|
- if (!of_device_is_available(node))
|
|
|
- return 0;
|
|
|
-
|
|
|
- pdev = of_find_device_by_node(node);
|
|
|
-
|
|
|
- if (!pdev) {
|
|
|
- pr_err("Unable to find DSS platform device\n");
|
|
|
- return -ENODEV;
|
|
|
- }
|
|
|
-
|
|
|
- r = of_platform_populate(node, NULL, NULL, &pdev->dev);
|
|
|
- if (r) {
|
|
|
- pr_err("Unable to populate DSS submodule devices\n");
|
|
|
- return r;
|
|
|
- }
|
|
|
-
|
|
|
- return omapdss_init_fbdev();
|
|
|
-}
|
|
|
-omap_device_initcall(omapdss_init_of);
|