2 * Copyright (C) 2010 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
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.
8 #include "../hardware.h"
9 #include "devices-common.h"
11 #define imx_flexcan_data_entry_single(soc, _id, _hwid, _size) \
14 .iobase = soc ## _CAN ## _hwid ## _BASE_ADDR, \
16 .irq = soc ## _INT_CAN ## _hwid, \
19 #define imx_flexcan_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_flexcan_data_entry_single(soc, _id, _hwid, _size)
22 #ifdef CONFIG_SOC_IMX35
23 const struct imx_flexcan_data imx35_flexcan_data
[] __initconst
= {
24 #define imx35_flexcan_data_entry(_id, _hwid) \
25 imx_flexcan_data_entry(MX35, _id, _hwid, SZ_16K)
26 imx35_flexcan_data_entry(0, 1),
27 imx35_flexcan_data_entry(1, 2),
29 #endif /* ifdef CONFIG_SOC_IMX35 */
31 struct platform_device
*__init
imx_add_flexcan(
32 const struct imx_flexcan_data
*data
)
34 struct resource res
[] = {
36 .start
= data
->iobase
,
37 .end
= data
->iobase
+ data
->iosize
- 1,
38 .flags
= IORESOURCE_MEM
,
42 .flags
= IORESOURCE_IRQ
,
46 return imx_add_platform_device("flexcan", data
->id
,
47 res
, ARRAY_SIZE(res
), NULL
, 0);