diff mbox

[PATCH/RFC,389/390] ARM: mach-shmobile: r8a7779: Add DU support

Message ID 1364525119-31791-390-git-send-email-horms+renesas@verge.net.au (mailing list archive)
State New, archived
Headers show

Commit Message

Simon Horman March 29, 2013, 2:45 a.m. UTC
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Add a function to register the DU device with board-specific platform
data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7779.c       |   30 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 1eeb828..cf98c9d 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -59,6 +59,7 @@  extern void r8a7779_add_early_devices(void);
 extern void r8a7779_add_standard_devices(void);
 extern void r8a7779_clock_init(void);
 extern void r8a7779_pinmux_init(void);
+extern void r8a7779_add_du_device(void *pdata);
 extern void r8a7779_pm_init(void);
 extern void r8a7740_meram_workaround(void);
 
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 1a7f7bc..6762b71 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -114,6 +114,29 @@  R8A7779_GPIO(4, 32);
 R8A7779_GPIO(5, 32);
 R8A7779_GPIO(6, 9);
 
+static struct resource du_resources[] = {
+	[0] = {
+		.name	= "Display Unit",
+		.start	= 0xfff80000,
+		.end	= 0xfffb1007,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= gic_iid(0x3f),
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device du_device = {
+	.name		= "rcar-du",
+	.num_resources	= ARRAY_SIZE(du_resources),
+	.resource	= du_resources,
+	.id		= 0,
+	.dev	= {
+		.coherent_dma_mask = ~0,
+	},
+};
+
 static struct platform_device *r8a7779_pinctrl_devices[] __initdata = {
 	&r8a7779_pfc_device,
 	&r8a7779_gpio0_device,
@@ -333,6 +356,13 @@  void __init r8a7779_add_standard_devices(void)
 			    ARRAY_SIZE(r8a7779_late_devices));
 }
 
+void __init r8a7779_add_du_device(void *pdata)
+{
+	du_device.dev.platform_data = pdata;
+
+	platform_device_register(&du_device);
+}
+
 /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
 void __init __weak r8a7779_register_twd(void) { }