diff options
author | Vladimir Barinov <vova.barinov@gmail.com> | 2009-04-28 20:00:50 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-07 10:19:01 -0400 |
commit | c981214ac4a304d784a290b3714cc73a39589af0 (patch) | |
tree | a9fefe66ac4e68a204a0e4083d3188d11e22b3fc /arch/arm/mach-mx2/mx27ads.c | |
parent | 8d4fd258f9b0bee1ef5f1508bfed4d138a252891 (diff) |
MX27ADS: Add I2C support
Add I2C support for MX27ADS board
Signed-off-by: Vladimir Barinov <vbarinov@embeddedalley.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2/mx27ads.c')
-rw-r--r-- | arch/arm/mach-mx2/mx27ads.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index ee8f3d986ff5..bf131457c0e5 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mtd/map.h> | 23 | #include <linux/mtd/map.h> |
24 | #include <linux/mtd/partitions.h> | 24 | #include <linux/mtd/partitions.h> |
25 | #include <linux/mtd/physmap.h> | 25 | #include <linux/mtd/physmap.h> |
26 | #include <linux/i2c.h> | ||
26 | #include <mach/common.h> | 27 | #include <mach/common.h> |
27 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
@@ -34,6 +35,7 @@ | |||
34 | #include <mach/iomux.h> | 35 | #include <mach/iomux.h> |
35 | #include <mach/board-mx27ads.h> | 36 | #include <mach/board-mx27ads.h> |
36 | #include <mach/mxc_nand.h> | 37 | #include <mach/mxc_nand.h> |
38 | #include <mach/i2c.h> | ||
37 | 39 | ||
38 | #include "devices.h" | 40 | #include "devices.h" |
39 | 41 | ||
@@ -87,6 +89,9 @@ static unsigned int mx27ads_pins[] = { | |||
87 | PD15_AOUT_FEC_COL, | 89 | PD15_AOUT_FEC_COL, |
88 | PD16_AIN_FEC_TX_ER, | 90 | PD16_AIN_FEC_TX_ER, |
89 | PF23_AIN_FEC_TX_EN, | 91 | PF23_AIN_FEC_TX_EN, |
92 | /* I2C2 */ | ||
93 | PC5_PF_I2C2_SDA, | ||
94 | PC6_PF_I2C2_SCL, | ||
90 | }; | 95 | }; |
91 | 96 | ||
92 | static struct mxc_nand_platform_data mx27ads_nand_board_info = { | 97 | static struct mxc_nand_platform_data mx27ads_nand_board_info = { |
@@ -116,6 +121,13 @@ static struct platform_device mx27ads_nor_mtd_device = { | |||
116 | .resource = &mx27ads_flash_resource, | 121 | .resource = &mx27ads_flash_resource, |
117 | }; | 122 | }; |
118 | 123 | ||
124 | static struct imxi2c_platform_data mx27ads_i2c_data = { | ||
125 | .bitrate = 100000, | ||
126 | }; | ||
127 | |||
128 | static struct i2c_board_info mx27ads_i2c_devices[] = { | ||
129 | }; | ||
130 | |||
119 | static struct platform_device *platform_devices[] __initdata = { | 131 | static struct platform_device *platform_devices[] __initdata = { |
120 | &mx27ads_nor_mtd_device, | 132 | &mx27ads_nor_mtd_device, |
121 | &mxc_fec_device, | 133 | &mxc_fec_device, |
@@ -150,6 +162,11 @@ static void __init mx27ads_board_init(void) | |||
150 | mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); | 162 | mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); |
151 | mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info); | 163 | mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info); |
152 | 164 | ||
165 | /* only the i2c master 1 is used on this CPU card */ | ||
166 | i2c_register_board_info(1, mx27ads_i2c_devices, | ||
167 | ARRAY_SIZE(mx27ads_i2c_devices)); | ||
168 | mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); | ||
169 | |||
153 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 170 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
154 | } | 171 | } |
155 | 172 | ||