diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-27 06:55:35 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-09-30 03:12:17 -0400 |
commit | df83d907348b41f40da83b267242b5dca041d4ef (patch) | |
tree | 6ddac04777280c0a273cf9c51e6415fc24f7310e | |
parent | f39d35fcc2cd7a24ec3128adffd7876953999e1f (diff) |
ARM: shmobile: marzen: Add Display Unit support
Support the DU0 VGA and DU1 LVDS outputs. DU1 is connected to a
Mitsubishi AA104XD12 panel (10.4" XGA).
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/board-marzen.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 3f5044fda4e3..434b213cc738 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
31 | #include <linux/pinctrl/machine.h> | 31 | #include <linux/pinctrl/machine.h> |
32 | #include <linux/platform_data/gpio-rcar.h> | 32 | #include <linux/platform_data/gpio-rcar.h> |
33 | #include <linux/platform_data/rcar-du.h> | ||
33 | #include <linux/platform_data/usb-rcar-phy.h> | 34 | #include <linux/platform_data/usb-rcar-phy.h> |
34 | #include <linux/regulator/fixed.h> | 35 | #include <linux/regulator/fixed.h> |
35 | #include <linux/regulator/machine.h> | 36 | #include <linux/regulator/machine.h> |
@@ -169,6 +170,63 @@ static struct platform_device hspi_device = { | |||
169 | .num_resources = ARRAY_SIZE(hspi_resources), | 170 | .num_resources = ARRAY_SIZE(hspi_resources), |
170 | }; | 171 | }; |
171 | 172 | ||
173 | /* | ||
174 | * DU | ||
175 | * | ||
176 | * The panel only specifies the [hv]display and [hv]total values. The position | ||
177 | * and width of the sync pulses don't matter, they're copied from VESA timings. | ||
178 | */ | ||
179 | static struct rcar_du_encoder_data du_encoders[] = { | ||
180 | { | ||
181 | .type = RCAR_DU_ENCODER_VGA, | ||
182 | .output = RCAR_DU_OUTPUT_DPAD0, | ||
183 | }, { | ||
184 | .type = RCAR_DU_ENCODER_LVDS, | ||
185 | .output = RCAR_DU_OUTPUT_DPAD1, | ||
186 | .connector.lvds.panel = { | ||
187 | .width_mm = 210, | ||
188 | .height_mm = 158, | ||
189 | .mode = { | ||
190 | .clock = 65000, | ||
191 | .hdisplay = 1024, | ||
192 | .hsync_start = 1048, | ||
193 | .hsync_end = 1184, | ||
194 | .htotal = 1344, | ||
195 | .vdisplay = 768, | ||
196 | .vsync_start = 771, | ||
197 | .vsync_end = 777, | ||
198 | .vtotal = 806, | ||
199 | .flags = 0, | ||
200 | }, | ||
201 | }, | ||
202 | }, | ||
203 | }; | ||
204 | |||
205 | static const struct rcar_du_platform_data du_pdata __initconst = { | ||
206 | .encoders = du_encoders, | ||
207 | .num_encoders = ARRAY_SIZE(du_encoders), | ||
208 | }; | ||
209 | |||
210 | static const struct resource du_resources[] __initconst = { | ||
211 | DEFINE_RES_MEM(0xfff80000, 0x40000), | ||
212 | DEFINE_RES_IRQ(gic_iid(0x3f)), | ||
213 | }; | ||
214 | |||
215 | static void __init marzen_add_du_device(void) | ||
216 | { | ||
217 | struct platform_device_info info = { | ||
218 | .name = "rcar-du-r8a7779", | ||
219 | .id = -1, | ||
220 | .res = du_resources, | ||
221 | .num_res = ARRAY_SIZE(du_resources), | ||
222 | .data = &du_pdata, | ||
223 | .size_data = sizeof(du_pdata), | ||
224 | .dma_mask = DMA_BIT_MASK(32), | ||
225 | }; | ||
226 | |||
227 | platform_device_register_full(&info); | ||
228 | } | ||
229 | |||
172 | /* LEDS */ | 230 | /* LEDS */ |
173 | static struct gpio_led marzen_leds[] = { | 231 | static struct gpio_led marzen_leds[] = { |
174 | { | 232 | { |
@@ -237,6 +295,19 @@ static struct platform_device *marzen_devices[] __initdata = { | |||
237 | }; | 295 | }; |
238 | 296 | ||
239 | static const struct pinctrl_map marzen_pinctrl_map[] = { | 297 | static const struct pinctrl_map marzen_pinctrl_map[] = { |
298 | /* DU (CN10: ARGB0, CN13: LVDS) */ | ||
299 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
300 | "du0_rgb888", "du0"), | ||
301 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
302 | "du0_sync_1", "du0"), | ||
303 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
304 | "du0_clk_out_0", "du0"), | ||
305 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
306 | "du1_rgb666", "du1"), | ||
307 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
308 | "du1_sync_1", "du1"), | ||
309 | PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7779", "pfc-r8a7779", | ||
310 | "du1_clk_out", "du1"), | ||
240 | /* HSPI0 */ | 311 | /* HSPI0 */ |
241 | PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779", | 312 | PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779", |
242 | "hspi0", "hspi0"), | 313 | "hspi0", "hspi0"), |
@@ -297,6 +368,7 @@ static void __init marzen_init(void) | |||
297 | r8a7779_add_vin_device(1, &vin_platform_data); | 368 | r8a7779_add_vin_device(1, &vin_platform_data); |
298 | r8a7779_add_vin_device(3, &vin_platform_data); | 369 | r8a7779_add_vin_device(3, &vin_platform_data); |
299 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); | 370 | platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); |
371 | marzen_add_du_device(); | ||
300 | } | 372 | } |
301 | 373 | ||
302 | static const char *marzen_boards_compat_dt[] __initdata = { | 374 | static const char *marzen_boards_compat_dt[] __initdata = { |