diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-12-06 20:17:44 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-19 05:08:24 -0500 |
commit | 784c33a0c9b509f09cb69bc93f3863ed20338462 (patch) | |
tree | 3f9fd13116879562b35626b8274d0246a2df5741 /arch/arm/mach-shmobile/board-koelsch.c | |
parent | 70d4f2e5576a16120e6bc85b10011032306c1179 (diff) |
ARM: shmobile: koelsch: Add DU device
Only the LVDS output is currently supported.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile/board-koelsch.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 6e12914d6d58..5d84fb6f3c5c 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/dma-mapping.h> | ||
22 | #include <linux/gpio.h> | 23 | #include <linux/gpio.h> |
23 | #include <linux/gpio_keys.h> | 24 | #include <linux/gpio_keys.h> |
24 | #include <linux/input.h> | 25 | #include <linux/input.h> |
@@ -26,13 +27,66 @@ | |||
26 | #include <linux/leds.h> | 27 | #include <linux/leds.h> |
27 | #include <linux/pinctrl/machine.h> | 28 | #include <linux/pinctrl/machine.h> |
28 | #include <linux/platform_data/gpio-rcar.h> | 29 | #include <linux/platform_data/gpio-rcar.h> |
30 | #include <linux/platform_data/rcar-du.h> | ||
29 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
30 | #include <mach/common.h> | 32 | #include <mach/common.h> |
33 | #include <mach/irqs.h> | ||
31 | #include <mach/r8a7791.h> | 34 | #include <mach/r8a7791.h> |
32 | #include <mach/rcar-gen2.h> | 35 | #include <mach/rcar-gen2.h> |
33 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
35 | 38 | ||
39 | /* DU */ | ||
40 | static struct rcar_du_encoder_data koelsch_du_encoders[] = { | ||
41 | { | ||
42 | .type = RCAR_DU_ENCODER_NONE, | ||
43 | .output = RCAR_DU_OUTPUT_LVDS0, | ||
44 | .connector.lvds.panel = { | ||
45 | .width_mm = 210, | ||
46 | .height_mm = 158, | ||
47 | .mode = { | ||
48 | .clock = 65000, | ||
49 | .hdisplay = 1024, | ||
50 | .hsync_start = 1048, | ||
51 | .hsync_end = 1184, | ||
52 | .htotal = 1344, | ||
53 | .vdisplay = 768, | ||
54 | .vsync_start = 771, | ||
55 | .vsync_end = 777, | ||
56 | .vtotal = 806, | ||
57 | .flags = 0, | ||
58 | }, | ||
59 | }, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static const struct rcar_du_platform_data koelsch_du_pdata __initconst = { | ||
64 | .encoders = koelsch_du_encoders, | ||
65 | .num_encoders = ARRAY_SIZE(koelsch_du_encoders), | ||
66 | }; | ||
67 | |||
68 | static const struct resource du_resources[] __initconst = { | ||
69 | DEFINE_RES_MEM(0xfeb00000, 0x40000), | ||
70 | DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"), | ||
71 | DEFINE_RES_IRQ(gic_spi(256)), | ||
72 | DEFINE_RES_IRQ(gic_spi(268)), | ||
73 | }; | ||
74 | |||
75 | static void __init koelsch_add_du_device(void) | ||
76 | { | ||
77 | struct platform_device_info info = { | ||
78 | .name = "rcar-du-r8a7791", | ||
79 | .id = -1, | ||
80 | .res = du_resources, | ||
81 | .num_res = ARRAY_SIZE(du_resources), | ||
82 | .data = &koelsch_du_pdata, | ||
83 | .size_data = sizeof(koelsch_du_pdata), | ||
84 | .dma_mask = DMA_BIT_MASK(32), | ||
85 | }; | ||
86 | |||
87 | platform_device_register_full(&info); | ||
88 | } | ||
89 | |||
36 | /* LEDS */ | 90 | /* LEDS */ |
37 | static struct gpio_led koelsch_leds[] = { | 91 | static struct gpio_led koelsch_leds[] = { |
38 | { | 92 | { |
@@ -80,6 +134,13 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = { | |||
80 | }; | 134 | }; |
81 | 135 | ||
82 | static const struct pinctrl_map koelsch_pinctrl_map[] = { | 136 | static const struct pinctrl_map koelsch_pinctrl_map[] = { |
137 | /* DU */ | ||
138 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791", | ||
139 | "du_rgb666", "du"), | ||
140 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791", | ||
141 | "du_sync", "du"), | ||
142 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791", | ||
143 | "du_clk_out_0", "du"), | ||
83 | /* SCIF0 (CN19: DEBUG SERIAL0) */ | 144 | /* SCIF0 (CN19: DEBUG SERIAL0) */ |
84 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791", | 145 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791", |
85 | "scif0_data_d", "scif0"), | 146 | "scif0_data_d", "scif0"), |
@@ -101,6 +162,8 @@ static void __init koelsch_add_standard_devices(void) | |||
101 | platform_device_register_data(&platform_bus, "gpio-keys", -1, | 162 | platform_device_register_data(&platform_bus, "gpio-keys", -1, |
102 | &koelsch_keys_pdata, | 163 | &koelsch_keys_pdata, |
103 | sizeof(koelsch_keys_pdata)); | 164 | sizeof(koelsch_keys_pdata)); |
165 | |||
166 | koelsch_add_du_device(); | ||
104 | } | 167 | } |
105 | 168 | ||
106 | static const char * const koelsch_boards_compat_dt[] __initconst = { | 169 | static const char * const koelsch_boards_compat_dt[] __initconst = { |