diff options
author | Bridge Wu <mingqiao.wu@gmail.com> | 2007-09-25 13:11:00 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-09-25 13:11:49 -0400 |
commit | 5d3ad4e8a12e538eead0a37d22b1ba6aec0f2127 (patch) | |
tree | cb1d543cb7c7304188b002dd12cca9eb61c05c5a /drivers/mmc | |
parent | df456f479aa6fdc812df51627c6f2c21d8a1aed8 (diff) |
mmc: pxamci: add SDIO card interrupt reporting capability
Again, only available from PXA27x.
Signed-off-by: Bridge Wu <mingqiao.wu@gmail.com>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/pxamci.c | 28 | ||||
-rw-r--r-- | drivers/mmc/host/pxamci.h | 1 |
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 6549f546df55..91e25683b397 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
@@ -309,6 +309,10 @@ static irqreturn_t pxamci_irq(int irq, void *devid) | |||
309 | handled |= pxamci_cmd_done(host, stat); | 309 | handled |= pxamci_cmd_done(host, stat); |
310 | if (ireg & DATA_TRAN_DONE) | 310 | if (ireg & DATA_TRAN_DONE) |
311 | handled |= pxamci_data_done(host, stat); | 311 | handled |= pxamci_data_done(host, stat); |
312 | if (ireg & SDIO_INT) { | ||
313 | mmc_signal_sdio_irq(host->mmc); | ||
314 | handled = 1; | ||
315 | } | ||
312 | } | 316 | } |
313 | 317 | ||
314 | return IRQ_RETVAL(handled); | 318 | return IRQ_RETVAL(handled); |
@@ -391,10 +395,21 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
391 | host->clkrt, host->cmdat); | 395 | host->clkrt, host->cmdat); |
392 | } | 396 | } |
393 | 397 | ||
398 | static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable) | ||
399 | { | ||
400 | struct pxamci_host *pxa_host = mmc_priv(host); | ||
401 | |||
402 | if (enable) | ||
403 | pxamci_enable_irq(pxa_host, SDIO_INT); | ||
404 | else | ||
405 | pxamci_disable_irq(pxa_host, SDIO_INT); | ||
406 | } | ||
407 | |||
394 | static const struct mmc_host_ops pxamci_ops = { | 408 | static const struct mmc_host_ops pxamci_ops = { |
395 | .request = pxamci_request, | 409 | .request = pxamci_request, |
396 | .get_ro = pxamci_get_ro, | 410 | .get_ro = pxamci_get_ro, |
397 | .set_ios = pxamci_set_ios, | 411 | .set_ios = pxamci_set_ios, |
412 | .enable_sdio_irq = pxamci_enable_sdio_irq, | ||
398 | }; | 413 | }; |
399 | 414 | ||
400 | static void pxamci_dma_irq(int dma, void *devid) | 415 | static void pxamci_dma_irq(int dma, void *devid) |
@@ -466,8 +481,11 @@ static int pxamci_probe(struct platform_device *pdev) | |||
466 | host->pdata->ocr_mask : | 481 | host->pdata->ocr_mask : |
467 | MMC_VDD_32_33|MMC_VDD_33_34; | 482 | MMC_VDD_32_33|MMC_VDD_33_34; |
468 | mmc->caps = 0; | 483 | mmc->caps = 0; |
469 | if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) | 484 | host->cmdat = 0; |
470 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 485 | if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) { |
486 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; | ||
487 | host->cmdat |= CMDAT_SDIO_INT_EN; | ||
488 | } | ||
471 | 489 | ||
472 | host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); | 490 | host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); |
473 | if (!host->sg_cpu) { | 491 | if (!host->sg_cpu) { |
diff --git a/drivers/mmc/host/pxamci.h b/drivers/mmc/host/pxamci.h index 5655be823a00..3153e779d46a 100644 --- a/drivers/mmc/host/pxamci.h +++ b/drivers/mmc/host/pxamci.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define SPI_EN (1 << 0) | 25 | #define SPI_EN (1 << 0) |
26 | 26 | ||
27 | #define MMC_CMDAT 0x0010 | 27 | #define MMC_CMDAT 0x0010 |
28 | #define CMDAT_SDIO_INT_EN (1 << 11) | ||
28 | #define CMDAT_SD_4DAT (1 << 8) | 29 | #define CMDAT_SD_4DAT (1 << 8) |
29 | #define CMDAT_DMAEN (1 << 7) | 30 | #define CMDAT_DMAEN (1 << 7) |
30 | #define CMDAT_INIT (1 << 6) | 31 | #define CMDAT_INIT (1 << 6) |