-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
- Loading branch information
Wolfram Sang
authored and
Sascha Hauer
committed
Mar 7, 2011
1 parent
19373c0
commit 30feed3
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (C) 2011 Pengutronix | ||
* Wolfram Sang <w.sang@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 <asm/sizes.h> | ||
#include <mach/mx28.h> | ||
#include <mach/devices-common.h> | ||
|
||
#define mxs_i2c_data_entry_single(soc, _id) \ | ||
{ \ | ||
.id = _id, \ | ||
.iobase = soc ## _I2C ## _id ## _BASE_ADDR, \ | ||
.errirq = soc ## _INT_I2C ## _id ## _ERROR, \ | ||
.dmairq = soc ## _INT_I2C ## _id ## _DMA, \ | ||
} | ||
|
||
#define mxs_i2c_data_entry(soc, _id) \ | ||
[_id] = mxs_i2c_data_entry_single(soc, _id) | ||
|
||
#ifdef CONFIG_SOC_IMX28 | ||
const struct mxs_i2c_data mx28_mxs_i2c_data[] __initconst = { | ||
mxs_i2c_data_entry(MX28, 0), | ||
mxs_i2c_data_entry(MX28, 1), | ||
}; | ||
#endif | ||
|
||
struct platform_device *__init mxs_add_mxs_i2c(const struct mxs_i2c_data *data) | ||
{ | ||
struct resource res[] = { | ||
{ | ||
.start = data->iobase, | ||
.end = data->iobase + SZ_8K - 1, | ||
.flags = IORESOURCE_MEM, | ||
}, { | ||
.start = data->errirq, | ||
.end = data->errirq, | ||
.flags = IORESOURCE_IRQ, | ||
}, { | ||
.start = data->dmairq, | ||
.end = data->dmairq, | ||
.flags = IORESOURCE_IRQ, | ||
}, | ||
}; | ||
|
||
return mxs_add_platform_device("mxs-i2c", data->id, res, | ||
ARRAY_SIZE(res), NULL, 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters