diff options
-rw-r--r-- | arch/arm/mach-mx25/devices-imx25.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx35.h | 5 | ||||
-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 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 18 |
6 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h index 2025cb947fcf..d86a7c3ca8b0 100644 --- a/arch/arm/mach-mx25/devices-imx25.h +++ b/arch/arm/mach-mx25/devices-imx25.h | |||
@@ -9,6 +9,11 @@ | |||
9 | #include <mach/mx25.h> | 9 | #include <mach/mx25.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx25_add_flexcan0(pdata) \ | ||
13 | imx_add_flexcan(0, MX25_CAN1_BASE_ADDR, SZ_16K, MX25_INT_CAN1, pdata) | ||
14 | #define imx25_add_flexcan1(pdata) \ | ||
15 | imx_add_flexcan(1, MX25_CAN2_BASE_ADDR, SZ_16K, MX25_INT_CAN2, pdata) | ||
16 | |||
12 | #define imx25_add_imx_i2c0(pdata) \ | 17 | #define imx25_add_imx_i2c0(pdata) \ |
13 | imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata) | 18 | imx_add_imx_i2c(0, MX25_I2C1_BASE_ADDR, SZ_16K, MX25_INT_I2C1, pdata) |
14 | #define imx25_add_imx_i2c1(pdata) \ | 19 | #define imx25_add_imx_i2c1(pdata) \ |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index 536d9b9a250b..f6a431a4c3d2 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -9,6 +9,11 @@ | |||
9 | #include <mach/mx35.h> | 9 | #include <mach/mx35.h> |
10 | #include <mach/devices-common.h> | 10 | #include <mach/devices-common.h> |
11 | 11 | ||
12 | #define imx35_add_flexcan0(pdata) \ | ||
13 | imx_add_flexcan(0, MX35_CAN1_BASE_ADDR, SZ_16K, MX35_INT_CAN1, pdata) | ||
14 | #define imx35_add_flexcan1(pdata) \ | ||
15 | imx_add_flexcan(1, MX35_CAN2_BASE_ADDR, SZ_16K, MX35_INT_CAN2, pdata) | ||
16 | |||
12 | #define imx35_add_imx_i2c0(pdata) \ | 17 | #define imx35_add_imx_i2c0(pdata) \ |
13 | imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata) | 18 | imx_add_imx_i2c(0, MX35_I2C1_BASE_ADDR, SZ_4K, MX35_INT_I2C1, pdata) |
14 | #define imx35_add_imx_i2c1(pdata) \ | 19 | #define imx35_add_imx_i2c1(pdata) \ |
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 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 05c8d3f0a08f..c5f68c587309 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -14,6 +14,24 @@ struct platform_device *imx_add_platform_device(const char *name, int id, | |||
14 | const struct resource *res, unsigned int num_resources, | 14 | const struct resource *res, unsigned int num_resources, |
15 | const void *data, size_t size_data); | 15 | const void *data, size_t size_data); |
16 | 16 | ||
17 | #if defined (CONFIG_CAN_FLEXCAN) || defined (CONFIG_CAN_FLEXCAN_MODULE) | ||
18 | #include <linux/can/platform/flexcan.h> | ||
19 | struct platform_device *__init imx_add_flexcan(int id, | ||
20 | resource_size_t iobase, resource_size_t iosize, | ||
21 | resource_size_t irq, | ||
22 | const struct flexcan_platform_data *pdata); | ||
23 | #else | ||
24 | /* the ifdef can be removed once the flexcan driver has been merged */ | ||
25 | struct flexcan_platform_data; | ||
26 | static inline struct platform_device *__init imx_add_flexcan(int id, | ||
27 | resource_size_t iobase, resource_size_t iosize, | ||
28 | resource_size_t irq, | ||
29 | const struct flexcan_platform_data *pdata) | ||
30 | { | ||
31 | return NULL; | ||
32 | } | ||
33 | #endif | ||
34 | |||
17 | #include <mach/i2c.h> | 35 | #include <mach/i2c.h> |
18 | struct platform_device *__init imx_add_imx_i2c(int id, | 36 | struct platform_device *__init imx_add_imx_i2c(int id, |
19 | resource_size_t iobase, resource_size_t iosize, int irq, | 37 | resource_size_t iobase, resource_size_t iosize, int irq, |