summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/devices/platform-flexcan.c
diff options
context:
space:
mode:
authorMarc Kleine-Budde2010-07-22 11:45:34 +0200
committerSascha Hauer2010-07-26 15:05:29 +0200
commit61c68502321d94a421f9a2a32f6789ecb27f382d (patch)
treef11a63bf01c5438d5c44deb14e45f38d85aec243 /arch/arm/plat-mxc/devices/platform-flexcan.c
parentmx35: add flexcan address (diff)
downloadkernel-qcow2-linux-61c68502321d94a421f9a2a32f6789ecb27f382d.tar.gz
kernel-qcow2-linux-61c68502321d94a421f9a2a32f6789ecb27f382d.tar.xz
kernel-qcow2-linux-61c68502321d94a421f9a2a32f6789ecb27f382d.zip
imx: dynamically register flexcan devices for mx25 and mx35
In order to make this patch compile, even if the flexcan driver with it's header defining the platform data isn't merged yet, two ifdefs have been added. They effect that the "imx_add_flexcan" function results in a no-op function if the driver hasn't been activated. These ifdefs can be removed after the flexcan driver has been merged. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc/devices/platform-flexcan.c')
-rw-r--r--arch/arm/plat-mxc/devices/platform-flexcan.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/platform-flexcan.c b/arch/arm/plat-mxc/devices/platform-flexcan.c
new file mode 100644
index 000000000000..5e97a01f14f3
--- /dev/null
+++ b/arch/arm/plat-mxc/devices/platform-flexcan.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2010 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+
+#include <mach/devices-common.h>
+
+struct platform_device *__init imx_add_flexcan(int id,
+ resource_size_t iobase, resource_size_t iosize,
+ resource_size_t irq,
+ const struct flexcan_platform_data *pdata)
+{
+ struct resource res[] = {
+ {
+ .start = iobase,
+ .end = iobase + iosize - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = irq,
+ .end = irq,
+ .flags = IORESOURCE_IRQ,
+ },
+ };
+
+ return imx_add_platform_device("flexcan", id, res, ARRAY_SIZE(res),
+ pdata, sizeof(*pdata));
+}