aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9baf0e7..877079e778cd 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -654,9 +654,29 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
654 654
655 /* The ST Micro variants has a special bit to enable SDIO */ 655 /* The ST Micro variants has a special bit to enable SDIO */
656 if (variant->sdio && host->mmc->card) 656 if (variant->sdio && host->mmc->card)
657 if (mmc_card_sdio(host->mmc->card)) 657 if (mmc_card_sdio(host->mmc->card)) {
658 /*
659 * The ST Micro variants has a special bit
660 * to enable SDIO.
661 */
662 u32 clk;
663
658 datactrl |= MCI_ST_DPSM_SDIOEN; 664 datactrl |= MCI_ST_DPSM_SDIOEN;
659 665
666 /*
667 * The ST Micro variant for SDIO transfer sizes
668 * less then 8 bytes should have clock H/W flow
669 * control disabled.
670 */
671 if ((host->size < 8) &&
672 (data->flags & MMC_DATA_WRITE))
673 clk = host->clk_reg & ~variant->clkreg_enable;
674 else
675 clk = host->clk_reg | variant->clkreg_enable;
676
677 mmci_write_clkreg(host, clk);
678 }
679
660 /* 680 /*
661 * Attempt to use DMA operation mode, if this 681 * Attempt to use DMA operation mode, if this
662 * should fail, fall back to PIO mode 682 * should fail, fall back to PIO mode
@@ -877,22 +897,6 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem
877 count = min(remain, maxcnt); 897 count = min(remain, maxcnt);
878 898
879 /* 899 /*
880 * The ST Micro variant for SDIO transfer sizes
881 * less then 8 bytes should have clock H/W flow
882 * control disabled.
883 */
884 if (variant->sdio &&
885 mmc_card_sdio(host->mmc->card)) {
886 u32 clk;
887 if (count < 8)
888 clk = host->clk_reg & ~variant->clkreg_enable;
889 else
890 clk = host->clk_reg | variant->clkreg_enable;
891
892 mmci_write_clkreg(host, clk);
893 }
894
895 /*
896 * SDIO especially may want to send something that is 900 * SDIO especially may want to send something that is
897 * not divisible by 4 (as opposed to card sectors 901 * not divisible by 4 (as opposed to card sectors
898 * etc), and the FIFO only accept full 32-bit writes. 902 * etc), and the FIFO only accept full 32-bit writes.