aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-02-16 16:32:01 -0500
committerSimon Horman <horms+renesas@verge.net.au>2014-02-16 22:12:27 -0500
commit14c5ce178ee46b205ff4e9087d5ecba298798edc (patch)
tree5859d0b46c6a2d161765b11c11ff2ab29f5f6743 /arch/arm/mach-shmobile
parent189ef3d62df6701e58d216cf81277b88bb4ac7a8 (diff)
ARM: shmobile: koelsch-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>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 42c6eb4c3e67..267fe8358cfe 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -21,13 +21,67 @@
21 21
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <linux/dma-mapping.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
25#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <linux/platform_data/rcar-du.h>
26#include <mach/common.h> 28#include <mach/common.h>
29#include <mach/irqs.h>
27#include <mach/rcar-gen2.h> 30#include <mach/rcar-gen2.h>
28#include <mach/r8a7791.h> 31#include <mach/r8a7791.h>
29#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
30 33
34/* DU */
35static struct rcar_du_encoder_data koelsch_du_encoders[] = {
36 {
37 .type = RCAR_DU_ENCODER_NONE,
38 .output = RCAR_DU_OUTPUT_LVDS0,
39 .connector.lvds.panel = {
40 .width_mm = 210,
41 .height_mm = 158,
42 .mode = {
43 .clock = 65000,
44 .hdisplay = 1024,
45 .hsync_start = 1048,
46 .hsync_end = 1184,
47 .htotal = 1344,
48 .vdisplay = 768,
49 .vsync_start = 771,
50 .vsync_end = 777,
51 .vtotal = 806,
52 .flags = 0,
53 },
54 },
55 },
56};
57
58static struct rcar_du_platform_data koelsch_du_pdata = {
59 .encoders = koelsch_du_encoders,
60 .num_encoders = ARRAY_SIZE(koelsch_du_encoders),
61};
62
63static const struct resource du_resources[] __initconst = {
64 DEFINE_RES_MEM(0xfeb00000, 0x40000),
65 DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
66 DEFINE_RES_IRQ(gic_spi(256)),
67 DEFINE_RES_IRQ(gic_spi(268)),
68};
69
70static void __init koelsch_add_du_device(void)
71{
72 struct platform_device_info info = {
73 .name = "rcar-du-r8a7791",
74 .id = -1,
75 .res = du_resources,
76 .num_res = ARRAY_SIZE(du_resources),
77 .data = &koelsch_du_pdata,
78 .size_data = sizeof(koelsch_du_pdata),
79 .dma_mask = DMA_BIT_MASK(32),
80 };
81
82 platform_device_register_full(&info);
83}
84
31static void __init koelsch_add_standard_devices(void) 85static void __init koelsch_add_standard_devices(void)
32{ 86{
33#ifdef CONFIG_COMMON_CLK 87#ifdef CONFIG_COMMON_CLK
@@ -56,6 +110,9 @@ static void __init koelsch_add_standard_devices(void)
56 { "scifa3", NULL, "sh-sci.12" }, 110 { "scifa3", NULL, "sh-sci.12" },
57 { "scifa4", NULL, "sh-sci.13" }, 111 { "scifa4", NULL, "sh-sci.13" },
58 { "scifa5", NULL, "sh-sci.14" }, 112 { "scifa5", NULL, "sh-sci.14" },
113 { "du0", "du.0", "rcar-du-r8a7791" },
114 { "du1", "du.1", "rcar-du-r8a7791" },
115 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
59 }; 116 };
60 struct clk *clk; 117 struct clk *clk;
61 unsigned int i; 118 unsigned int i;
@@ -73,6 +130,8 @@ static void __init koelsch_add_standard_devices(void)
73#endif 130#endif
74 r8a7791_add_dt_devices(); 131 r8a7791_add_dt_devices();
75 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 132 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
133
134 koelsch_add_du_device();
76} 135}
77 136
78static const char * const koelsch_boards_compat_dt[] __initconst = { 137static const char * const koelsch_boards_compat_dt[] __initconst = {