2 * Copyright (C) 2011 Pengutronix
3 * Wolfram Sang <w.sang@pengutronix.de>
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
10 #include <mach/mx28.h>
11 #include <mach/devices-common.h>
13 #define mxs_i2c_data_entry_single(soc, _id) \
16 .iobase = soc ## _I2C ## _id ## _BASE_ADDR, \
17 .errirq = soc ## _INT_I2C ## _id ## _ERROR, \
18 .dmairq = soc ## _INT_I2C ## _id ## _DMA, \
21 #define mxs_i2c_data_entry(soc, _id) \
22 [_id] = mxs_i2c_data_entry_single(soc, _id)
24 #ifdef CONFIG_SOC_IMX28
25 const struct mxs_mxs_i2c_data mx28_mxs_i2c_data
[] __initconst
= {
26 mxs_i2c_data_entry(MX28
, 0),
27 mxs_i2c_data_entry(MX28
, 1),
31 struct platform_device
*__init
mxs_add_mxs_i2c(
32 const struct mxs_mxs_i2c_data
*data
)
34 struct resource res
[] = {
36 .start
= data
->iobase
,
37 .end
= data
->iobase
+ SZ_8K
- 1,
38 .flags
= IORESOURCE_MEM
,
40 .start
= data
->errirq
,
42 .flags
= IORESOURCE_IRQ
,
44 .start
= data
->dmairq
,
46 .flags
= IORESOURCE_IRQ
,
50 return mxs_add_platform_device("mxs-i2c", data
->id
, res
,
51 ARRAY_SIZE(res
), NULL
, 0);