diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-02-16 16:31:59 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-02-16 22:09:10 -0500 |
commit | 433aa851d4b32dc3b3de1e84dc20b57e157b25b9 (patch) | |
tree | c2d584cb64ce201c7c60a90f6f43ede6cf4f99e7 | |
parent | 9a8c3ab9c0286a6c81012eaf9e95ec2d3e58d21f (diff) |
ARM: shmobile: lager-reference: Add DU device
The DU device has no DT bindings yet, instantiate it as a platform
device for now.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
[horms+renesas@verge.net.au: omitted DTS portion]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/board-lager-reference.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 634ef15e73e3..6ba8b3b41609 100644 --- a/arch/arm/mach-shmobile/board-lager-reference.c +++ b/arch/arm/mach-shmobile/board-lager-reference.c | |||
@@ -20,13 +20,72 @@ | |||
20 | 20 | ||
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/clkdev.h> | 22 | #include <linux/clkdev.h> |
23 | #include <linux/dma-mapping.h> | ||
23 | #include <linux/init.h> | 24 | #include <linux/init.h> |
24 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
26 | #include <linux/platform_data/rcar-du.h> | ||
25 | #include <mach/common.h> | 27 | #include <mach/common.h> |
28 | #include <mach/irqs.h> | ||
26 | #include <mach/rcar-gen2.h> | 29 | #include <mach/rcar-gen2.h> |
27 | #include <mach/r8a7790.h> | 30 | #include <mach/r8a7790.h> |
28 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
29 | 32 | ||
33 | /* DU */ | ||
34 | static struct rcar_du_encoder_data lager_du_encoders[] = { | ||
35 | { | ||
36 | .type = RCAR_DU_ENCODER_VGA, | ||
37 | .output = RCAR_DU_OUTPUT_DPAD0, | ||
38 | }, { | ||
39 | .type = RCAR_DU_ENCODER_NONE, | ||
40 | .output = RCAR_DU_OUTPUT_LVDS1, | ||
41 | .connector.lvds.panel = { | ||
42 | .width_mm = 210, | ||
43 | .height_mm = 158, | ||
44 | .mode = { | ||
45 | .clock = 65000, | ||
46 | .hdisplay = 1024, | ||
47 | .hsync_start = 1048, | ||
48 | .hsync_end = 1184, | ||
49 | .htotal = 1344, | ||
50 | .vdisplay = 768, | ||
51 | .vsync_start = 771, | ||
52 | .vsync_end = 777, | ||
53 | .vtotal = 806, | ||
54 | .flags = 0, | ||
55 | }, | ||
56 | }, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static struct rcar_du_platform_data lager_du_pdata = { | ||
61 | .encoders = lager_du_encoders, | ||
62 | .num_encoders = ARRAY_SIZE(lager_du_encoders), | ||
63 | }; | ||
64 | |||
65 | static const struct resource du_resources[] __initconst = { | ||
66 | DEFINE_RES_MEM(0xfeb00000, 0x70000), | ||
67 | DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"), | ||
68 | DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"), | ||
69 | DEFINE_RES_IRQ(gic_spi(256)), | ||
70 | DEFINE_RES_IRQ(gic_spi(268)), | ||
71 | DEFINE_RES_IRQ(gic_spi(269)), | ||
72 | }; | ||
73 | |||
74 | static void __init lager_add_du_device(void) | ||
75 | { | ||
76 | struct platform_device_info info = { | ||
77 | .name = "rcar-du-r8a7790", | ||
78 | .id = -1, | ||
79 | .res = du_resources, | ||
80 | .num_res = ARRAY_SIZE(du_resources), | ||
81 | .data = &lager_du_pdata, | ||
82 | .size_data = sizeof(lager_du_pdata), | ||
83 | .dma_mask = DMA_BIT_MASK(32), | ||
84 | }; | ||
85 | |||
86 | platform_device_register_full(&info); | ||
87 | } | ||
88 | |||
30 | static void __init lager_add_standard_devices(void) | 89 | static void __init lager_add_standard_devices(void) |
31 | { | 90 | { |
32 | #ifdef CONFIG_COMMON_CLK | 91 | #ifdef CONFIG_COMMON_CLK |
@@ -50,6 +109,11 @@ static void __init lager_add_standard_devices(void) | |||
50 | { "scif1", NULL, "sh-sci.7" }, | 109 | { "scif1", NULL, "sh-sci.7" }, |
51 | { "hscif0", NULL, "sh-sci.8" }, | 110 | { "hscif0", NULL, "sh-sci.8" }, |
52 | { "hscif1", NULL, "sh-sci.9" }, | 111 | { "hscif1", NULL, "sh-sci.9" }, |
112 | { "du0", "du.0", "rcar-du-r8a7790" }, | ||
113 | { "du1", "du.1", "rcar-du-r8a7790" }, | ||
114 | { "du2", "du.2", "rcar-du-r8a7790" }, | ||
115 | { "lvds0", "lvds.0", "rcar-du-r8a7790" }, | ||
116 | { "lvds1", "lvds.1", "rcar-du-r8a7790" }, | ||
53 | }; | 117 | }; |
54 | struct clk *clk; | 118 | struct clk *clk; |
55 | unsigned int i; | 119 | unsigned int i; |
@@ -68,6 +132,8 @@ static void __init lager_add_standard_devices(void) | |||
68 | 132 | ||
69 | r8a7790_add_dt_devices(); | 133 | r8a7790_add_dt_devices(); |
70 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 134 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
135 | |||
136 | lager_add_du_device(); | ||
71 | } | 137 | } |
72 | 138 | ||
73 | static const char *lager_boards_compat_dt[] __initdata = { | 139 | static const char *lager_boards_compat_dt[] __initdata = { |