summaryrefslogtreecommitdiff
path: root/drivers/mmc/tegra2_mmc.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2012-01-13 20:05:47 +0100
committerWolfgang Denk <wd@denx.de>2012-01-13 20:05:47 +0100
commit6d7ba2cef52d6daf119269f06c471c8882e59b84 (patch)
tree94251571a5c2f6fdff10968ad6d76a2eb3ecc763 /drivers/mmc/tegra2_mmc.c
parentd0b8feef8b50335a58ffde7df3e6748adfaa7025 (diff)
parent8eee2bd7f484c4933c4e3112c3c3db886ac945ca (diff)
Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians: fsl_esdhc: fix PIO mode transfers mmc: tegra2: Implement card-detect hook. mmc: fsl_esdhc: Implement card-detect hook. mmc: Implement card detection. mmc: Change board_mmc_getcd() function prototype. drivers/mmc/mv_sdhci.c: Fix build warning ftsdc010: improve performance and capability mmc: add host_caps checking avoid switch card improperly i.mx: fsl_esdhc: add the i.mx6q support
Diffstat (limited to 'drivers/mmc/tegra2_mmc.c')
-rw-r--r--drivers/mmc/tegra2_mmc.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 035a8687df..5b4c9f69a1 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -474,6 +474,18 @@ static int mmc_core_init(struct mmc *mmc)
return 0;
}
+int tegra2_mmc_getcd(struct mmc *mmc)
+{
+ struct mmc_host *host = (struct mmc_host *)mmc->priv;
+
+ debug("tegra2_mmc_getcd called\n");
+
+ if (host->cd_gpio >= 0)
+ return !gpio_get_value(host->cd_gpio);
+
+ return 1;
+}
+
int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio)
{
struct mmc_host *host;
@@ -512,6 +524,7 @@ int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio)
mmc->send_cmd = mmc_send_cmd;
mmc->set_ios = mmc_set_ios;
mmc->init = mmc_core_init;
+ mmc->getcd = tegra2_mmc_getcd;
mmc->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
if (bus_width == 8)
@@ -535,22 +548,3 @@ int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio)
return 0;
}
-
-/* this is a weak define that we are overriding */
-int board_mmc_getcd(u8 *cd, struct mmc *mmc)
-{
- struct mmc_host *host = (struct mmc_host *)mmc->priv;
-
- debug("board_mmc_getcd called\n");
-
- *cd = 1; /* Assume card is inserted, or eMMC */
-
- if (IS_SD(mmc)) {
- if (host->cd_gpio >= 0) {
- if (gpio_get_value(host->cd_gpio))
- *cd = 0;
- }
- }
-
- return 0;
-}