diff options
-rw-r--r-- | arch/arm/mach-omap2/board-generic.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/display.c | 62 |
3 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index fcb7f5c271c9..0db371a88e5e 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -35,6 +35,8 @@ static struct of_device_id omap_dt_match_table[] __initdata = { | |||
35 | 35 | ||
36 | static void __init omap_generic_init(void) | 36 | static void __init omap_generic_init(void) |
37 | { | 37 | { |
38 | omapdss_early_init_of(); | ||
39 | |||
38 | pdata_quirks_init(omap_dt_match_table); | 40 | pdata_quirks_init(omap_dt_match_table); |
39 | 41 | ||
40 | omapdss_init_of(); | 42 | omapdss_init_of(); |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 1864282dbddf..d88aff7baff8 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -316,6 +316,7 @@ extern int omap_dss_reset(struct omap_hwmod *); | |||
316 | int omap_clk_init(void); | 316 | int omap_clk_init(void); |
317 | 317 | ||
318 | int __init omapdss_init_of(void); | 318 | int __init omapdss_init_of(void); |
319 | void __init omapdss_early_init_of(void); | ||
319 | 320 | ||
320 | #endif /* __ASSEMBLER__ */ | 321 | #endif /* __ASSEMBLER__ */ |
321 | #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ | 322 | #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ |
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index a83ada38cae2..cf0cb35fa972 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/of.h> | 26 | #include <linux/of.h> |
27 | #include <linux/of_platform.h> | 27 | #include <linux/of_platform.h> |
28 | #include <linux/slab.h> | ||
28 | 29 | ||
29 | #include <video/omapdss.h> | 30 | #include <video/omapdss.h> |
30 | #include "omap_hwmod.h" | 31 | #include "omap_hwmod.h" |
@@ -555,6 +556,67 @@ int omap_dss_reset(struct omap_hwmod *oh) | |||
555 | return r; | 556 | return r; |
556 | } | 557 | } |
557 | 558 | ||
559 | /* list of 'compatible' nodes to convert to omapdss specific */ | ||
560 | static const char * const dss_compat_conv_list[] __initconst = { | ||
561 | "composite-connector", | ||
562 | "dvi-connector", | ||
563 | "hdmi-connector", | ||
564 | "panel-dpi", | ||
565 | "panel-dsi-cm", | ||
566 | "sony,acx565akm", | ||
567 | "svideo-connector", | ||
568 | "ti,tfp410", | ||
569 | "ti,tpd12s015", | ||
570 | }; | ||
571 | |||
572 | /* prepend compatible string with "omapdss," */ | ||
573 | static __init void omapdss_omapify_node(struct device_node *node, | ||
574 | const char *compat) | ||
575 | { | ||
576 | char *new_compat; | ||
577 | struct property *prop; | ||
578 | |||
579 | new_compat = kasprintf(GFP_KERNEL, "omapdss,%s", compat); | ||
580 | |||
581 | prop = kzalloc(sizeof(*prop), GFP_KERNEL); | ||
582 | |||
583 | if (!prop) { | ||
584 | pr_err("omapdss_omapify_node: kzalloc failed\n"); | ||
585 | return; | ||
586 | } | ||
587 | |||
588 | prop->name = "compatible"; | ||
589 | prop->value = new_compat; | ||
590 | prop->length = strlen(new_compat) + 1; | ||
591 | |||
592 | of_update_property(node, prop); | ||
593 | } | ||
594 | |||
595 | /* | ||
596 | * As omapdss panel drivers are omapdss specific, but we want to define the | ||
597 | * DT-data in generic manner, we convert the compatible strings of the panel | ||
598 | * nodes from "panel-foo" to "omapdss,panel-foo". This way we can have both | ||
599 | * correct DT data and omapdss specific drivers. | ||
600 | * | ||
601 | * When we get generic panel drivers to the kernel, this will be removed. | ||
602 | */ | ||
603 | void __init omapdss_early_init_of(void) | ||
604 | { | ||
605 | int i; | ||
606 | |||
607 | for (i = 0; i < ARRAY_SIZE(dss_compat_conv_list); ++i) { | ||
608 | const char *compat = dss_compat_conv_list[i]; | ||
609 | struct device_node *node = NULL; | ||
610 | |||
611 | while ((node = of_find_compatible_node(node, NULL, compat))) { | ||
612 | if (!of_device_is_available(node)) | ||
613 | continue; | ||
614 | |||
615 | omapdss_omapify_node(node, compat); | ||
616 | } | ||
617 | } | ||
618 | } | ||
619 | |||
558 | struct device_node * __init omapdss_find_dss_of_node(void) | 620 | struct device_node * __init omapdss_find_dss_of_node(void) |
559 | { | 621 | { |
560 | struct device_node *node; | 622 | struct device_node *node; |