diff options
author | Pavan Kunapuli <pkunapuli@nvidia.com> | 2011-08-12 19:26:41 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-08-12 17:37:12 -0700 |
commit | 874bd6175fa154aa44d7f60a8404ad5ec0e4fad3 (patch) | |
tree | 364d526ea4c639d9c420da9ffe2b8351ad44d7d1 /drivers/mmc | |
parent | c34df94c603182403bccf7e3c00482db3c1204d1 (diff) |
mmc: sd: Add SDIO 3.0 async interrupt support
Added support for SDIO 3.0 asynchronous card
interrupt in 4-bit mode.
Bug 853800
Change-Id: If65bfe6ed2d663897037324b519484f77c35d3b5
Reviewed-on: http://git-master/r/46928
Tested-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/sdio.c | 19 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.c | 3 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 342bee5b390a..dca936fd696d 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -152,6 +152,12 @@ static int sdio_read_cccr(struct mmc_card *card) if (ret & SDIO_CCCR_IF_CAP_8BIT) card->cccr.wide_8bitbus = 1; #endif + ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INT_EXT, 0, &data); + if (ret) + goto out; + if(data & SDIO_INT_EXT_SAI) + card->cccr.async_intr = 1; + ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_UHS_SUPPORT, 0, &data); if (ret) goto out; @@ -199,6 +205,19 @@ static int sdio_enable_wide(struct mmc_card *card) else card->bus_width = SDIO_BUS_WIDTH_4BIT; + if (card->bus_width == SDIO_BUS_WIDTH_4BIT) { + if (card->cccr.async_intr && (card->host->caps & MMC_CAP_ASYNC_INT)) { + ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INT_EXT, 0, &ctrl); + if (ret) + return ret; + + ret |= SDIO_INT_EXT_EAI; + ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_INT_EXT, ctrl, NULL); + if (ret) + return ret; + } + } + return 1; } diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 73705888bd69..ec856504a2d9 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2084,6 +2084,9 @@ int sdhci_add_host(struct sdhci_host *host) return -ENODEV; } + if (caps & SDHCI_CAN_ASYNC_INT) + mmc->caps |= MMC_CAP_ASYNC_INT; + spin_lock_init(&host->lock); /* diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index e48e8d3cce0d..2f7fdce0c085 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -159,6 +159,7 @@ #define SDHCI_CAN_VDD_300 0x02000000 #define SDHCI_CAN_VDD_180 0x04000000 #define SDHCI_CAN_64BIT 0x10000000 +#define SDHCI_CAN_ASYNC_INT 0x20000000 #define SDHCI_HIGHER_CAPABILITIES 0x44 #define SDHCI_CAN_SUPPORT_SDR50 0x00000001 |