diff options
author | Vladimir Barinov <vova.barinov@gmail.com> | 2009-04-30 07:31:20 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-07 10:19:30 -0400 |
commit | 60c24dc79f01edfaa14290ada39a9074050ffbcc (patch) | |
tree | 38974c0664d1ce0dd6eb55a7146c230d258ec15b /arch/arm | |
parent | 9366d8f67c234815e99bc8518a92da7f0fa3e026 (diff) |
MX27ADS: Add SDHC support
Add SDHC 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')
-rw-r--r-- | arch/arm/mach-mx2/mx27ads.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mx27ads.c index 90268a51f1fa..02daddac6995 100644 --- a/arch/arm/mach-mx2/mx27ads.c +++ b/arch/arm/mach-mx2/mx27ads.c | |||
@@ -24,6 +24,7 @@ | |||
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 <linux/i2c.h> |
27 | #include <linux/irq.h> | ||
27 | #include <mach/common.h> | 28 | #include <mach/common.h> |
28 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
@@ -37,6 +38,7 @@ | |||
37 | #include <mach/mxc_nand.h> | 38 | #include <mach/mxc_nand.h> |
38 | #include <mach/i2c.h> | 39 | #include <mach/i2c.h> |
39 | #include <mach/imxfb.h> | 40 | #include <mach/imxfb.h> |
41 | #include <mach/mmc.h> | ||
40 | 42 | ||
41 | #include "devices.h" | 43 | #include "devices.h" |
42 | 44 | ||
@@ -123,6 +125,20 @@ static unsigned int mx27ads_pins[] = { | |||
123 | PA31_PF_OE_ACD, | 125 | PA31_PF_OE_ACD, |
124 | /* OWIRE */ | 126 | /* OWIRE */ |
125 | PE16_AF_OWIRE, | 127 | PE16_AF_OWIRE, |
128 | /* SDHC1*/ | ||
129 | PE18_PF_SD1_D0, | ||
130 | PE19_PF_SD1_D1, | ||
131 | PE20_PF_SD1_D2, | ||
132 | PE21_PF_SD1_D3, | ||
133 | PE22_PF_SD1_CMD, | ||
134 | PE23_PF_SD1_CLK, | ||
135 | /* SDHC2*/ | ||
136 | PB4_PF_SD2_D0, | ||
137 | PB5_PF_SD2_D1, | ||
138 | PB6_PF_SD2_D2, | ||
139 | PB7_PF_SD2_D3, | ||
140 | PB8_PF_SD2_CMD, | ||
141 | PB9_PF_SD2_CLK, | ||
126 | }; | 142 | }; |
127 | 143 | ||
128 | static struct mxc_nand_platform_data mx27ads_nand_board_info = { | 144 | static struct mxc_nand_platform_data mx27ads_nand_board_info = { |
@@ -199,6 +215,40 @@ static struct imx_fb_platform_data mx27ads_fb_data = { | |||
199 | .lcd_power = lcd_power, | 215 | .lcd_power = lcd_power, |
200 | }; | 216 | }; |
201 | 217 | ||
218 | static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | ||
219 | void *data) | ||
220 | { | ||
221 | return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING, | ||
222 | "sdhc1-card-detect", data); | ||
223 | } | ||
224 | |||
225 | static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq, | ||
226 | void *data) | ||
227 | { | ||
228 | return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING, | ||
229 | "sdhc2-card-detect", data); | ||
230 | } | ||
231 | |||
232 | static void mx27ads_sdhc1_exit(struct device *dev, void *data) | ||
233 | { | ||
234 | free_irq(IRQ_GPIOE(21), data); | ||
235 | } | ||
236 | |||
237 | static void mx27ads_sdhc2_exit(struct device *dev, void *data) | ||
238 | { | ||
239 | free_irq(IRQ_GPIOB(7), data); | ||
240 | } | ||
241 | |||
242 | static struct imxmmc_platform_data sdhc1_pdata = { | ||
243 | .init = mx27ads_sdhc1_init, | ||
244 | .exit = mx27ads_sdhc1_exit, | ||
245 | }; | ||
246 | |||
247 | static struct imxmmc_platform_data sdhc2_pdata = { | ||
248 | .init = mx27ads_sdhc2_init, | ||
249 | .exit = mx27ads_sdhc2_exit, | ||
250 | }; | ||
251 | |||
202 | static struct platform_device *platform_devices[] __initdata = { | 252 | static struct platform_device *platform_devices[] __initdata = { |
203 | &mx27ads_nor_mtd_device, | 253 | &mx27ads_nor_mtd_device, |
204 | &mxc_fec_device, | 254 | &mxc_fec_device, |
@@ -239,6 +289,8 @@ static void __init mx27ads_board_init(void) | |||
239 | ARRAY_SIZE(mx27ads_i2c_devices)); | 289 | ARRAY_SIZE(mx27ads_i2c_devices)); |
240 | mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); | 290 | mxc_register_device(&mxc_i2c_device1, &mx27ads_i2c_data); |
241 | mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); | 291 | mxc_register_device(&mxc_fb_device, &mx27ads_fb_data); |
292 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | ||
293 | mxc_register_device(&mxc_sdhc_device1, &sdhc2_pdata); | ||
242 | 294 | ||
243 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 295 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
244 | } | 296 | } |