aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2010-05-26 17:41:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:39 -0400
commit99ddffd8ef84c0389e31cb4b90d9e5415ea19cb0 (patch)
tree75821d731ab191fd5d1475e83e955397b6ce6c6a /drivers/mmc
parent6dd6bca3fb6d4f186cdc67ba9e3949ef456dcc53 (diff)
mmc: atmel-mci: enable SD high speed support
Enable high speed support for atmel-mci driver. This support is dependent of the revision of the IP and, of course, the capacity of the SD card used. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reviewed-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Maciej Sosnowski <maciej.sosnowski@intel.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/atmel-mci.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index df0e8a88d85f..f6013ccbc619 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -952,10 +952,21 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
952 if (mci_has_rwproof()) 952 if (mci_has_rwproof())
953 host->mode_reg |= (MCI_MR_WRPROOF | MCI_MR_RDPROOF); 953 host->mode_reg |= (MCI_MR_WRPROOF | MCI_MR_RDPROOF);
954 954
955 if (list_empty(&host->queue)) 955 if (atmci_is_mci2()) {
956 /* setup High Speed mode in relation with card capacity */
957 if (ios->timing == MMC_TIMING_SD_HS)
958 host->cfg_reg |= MCI_CFG_HSMODE;
959 else
960 host->cfg_reg &= ~MCI_CFG_HSMODE;
961 }
962
963 if (list_empty(&host->queue)) {
956 mci_writel(host, MR, host->mode_reg); 964 mci_writel(host, MR, host->mode_reg);
957 else 965 if (atmci_is_mci2())
966 mci_writel(host, CFG, host->cfg_reg);
967 } else {
958 host->need_clock_update = true; 968 host->need_clock_update = true;
969 }
959 970
960 spin_unlock_bh(&host->lock); 971 spin_unlock_bh(&host->lock);
961 } else { 972 } else {
@@ -1052,8 +1063,11 @@ static void atmci_request_end(struct atmel_mci *host, struct mmc_request *mrq)
1052 * necessary if set_ios() is called when a different slot is 1063 * necessary if set_ios() is called when a different slot is
1053 * busy transfering data. 1064 * busy transfering data.
1054 */ 1065 */
1055 if (host->need_clock_update) 1066 if (host->need_clock_update) {
1056 mci_writel(host, MR, host->mode_reg); 1067 mci_writel(host, MR, host->mode_reg);
1068 if (atmci_is_mci2())
1069 mci_writel(host, CFG, host->cfg_reg);
1070 }
1057 1071
1058 host->cur_slot->mrq = NULL; 1072 host->cur_slot->mrq = NULL;
1059 host->mrq = NULL; 1073 host->mrq = NULL;
@@ -1565,6 +1579,8 @@ static int __init atmci_init_slot(struct atmel_mci *host,
1565 mmc->f_min = DIV_ROUND_UP(host->bus_hz, 512); 1579 mmc->f_min = DIV_ROUND_UP(host->bus_hz, 512);
1566 mmc->f_max = host->bus_hz / 2; 1580 mmc->f_max = host->bus_hz / 2;
1567 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; 1581 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
1582 if (atmci_is_mci2())
1583 mmc->caps |= MMC_CAP_SD_HIGHSPEED;
1568 if (slot_data->bus_width >= 4) 1584 if (slot_data->bus_width >= 4)
1569 mmc->caps |= MMC_CAP_4_BIT_DATA; 1585 mmc->caps |= MMC_CAP_4_BIT_DATA;
1570 1586