Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bridge Wu and committed by
Pierre Ossman
5d3ad4e8 df456f47

+24 -5
+23 -5
drivers/mmc/host/pxamci.c
··· 309 309 handled |= pxamci_cmd_done(host, stat); 310 310 if (ireg & DATA_TRAN_DONE) 311 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 318 return IRQ_RETVAL(handled); ··· 395 391 host->clkrt, host->cmdat); 396 392 } 397 393 394 + static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable) 395 + { 396 + struct pxamci_host *pxa_host = mmc_priv(host); 397 + 398 + if (enable) 399 + pxamci_enable_irq(pxa_host, SDIO_INT); 400 + else 401 + pxamci_disable_irq(pxa_host, SDIO_INT); 402 + } 403 + 398 404 static const struct mmc_host_ops pxamci_ops = { 399 - .request = pxamci_request, 400 - .get_ro = pxamci_get_ro, 401 - .set_ios = pxamci_set_ios, 405 + .request = pxamci_request, 406 + .get_ro = pxamci_get_ro, 407 + .set_ios = pxamci_set_ios, 408 + .enable_sdio_irq = pxamci_enable_sdio_irq, 402 409 }; 403 410 404 411 static void pxamci_dma_irq(int dma, void *devid) ··· 481 466 host->pdata->ocr_mask : 482 467 MMC_VDD_32_33|MMC_VDD_33_34; 483 468 mmc->caps = 0; 484 - if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) 485 - mmc->caps |= MMC_CAP_4_BIT_DATA; 469 + host->cmdat = 0; 470 + if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) { 471 + mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; 472 + host->cmdat |= CMDAT_SDIO_INT_EN; 473 + } 486 474 487 475 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); 488 476 if (!host->sg_cpu) {
+1
drivers/mmc/host/pxamci.h
··· 25 25 #define SPI_EN (1 << 0) 26 26 27 27 #define MMC_CMDAT 0x0010 28 + #define CMDAT_SDIO_INT_EN (1 << 11) 28 29 #define CMDAT_SD_4DAT (1 << 8) 29 30 #define CMDAT_DMAEN (1 << 7) 30 31 #define CMDAT_INIT (1 << 6)