mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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>
This commit is contained in:
parent
df456f479a
commit
5d3ad4e8a1
2 changed files with 24 additions and 5 deletions
|
@ -309,6 +309,10 @@ static irqreturn_t pxamci_irq(int irq, void *devid)
|
||||||
handled |= pxamci_cmd_done(host, stat);
|
handled |= pxamci_cmd_done(host, stat);
|
||||||
if (ireg & DATA_TRAN_DONE)
|
if (ireg & DATA_TRAN_DONE)
|
||||||
handled |= pxamci_data_done(host, stat);
|
handled |= pxamci_data_done(host, stat);
|
||||||
|
if (ireg & SDIO_INT) {
|
||||||
|
mmc_signal_sdio_irq(host->mmc);
|
||||||
|
handled = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRQ_RETVAL(handled);
|
return IRQ_RETVAL(handled);
|
||||||
|
@ -391,10 +395,21 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
|
||||||
host->clkrt, host->cmdat);
|
host->clkrt, host->cmdat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable)
|
||||||
|
{
|
||||||
|
struct pxamci_host *pxa_host = mmc_priv(host);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
pxamci_enable_irq(pxa_host, SDIO_INT);
|
||||||
|
else
|
||||||
|
pxamci_disable_irq(pxa_host, SDIO_INT);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct mmc_host_ops pxamci_ops = {
|
static const struct mmc_host_ops pxamci_ops = {
|
||||||
.request = pxamci_request,
|
.request = pxamci_request,
|
||||||
.get_ro = pxamci_get_ro,
|
.get_ro = pxamci_get_ro,
|
||||||
.set_ios = pxamci_set_ios,
|
.set_ios = pxamci_set_ios,
|
||||||
|
.enable_sdio_irq = pxamci_enable_sdio_irq,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pxamci_dma_irq(int dma, void *devid)
|
static void pxamci_dma_irq(int dma, void *devid)
|
||||||
|
@ -466,8 +481,11 @@ static int pxamci_probe(struct platform_device *pdev)
|
||||||
host->pdata->ocr_mask :
|
host->pdata->ocr_mask :
|
||||||
MMC_VDD_32_33|MMC_VDD_33_34;
|
MMC_VDD_32_33|MMC_VDD_33_34;
|
||||||
mmc->caps = 0;
|
mmc->caps = 0;
|
||||||
if (!cpu_is_pxa21x() && !cpu_is_pxa25x())
|
host->cmdat = 0;
|
||||||
mmc->caps |= MMC_CAP_4_BIT_DATA;
|
if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) {
|
||||||
|
mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
|
||||||
|
host->cmdat |= CMDAT_SDIO_INT_EN;
|
||||||
|
}
|
||||||
|
|
||||||
host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
|
host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
|
||||||
if (!host->sg_cpu) {
|
if (!host->sg_cpu) {
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#define SPI_EN (1 << 0)
|
#define SPI_EN (1 << 0)
|
||||||
|
|
||||||
#define MMC_CMDAT 0x0010
|
#define MMC_CMDAT 0x0010
|
||||||
|
#define CMDAT_SDIO_INT_EN (1 << 11)
|
||||||
#define CMDAT_SD_4DAT (1 << 8)
|
#define CMDAT_SD_4DAT (1 << 8)
|
||||||
#define CMDAT_DMAEN (1 << 7)
|
#define CMDAT_DMAEN (1 << 7)
|
||||||
#define CMDAT_INIT (1 << 6)
|
#define CMDAT_INIT (1 << 6)
|
||||||
|
|
Loading…
Reference in a new issue