aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2011-02-24 21:08:15 -0500
committerChris Ball <cjb@laptop.org>2011-03-17 15:35:18 -0400
commitfc3d7720541d4b70cbae25ac121d7e6343125090 (patch)
treef1ca22f9e6363c2ddfc84dfdc6e4992299e4f93a /drivers/mmc
parent860cfe796c793bfad1e666de9600852f2d653c57 (diff)
mmc: dw_mmc: add quirks for unreliable card detect, and capabilities
This patch adds quirks and capabilities to platdata. Some cards don't use the CDn pin; in that case, we assume the card's inserted. Some boards need other capabilities. So, we add capabilities in the board's platdata. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 299c1d61b6b..94ec6502bdd 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -729,7 +729,9 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
729 struct dw_mci_board *brd = slot->host->pdata; 729 struct dw_mci_board *brd = slot->host->pdata;
730 730
731 /* Use platform get_cd function, else try onboard card detect */ 731 /* Use platform get_cd function, else try onboard card detect */
732 if (brd->get_cd) 732 if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
733 present = 1;
734 else if (brd->get_cd)
733 present = !brd->get_cd(slot->id); 735 present = !brd->get_cd(slot->id);
734 else 736 else
735 present = (mci_readl(slot->host, CDETECT) & (1 << slot->id)) 737 present = (mci_readl(slot->host, CDETECT) & (1 << slot->id))
@@ -1403,7 +1405,11 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
1403 if (host->pdata->setpower) 1405 if (host->pdata->setpower)
1404 host->pdata->setpower(id, 0); 1406 host->pdata->setpower(id, 0);
1405 1407
1406 mmc->caps = 0; 1408 if (host->pdata->caps)
1409 mmc->caps = host->pdata->caps;
1410 else
1411 mmc->caps = 0;
1412
1407 if (host->pdata->get_bus_wd) 1413 if (host->pdata->get_bus_wd)
1408 if (host->pdata->get_bus_wd(slot->id) >= 4) 1414 if (host->pdata->get_bus_wd(slot->id) >= 4)
1409 mmc->caps |= MMC_CAP_4_BIT_DATA; 1415 mmc->caps |= MMC_CAP_4_BIT_DATA;