diff options
Diffstat (limited to 'arch/arm/mach-pxa/mioa701.c')
-rw-r--r-- | arch/arm/mach-pxa/mioa701.c | 68 |
1 files changed, 6 insertions, 62 deletions
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 2d28132c725b..a8122ecd2a3a 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -434,72 +434,15 @@ struct gpio_vbus_mach_info gpio_vbus_data = { | |||
434 | /* | 434 | /* |
435 | * SDIO/MMC Card controller | 435 | * SDIO/MMC Card controller |
436 | */ | 436 | */ |
437 | static void mci_setpower(struct device *dev, unsigned int vdd) | ||
438 | { | ||
439 | struct pxamci_platform_data *p_d = dev->platform_data; | ||
440 | |||
441 | if ((1 << vdd) & p_d->ocr_mask) | ||
442 | gpio_set_value(GPIO91_SDIO_EN, 1); /* enable SDIO power */ | ||
443 | else | ||
444 | gpio_set_value(GPIO91_SDIO_EN, 0); /* disable SDIO power */ | ||
445 | } | ||
446 | |||
447 | static int mci_get_ro(struct device *dev) | ||
448 | { | ||
449 | return gpio_get_value(GPIO78_SDIO_RO); | ||
450 | } | ||
451 | |||
452 | struct gpio_ress mci_gpios[] = { | ||
453 | MIO_GPIO_IN(GPIO78_SDIO_RO, "SDIO readonly detect"), | ||
454 | MIO_GPIO_IN(GPIO15_SDIO_INSERT, "SDIO insertion detect"), | ||
455 | MIO_GPIO_OUT(GPIO91_SDIO_EN, 0, "SDIO power enable") | ||
456 | }; | ||
457 | |||
458 | static void mci_exit(struct device *dev, void *data) | ||
459 | { | ||
460 | mio_gpio_free(ARRAY_AND_SIZE(mci_gpios)); | ||
461 | free_irq(gpio_to_irq(GPIO15_SDIO_INSERT), data); | ||
462 | } | ||
463 | |||
464 | static struct pxamci_platform_data mioa701_mci_info; | ||
465 | |||
466 | /** | 437 | /** |
467 | * The card detect interrupt isn't debounced so we delay it by 250ms | 438 | * The card detect interrupt isn't debounced so we delay it by 250ms |
468 | * to give the card a chance to fully insert/eject. | 439 | * to give the card a chance to fully insert/eject. |
469 | */ | 440 | */ |
470 | static int mci_init(struct device *dev, irq_handler_t detect_int, void *data) | ||
471 | { | ||
472 | int rc; | ||
473 | int irq = gpio_to_irq(GPIO15_SDIO_INSERT); | ||
474 | |||
475 | rc = mio_gpio_request(ARRAY_AND_SIZE(mci_gpios)); | ||
476 | if (rc) | ||
477 | goto err_gpio; | ||
478 | /* enable RE/FE interrupt on card insertion and removal */ | ||
479 | rc = request_irq(irq, detect_int, | ||
480 | IRQF_DISABLED | IRQF_TRIGGER_RISING | | ||
481 | IRQF_TRIGGER_FALLING, | ||
482 | "MMC card detect", data); | ||
483 | if (rc) | ||
484 | goto err_irq; | ||
485 | |||
486 | mioa701_mci_info.detect_delay = msecs_to_jiffies(250); | ||
487 | return 0; | ||
488 | |||
489 | err_irq: | ||
490 | dev_err(dev, "mioa701_mci_init: MMC/SD:" | ||
491 | " can't request MMC card detect IRQ\n"); | ||
492 | mio_gpio_free(ARRAY_AND_SIZE(mci_gpios)); | ||
493 | err_gpio: | ||
494 | return rc; | ||
495 | } | ||
496 | |||
497 | static struct pxamci_platform_data mioa701_mci_info = { | 441 | static struct pxamci_platform_data mioa701_mci_info = { |
498 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 442 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
499 | .init = mci_init, | 443 | .gpio_card_detect = GPIO15_SDIO_INSERT, |
500 | .get_ro = mci_get_ro, | 444 | .gpio_card_ro = GPIO78_SDIO_RO, |
501 | .setpower = mci_setpower, | 445 | .gpio_power = GPIO91_SDIO_EN, |
502 | .exit = mci_exit, | ||
503 | }; | 446 | }; |
504 | 447 | ||
505 | /* FlashRAM */ | 448 | /* FlashRAM */ |
@@ -841,7 +784,7 @@ static void mioa701_restart(char c, const char *cmd) | |||
841 | static struct gpio_ress global_gpios[] = { | 784 | static struct gpio_ress global_gpios[] = { |
842 | MIO_GPIO_OUT(GPIO9_CHARGE_EN, 1, "Charger enable"), | 785 | MIO_GPIO_OUT(GPIO9_CHARGE_EN, 1, "Charger enable"), |
843 | MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"), | 786 | MIO_GPIO_OUT(GPIO18_POWEROFF, 0, "Power Off"), |
844 | MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power") | 787 | MIO_GPIO_OUT(GPIO87_LCD_POWER, 0, "LCD Power"), |
845 | }; | 788 | }; |
846 | 789 | ||
847 | static void __init mioa701_machine_init(void) | 790 | static void __init mioa701_machine_init(void) |
@@ -855,6 +798,7 @@ static void __init mioa701_machine_init(void) | |||
855 | mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); | 798 | mio_gpio_request(ARRAY_AND_SIZE(global_gpios)); |
856 | bootstrap_init(); | 799 | bootstrap_init(); |
857 | set_pxa_fb_info(&mioa701_pxafb_info); | 800 | set_pxa_fb_info(&mioa701_pxafb_info); |
801 | mioa701_mci_info.detect_delay = msecs_to_jiffies(250); | ||
858 | pxa_set_mci_info(&mioa701_mci_info); | 802 | pxa_set_mci_info(&mioa701_mci_info); |
859 | pxa_set_keypad_info(&mioa701_keypad_info); | 803 | pxa_set_keypad_info(&mioa701_keypad_info); |
860 | wm97xx_bat_set_pdata(&mioa701_battery_data); | 804 | wm97xx_bat_set_pdata(&mioa701_battery_data); |