diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-07-22 05:45:34 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-26 09:05:29 -0400 |
commit | 61c68502321d94a421f9a2a32f6789ecb27f382d (patch) | |
tree | f11a63bf01c5438d5c44deb14e45f38d85aec243 /arch/arm/plat-mxc/devices | |
parent | a7d945a469ee566bde26217362c95f29acfbd14a (diff) |
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')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-flexcan.c | 30 |
3 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 09230f8c802a..9ab784b776f9 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -1,3 +1,7 @@ | |||
1 | config IMX_HAVE_PLATFORM_FLEXCAN | ||
2 | select HAVE_CAN_FLEXCAN | ||
3 | bool | ||
4 | |||
1 | config IMX_HAVE_PLATFORM_IMX_I2C | 5 | config IMX_HAVE_PLATFORM_IMX_I2C |
2 | bool | 6 | bool |
3 | 7 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index 5ecbb244d210..347da5161f7e 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1,3 +1,7 @@ | |||
1 | ifdef CONFIG_CAN_FLEXCAN | ||
2 | # the ifdef can be removed once the flexcan driver has been merged | ||
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | ||
4 | endif | ||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 5 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | 6 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 7 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
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 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <mach/devices-common.h> | ||
10 | |||
11 | struct platform_device *__init imx_add_flexcan(int id, | ||
12 | resource_size_t iobase, resource_size_t iosize, | ||
13 | resource_size_t irq, | ||
14 | const struct flexcan_platform_data *pdata) | ||
15 | { | ||
16 | struct resource res[] = { | ||
17 | { | ||
18 | .start = iobase, | ||
19 | .end = iobase + iosize - 1, | ||
20 | .flags = IORESOURCE_MEM, | ||
21 | }, { | ||
22 | .start = irq, | ||
23 | .end = irq, | ||
24 | .flags = IORESOURCE_IRQ, | ||
25 | }, | ||
26 | }; | ||
27 | |||
28 | return imx_add_platform_device("flexcan", id, res, ARRAY_SIZE(res), | ||
29 | pdata, sizeof(*pdata)); | ||
30 | } | ||