aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/display.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
-rw-r--r--arch/arm/mach-omap2/display.c62
1 files changed, 6 insertions, 56 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 16d33d831287..bf852d7ae951 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -279,6 +279,8 @@ static enum omapdss_version __init omap_display_get_version(void)
279 return OMAPDSS_VER_OMAP4; 279 return OMAPDSS_VER_OMAP4;
280 else if (soc_is_omap54xx()) 280 else if (soc_is_omap54xx())
281 return OMAPDSS_VER_OMAP5; 281 return OMAPDSS_VER_OMAP5;
282 else if (soc_is_am43xx())
283 return OMAPDSS_VER_AM43xx;
282 else 284 else
283 return OMAPDSS_VER_UNKNOWN; 285 return OMAPDSS_VER_UNKNOWN;
284} 286}
@@ -555,65 +557,9 @@ int omap_dss_reset(struct omap_hwmod *oh)
555 return r; 557 return r;
556} 558}
557 559
558/* list of 'compatible' nodes to convert to omapdss specific */
559static const char * const dss_compat_conv_list[] __initconst = {
560 "composite-connector",
561 "dvi-connector",
562 "hdmi-connector",
563 "panel-dpi",
564 "panel-dsi-cm",
565 "sony,acx565akm",
566 "svideo-connector",
567 "ti,tfp410",
568 "ti,tpd12s015",
569};
570
571/* prepend compatible string with "omapdss," */
572static __init void omapdss_omapify_node(struct device_node *node,
573 const char *compat)
574{
575 char *new_compat;
576 struct property *prop;
577
578 new_compat = kasprintf(GFP_KERNEL, "omapdss,%s", compat);
579
580 prop = kzalloc(sizeof(*prop), GFP_KERNEL);
581
582 if (!prop) {
583 pr_err("omapdss_omapify_node: kzalloc failed\n");
584 return;
585 }
586
587 prop->name = "compatible";
588 prop->value = new_compat;
589 prop->length = strlen(new_compat) + 1;
590
591 of_update_property(node, prop);
592}
593
594/*
595 * As omapdss panel drivers are omapdss specific, but we want to define the
596 * DT-data in generic manner, we convert the compatible strings of the panel
597 * nodes from "panel-foo" to "omapdss,panel-foo". This way we can have both
598 * correct DT data and omapdss specific drivers.
599 *
600 * When we get generic panel drivers to the kernel, this will be removed.
601 */
602void __init omapdss_early_init_of(void) 560void __init omapdss_early_init_of(void)
603{ 561{
604 int i;
605
606 for (i = 0; i < ARRAY_SIZE(dss_compat_conv_list); ++i) {
607 const char *compat = dss_compat_conv_list[i];
608 struct device_node *node = NULL;
609
610 while ((node = of_find_compatible_node(node, NULL, compat))) {
611 if (!of_device_is_available(node))
612 continue;
613 562
614 omapdss_omapify_node(node, compat);
615 }
616 }
617} 563}
618 564
619struct device_node * __init omapdss_find_dss_of_node(void) 565struct device_node * __init omapdss_find_dss_of_node(void)
@@ -632,6 +578,10 @@ struct device_node * __init omapdss_find_dss_of_node(void)
632 if (node) 578 if (node)
633 return node; 579 return node;
634 580
581 node = of_find_compatible_node(NULL, NULL, "ti,omap5-dss");
582 if (node)
583 return node;
584
635 return NULL; 585 return NULL;
636} 586}
637 587