aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/dw_mmc.c22
-rw-r--r--include/linux/mmc/dw_mmc.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 94ec6502bdde..51ee2f5909d4 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1639,8 +1639,9 @@ static int dw_mci_probe(struct platform_device *pdev)
1639 */ 1639 */
1640 fifo_size = mci_readl(host, FIFOTH); 1640 fifo_size = mci_readl(host, FIFOTH);
1641 fifo_size = (fifo_size >> 16) & 0x7ff; 1641 fifo_size = (fifo_size >> 16) & 0x7ff;
1642 mci_writel(host, FIFOTH, ((0x2 << 28) | ((fifo_size/2 - 1) << 16) | 1642 host->fifoth_val = ((0x2 << 28) | ((fifo_size/2 - 1) << 16) |
1643 ((fifo_size/2) << 0))); 1643 ((fifo_size/2) << 0));
1644 mci_writel(host, FIFOTH, host->fifoth_val);
1644 1645
1645 /* disable clock to CIU */ 1646 /* disable clock to CIU */
1646 mci_writel(host, CLKENA, 0); 1647 mci_writel(host, CLKENA, 0);
@@ -1772,6 +1773,23 @@ static int dw_mci_resume(struct platform_device *pdev)
1772 int i, ret; 1773 int i, ret;
1773 struct dw_mci *host = platform_get_drvdata(pdev); 1774 struct dw_mci *host = platform_get_drvdata(pdev);
1774 1775
1776 if (host->dma_ops->init)
1777 host->dma_ops->init(host);
1778
1779 if (!mci_wait_reset(&pdev->dev, host)) {
1780 ret = -ENODEV;
1781 return ret;
1782 }
1783
1784 /* Restore the old value at FIFOTH register */
1785 mci_writel(host, FIFOTH, host->fifoth_val);
1786
1787 mci_writel(host, RINTSTS, 0xFFFFFFFF);
1788 mci_writel(host, INTMASK, SDMMC_INT_CMD_DONE | SDMMC_INT_DATA_OVER |
1789 SDMMC_INT_TXDR | SDMMC_INT_RXDR |
1790 DW_MCI_ERROR_FLAGS | SDMMC_INT_CD);
1791 mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE);
1792
1775 for (i = 0; i < host->num_slots; i++) { 1793 for (i = 0; i < host->num_slots; i++) {
1776 struct dw_mci_slot *slot = host->slot[i]; 1794 struct dw_mci_slot *slot = host->slot[i];
1777 if (!slot) 1795 if (!slot)
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index f08163198877..6c324de20de2 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -140,6 +140,7 @@ struct dw_mci {
140 u32 bus_hz; 140 u32 bus_hz;
141 u32 current_speed; 141 u32 current_speed;
142 u32 num_slots; 142 u32 num_slots;
143 u32 fifoth_val;
143 struct platform_device *pdev; 144 struct platform_device *pdev;
144 struct dw_mci_board *pdata; 145 struct dw_mci_board *pdata;
145 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 146 struct dw_mci_slot *slot[MAX_MCI_SLOTS];