diff options
author | Sahitya Tummala <stummala@codeaurora.org> | 2011-05-02 08:39:18 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 15:43:37 -0400 |
commit | 4a268e0879c4044523757b6ac94b56fc7955a116 (patch) | |
tree | 3397cdc9c1d95b215e6094e1629fc3a4e4c1ae30 /drivers/mmc | |
parent | 4a92fe80becbbee650cfad8457ad0e5cd97ed974 (diff) |
mmc: msm_sdcc: Use MCI_INT_MASK0 for PIO interrupts
Not all targets have IRQ1 line routed from the SD controller to
the processor. So we cannot rely on IRQ1 for PIO interrupts.
This patch moves all PIO interrupts to IRQ0 and enables the PIO
mode.
Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/msm_sdcc.c | 20 | ||||
-rw-r--r-- | drivers/mmc/host/msm_sdcc.h | 5 |
2 files changed, 21 insertions, 4 deletions
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c index 1f1eff9bda52..c405e93335e2 100644 --- a/drivers/mmc/host/msm_sdcc.c +++ b/drivers/mmc/host/msm_sdcc.c | |||
@@ -213,7 +213,8 @@ msmsdcc_dma_exec_func(struct msm_dmov_cmd *cmd) | |||
213 | msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER); | 213 | msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER); |
214 | msmsdcc_writel(host, (unsigned int)host->curr.xfer_size, | 214 | msmsdcc_writel(host, (unsigned int)host->curr.xfer_size, |
215 | MMCIDATALENGTH); | 215 | MMCIDATALENGTH); |
216 | msmsdcc_writel(host, host->cmd_pio_irqmask, MMCIMASK1); | 216 | msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) & |
217 | (~MCI_IRQ_PIO)) | host->cmd_pio_irqmask, MMCIMASK0); | ||
217 | msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL); | 218 | msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL); |
218 | 219 | ||
219 | if (host->cmd_cmd) { | 220 | if (host->cmd_cmd) { |
@@ -543,7 +544,9 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data, | |||
543 | 544 | ||
544 | msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH); | 545 | msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH); |
545 | 546 | ||
546 | msmsdcc_writel(host, pio_irqmask, MMCIMASK1); | 547 | msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) & |
548 | (~MCI_IRQ_PIO)) | pio_irqmask, MMCIMASK0); | ||
549 | |||
547 | msmsdcc_writel(host, datactrl, MMCIDATACTRL); | 550 | msmsdcc_writel(host, datactrl, MMCIDATACTRL); |
548 | 551 | ||
549 | if (cmd) { | 552 | if (cmd) { |
@@ -659,8 +662,13 @@ msmsdcc_pio_irq(int irq, void *dev_id) | |||
659 | { | 662 | { |
660 | struct msmsdcc_host *host = dev_id; | 663 | struct msmsdcc_host *host = dev_id; |
661 | uint32_t status; | 664 | uint32_t status; |
665 | u32 mci_mask0; | ||
662 | 666 | ||
663 | status = msmsdcc_readl(host, MMCISTATUS); | 667 | status = msmsdcc_readl(host, MMCISTATUS); |
668 | mci_mask0 = msmsdcc_readl(host, MMCIMASK0); | ||
669 | |||
670 | if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0) | ||
671 | return IRQ_NONE; | ||
664 | 672 | ||
665 | do { | 673 | do { |
666 | unsigned long flags; | 674 | unsigned long flags; |
@@ -719,10 +727,12 @@ msmsdcc_pio_irq(int irq, void *dev_id) | |||
719 | } while (1); | 727 | } while (1); |
720 | 728 | ||
721 | if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE) | 729 | if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE) |
722 | msmsdcc_writel(host, MCI_RXDATAAVLBLMASK, MMCIMASK1); | 730 | msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | |
731 | MCI_RXDATAAVLBLMASK, MMCIMASK0); | ||
723 | 732 | ||
724 | if (!host->curr.xfer_remain) | 733 | if (!host->curr.xfer_remain) |
725 | msmsdcc_writel(host, 0, MMCIMASK1); | 734 | msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | 0, |
735 | MMCIMASK0); | ||
726 | 736 | ||
727 | return IRQ_HANDLED; | 737 | return IRQ_HANDLED; |
728 | } | 738 | } |
@@ -854,6 +864,8 @@ msmsdcc_irq(int irq, void *dev_id) | |||
854 | do { | 864 | do { |
855 | status = msmsdcc_readl(host, MMCISTATUS); | 865 | status = msmsdcc_readl(host, MMCISTATUS); |
856 | status &= msmsdcc_readl(host, MMCIMASK0); | 866 | status &= msmsdcc_readl(host, MMCIMASK0); |
867 | if ((status & (~MCI_IRQ_PIO)) == 0) | ||
868 | break; | ||
857 | msmsdcc_writel(host, status, MMCICLEAR); | 869 | msmsdcc_writel(host, status, MMCICLEAR); |
858 | 870 | ||
859 | if (status & MCI_SDIOINTR) | 871 | if (status & MCI_SDIOINTR) |
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h index fa626ed915a0..402028d16b86 100644 --- a/drivers/mmc/host/msm_sdcc.h +++ b/drivers/mmc/host/msm_sdcc.h | |||
@@ -140,6 +140,11 @@ | |||
140 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ | 140 | MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK| \ |
141 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK) | 141 | MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK) |
142 | 142 | ||
143 | #define MCI_IRQ_PIO \ | ||
144 | (MCI_RXDATAAVLBLMASK | MCI_TXDATAAVLBLMASK | MCI_RXFIFOEMPTYMASK | \ | ||
145 | MCI_TXFIFOEMPTYMASK | MCI_RXFIFOFULLMASK | MCI_TXFIFOFULLMASK | \ | ||
146 | MCI_RXFIFOHALFFULLMASK | MCI_TXFIFOHALFEMPTYMASK | \ | ||
147 | MCI_RXACTIVEMASK | MCI_TXACTIVEMASK) | ||
143 | /* | 148 | /* |
144 | * The size of the FIFO in bytes. | 149 | * The size of the FIFO in bytes. |
145 | */ | 150 | */ |