diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2009-06-05 04:42:29 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-06-05 04:49:26 -0400 |
commit | 361778d6e7cb315b50f3f2469d782e90df7ac2cb (patch) | |
tree | 8e11305153f3e92586eebbd37b5f2f0573f18065 | |
parent | f6394e268fc541c274be8fa30ccb04b3e2f0450f (diff) |
[ARM] pxa/littleton: add support for the Micro-SD slot (MMC1)
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r-- | arch/arm/mach-pxa/littleton.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index 94a32321ad43..55b3788fd1ae 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <mach/pxa300.h> | 42 | #include <mach/pxa300.h> |
43 | #include <mach/pxafb.h> | 43 | #include <mach/pxafb.h> |
44 | #include <mach/ssp.h> | 44 | #include <mach/ssp.h> |
45 | #include <mach/mmc.h> | ||
45 | #include <mach/pxa2xx_spi.h> | 46 | #include <mach/pxa2xx_spi.h> |
46 | #include <plat/i2c.h> | 47 | #include <plat/i2c.h> |
47 | #include <mach/pxa27x_keypad.h> | 48 | #include <mach/pxa27x_keypad.h> |
@@ -50,6 +51,8 @@ | |||
50 | 51 | ||
51 | #include "generic.h" | 52 | #include "generic.h" |
52 | 53 | ||
54 | #define GPIO_MMC1_CARD_DETECT mfp_to_gpio(MFP_PIN_GPIO15) | ||
55 | |||
53 | /* Littleton MFP configurations */ | 56 | /* Littleton MFP configurations */ |
54 | static mfp_cfg_t littleton_mfp_cfg[] __initdata = { | 57 | static mfp_cfg_t littleton_mfp_cfg[] __initdata = { |
55 | /* LCD */ | 58 | /* LCD */ |
@@ -98,6 +101,15 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = { | |||
98 | GPIO123_KP_MKOUT_2, | 101 | GPIO123_KP_MKOUT_2, |
99 | GPIO124_KP_MKOUT_3, | 102 | GPIO124_KP_MKOUT_3, |
100 | GPIO125_KP_MKOUT_4, | 103 | GPIO125_KP_MKOUT_4, |
104 | |||
105 | /* MMC1 */ | ||
106 | GPIO3_MMC1_DAT0, | ||
107 | GPIO4_MMC1_DAT1, | ||
108 | GPIO5_MMC1_DAT2, | ||
109 | GPIO6_MMC1_DAT3, | ||
110 | GPIO7_MMC1_CLK, | ||
111 | GPIO8_MMC1_CMD, | ||
112 | GPIO15_GPIO, /* card detect */ | ||
101 | }; | 113 | }; |
102 | 114 | ||
103 | static struct resource smc91x_resources[] = { | 115 | static struct resource smc91x_resources[] = { |
@@ -252,6 +264,56 @@ static void __init littleton_init_keypad(void) | |||
252 | static inline void littleton_init_keypad(void) {} | 264 | static inline void littleton_init_keypad(void) {} |
253 | #endif | 265 | #endif |
254 | 266 | ||
267 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
268 | static int littleton_mci_init(struct device *dev, | ||
269 | irq_handler_t littleton_detect_int, void *data) | ||
270 | { | ||
271 | int err, gpio_cd = GPIO_MMC1_CARD_DETECT; | ||
272 | |||
273 | err = gpio_request(gpio_cd, "mmc card detect"); | ||
274 | if (err) | ||
275 | goto err_request_cd; | ||
276 | |||
277 | gpio_direction_input(gpio_cd); | ||
278 | |||
279 | err = request_irq(gpio_to_irq(gpio_cd), littleton_detect_int, | ||
280 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
281 | "mmc card detect", data); | ||
282 | if (err) { | ||
283 | dev_err(dev, "failed to request card detect IRQ\n"); | ||
284 | goto err_request_irq; | ||
285 | } | ||
286 | return 0; | ||
287 | |||
288 | err_request_irq: | ||
289 | gpio_free(gpio_cd); | ||
290 | err_request_cd: | ||
291 | return err; | ||
292 | } | ||
293 | |||
294 | static void littleton_mci_exit(struct device *dev, void *data) | ||
295 | { | ||
296 | int gpio_cd = GPIO_MMC1_CARD_DETECT; | ||
297 | |||
298 | free_irq(gpio_to_irq(gpio_cd), data); | ||
299 | gpio_free(gpio_cd); | ||
300 | } | ||
301 | |||
302 | static struct pxamci_platform_data littleton_mci_platform_data = { | ||
303 | .detect_delay = 20, | ||
304 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
305 | .init = littleton_mci_init, | ||
306 | .exit = littleton_mci_exit, | ||
307 | }; | ||
308 | |||
309 | static void __init littleton_init_mmc(void) | ||
310 | { | ||
311 | pxa_set_mci_info(&littleton_mci_platform_data); | ||
312 | } | ||
313 | #else | ||
314 | static inline void littleton_init_mmc(void) {} | ||
315 | #endif | ||
316 | |||
255 | #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) | 317 | #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) |
256 | static struct mtd_partition littleton_nand_partitions[] = { | 318 | static struct mtd_partition littleton_nand_partitions[] = { |
257 | [0] = { | 319 | [0] = { |
@@ -392,6 +454,7 @@ static void __init littleton_init(void) | |||
392 | 454 | ||
393 | littleton_init_spi(); | 455 | littleton_init_spi(); |
394 | littleton_init_i2c(); | 456 | littleton_init_i2c(); |
457 | littleton_init_mmc(); | ||
395 | littleton_init_lcd(); | 458 | littleton_init_lcd(); |
396 | littleton_init_keypad(); | 459 | littleton_init_keypad(); |
397 | littleton_init_nand(); | 460 | littleton_init_nand(); |