diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2010-08-09 07:56:40 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-09-23 10:02:00 -0400 |
commit | 4b8caec09562ce7e6e3aaf2954eef8ea73ba67b8 (patch) | |
tree | f10e2defd6d2addfafa77b45df527a93d8c0c106 /drivers/mmc | |
parent | 148b8b39c156424da22693d26adcb69800faf95e (diff) |
ARM: 6309/1: mmci: allow neither ->status nor gpio_cd to be specified
The card may be always present on the board, and for these cases neither
a status callback nor a card detect GPIO is required, and card detection
polling can be disabled.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/mmci.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index a922a0028836..fd89d9230928 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -589,9 +589,12 @@ static int mmci_get_cd(struct mmc_host *mmc) | |||
589 | struct mmci_platform_data *plat = host->plat; | 589 | struct mmci_platform_data *plat = host->plat; |
590 | unsigned int status; | 590 | unsigned int status; |
591 | 591 | ||
592 | if (host->gpio_cd == -ENOSYS) | 592 | if (host->gpio_cd == -ENOSYS) { |
593 | if (!plat->status) | ||
594 | return 1; /* Assume always present */ | ||
595 | |||
593 | status = plat->status(mmc_dev(host->mmc)); | 596 | status = plat->status(mmc_dev(host->mmc)); |
594 | else | 597 | } else |
595 | status = !!gpio_get_value(host->gpio_cd) ^ plat->cd_invert; | 598 | status = !!gpio_get_value(host->gpio_cd) ^ plat->cd_invert; |
596 | 599 | ||
597 | /* | 600 | /* |
@@ -787,7 +790,8 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) | |||
787 | goto err_gpio_wp; | 790 | goto err_gpio_wp; |
788 | } | 791 | } |
789 | 792 | ||
790 | if (host->gpio_cd_irq < 0) | 793 | if ((host->plat->status || host->gpio_cd != -ENOSYS) |
794 | && host->gpio_cd_irq < 0) | ||
791 | mmc->caps |= MMC_CAP_NEEDS_POLL; | 795 | mmc->caps |= MMC_CAP_NEEDS_POLL; |
792 | 796 | ||
793 | ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host); | 797 | ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host); |