diff options
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 96004c9fe3a5..a7ee50271465 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -1729,17 +1729,9 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id) | |||
1729 | tasklet_schedule(&host->tasklet); | 1729 | tasklet_schedule(&host->tasklet); |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | if (pending & ATMCI_ENDTX) { | ||
1733 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDTX); | ||
1734 | if (host->data_size) { | ||
1735 | atmci_pdc_set_single_buf(host, | ||
1736 | XFER_TRANSMIT, PDC_SECOND_BUF); | ||
1737 | atmci_writel(host, ATMCI_IER, ATMCI_ENDTX); | ||
1738 | } | ||
1739 | } | ||
1740 | |||
1741 | if (pending & ATMCI_TXBUFE) { | 1732 | if (pending & ATMCI_TXBUFE) { |
1742 | atmci_writel(host, ATMCI_IDR, ATMCI_TXBUFE); | 1733 | atmci_writel(host, ATMCI_IDR, ATMCI_TXBUFE); |
1734 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDTX); | ||
1743 | /* | 1735 | /* |
1744 | * We can receive this interruption before having configured | 1736 | * We can receive this interruption before having configured |
1745 | * the second pdc buffer, so we need to reconfigure first and | 1737 | * the second pdc buffer, so we need to reconfigure first and |
@@ -1747,24 +1739,24 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id) | |||
1747 | */ | 1739 | */ |
1748 | if (host->data_size) { | 1740 | if (host->data_size) { |
1749 | atmci_pdc_set_both_buf(host, XFER_TRANSMIT); | 1741 | atmci_pdc_set_both_buf(host, XFER_TRANSMIT); |
1742 | atmci_writel(host, ATMCI_IER, ATMCI_ENDTX); | ||
1750 | atmci_writel(host, ATMCI_IER, ATMCI_TXBUFE); | 1743 | atmci_writel(host, ATMCI_IER, ATMCI_TXBUFE); |
1751 | } else { | 1744 | } else { |
1752 | atmci_pdc_complete(host); | 1745 | atmci_pdc_complete(host); |
1753 | } | 1746 | } |
1754 | } | 1747 | } else if (pending & ATMCI_ENDTX) { |
1755 | 1748 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDTX); | |
1756 | if (pending & ATMCI_ENDRX) { | ||
1757 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDRX); | ||
1758 | 1749 | ||
1759 | if (host->data_size) { | 1750 | if (host->data_size) { |
1760 | atmci_pdc_set_single_buf(host, | 1751 | atmci_pdc_set_single_buf(host, |
1761 | XFER_RECEIVE, PDC_SECOND_BUF); | 1752 | XFER_TRANSMIT, PDC_SECOND_BUF); |
1762 | atmci_writel(host, ATMCI_IER, ATMCI_ENDRX); | 1753 | atmci_writel(host, ATMCI_IER, ATMCI_ENDTX); |
1763 | } | 1754 | } |
1764 | } | 1755 | } |
1765 | 1756 | ||
1766 | if (pending & ATMCI_RXBUFF) { | 1757 | if (pending & ATMCI_RXBUFF) { |
1767 | atmci_writel(host, ATMCI_IDR, ATMCI_RXBUFF); | 1758 | atmci_writel(host, ATMCI_IDR, ATMCI_RXBUFF); |
1759 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDRX); | ||
1768 | /* | 1760 | /* |
1769 | * We can receive this interruption before having configured | 1761 | * We can receive this interruption before having configured |
1770 | * the second pdc buffer, so we need to reconfigure first and | 1762 | * the second pdc buffer, so we need to reconfigure first and |
@@ -1772,12 +1764,22 @@ static irqreturn_t atmci_interrupt(int irq, void *dev_id) | |||
1772 | */ | 1764 | */ |
1773 | if (host->data_size) { | 1765 | if (host->data_size) { |
1774 | atmci_pdc_set_both_buf(host, XFER_RECEIVE); | 1766 | atmci_pdc_set_both_buf(host, XFER_RECEIVE); |
1767 | atmci_writel(host, ATMCI_IER, ATMCI_ENDRX); | ||
1775 | atmci_writel(host, ATMCI_IER, ATMCI_RXBUFF); | 1768 | atmci_writel(host, ATMCI_IER, ATMCI_RXBUFF); |
1776 | } else { | 1769 | } else { |
1777 | atmci_pdc_complete(host); | 1770 | atmci_pdc_complete(host); |
1778 | } | 1771 | } |
1772 | } else if (pending & ATMCI_ENDRX) { | ||
1773 | atmci_writel(host, ATMCI_IDR, ATMCI_ENDRX); | ||
1774 | |||
1775 | if (host->data_size) { | ||
1776 | atmci_pdc_set_single_buf(host, | ||
1777 | XFER_RECEIVE, PDC_SECOND_BUF); | ||
1778 | atmci_writel(host, ATMCI_IER, ATMCI_ENDRX); | ||
1779 | } | ||
1779 | } | 1780 | } |
1780 | 1781 | ||
1782 | |||
1781 | if (pending & ATMCI_NOTBUSY) { | 1783 | if (pending & ATMCI_NOTBUSY) { |
1782 | atmci_writel(host, ATMCI_IDR, | 1784 | atmci_writel(host, ATMCI_IDR, |
1783 | ATMCI_DATA_ERROR_FLAGS | ATMCI_NOTBUSY); | 1785 | ATMCI_DATA_ERROR_FLAGS | ATMCI_NOTBUSY); |