[PATCH 19/133] [Jaunty SRU] ARM.imx51 Freescale:ENGR00106026-4 MX51: Add IIM platform device

Brad Figg brad.figg at canonical.com
Thu Jul 9 16:48:09 UTC 2009


From: Liu Ying <b17645 at freescale.com>

Add IIM platform device for MX51.

Signed-off-by: Liu Ying <b17645 at freescale.com>
Signed-off-by: Brad Figg <brad.figg at canonical.com>
---
 arch/arm/configs/imx51_3stack_defconfig |    1 +
 arch/arm/mach-mx51/devices.c            |   32 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/arch/arm/configs/imx51_3stack_defconfig b/arch/arm/configs/imx51_3stack_defconfig
index d6b63a3..54191ba 100644
--- a/arch/arm/configs/imx51_3stack_defconfig
+++ b/arch/arm/configs/imx51_3stack_defconfig
@@ -724,6 +724,7 @@ CONFIG_HW_CONSOLE=y
 CONFIG_DEVKMEM=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 CONFIG_FM_SI4702=m
+CONFIG_MXC_IIM=m
 
 #
 # Serial drivers
diff --git a/arch/arm/mach-mx51/devices.c b/arch/arm/mach-mx51/devices.c
index aeb1ed4..f882174 100644
--- a/arch/arm/mach-mx51/devices.c
+++ b/arch/arm/mach-mx51/devices.c
@@ -896,6 +896,37 @@ static inline void mx51_init_lpmode(void)
 	(void)platform_device_register(&mx51_lpmode_device);
 }
 
+#if defined(CONFIG_MXC_IIM) || defined(CONFIG_MXC_IIM_MODULE)
+static struct resource mxc_iim_resources[] = {
+	{
+	 .start = IIM_BASE_ADDR,
+	 .end = IIM_BASE_ADDR + SZ_4K - 1,
+	 .flags = IORESOURCE_MEM,
+	 },
+};
+
+static struct platform_device mxc_iim_device = {
+	.name = "mxc_iim",
+	.id = 0,
+	.dev = {
+		.release = mxc_nop_release,
+		},
+	.num_resources = ARRAY_SIZE(mxc_iim_resources),
+	.resource = mxc_iim_resources
+};
+
+static inline void mxc_init_iim(void)
+{
+	if (platform_device_register(&mxc_iim_device) < 0)
+		dev_err(&mxc_iim_device.dev,
+			"Unable to register mxc iim device\n");
+}
+#else
+static inline void mxc_init_iim(void)
+{
+}
+#endif
+
 int __init mxc_init_devices(void)
 {
 	mxc_init_wdt();
@@ -912,5 +943,6 @@ int __init mxc_init_devices(void)
 	mxc_init_tve();
 	mx51_init_lpmode();
 	mxc_init_dvfs();
+	mxc_init_iim();
 	return 0;
 }
-- 
1.6.0.4





More information about the kernel-team mailing list