@@ -24,6 +24,7 @@
#include <mach/iomux-mx51.h>
#include <mach/i2c.h>
#include <mach/mxc_ehci.h>
+#include <mach/mmc.h>
#include <asm/irq.h>
#include <asm/setup.h>
@@ -263,10 +264,12 @@ __setup("otg_mode=", babbage_otg_mode);
static struct esdhc_platform_data esdhc_imx_pdata1 = {
.wp_gpio = BABBAGE_SDHCI1_WP,
+ .caps = MMC_CAP_4_BIT_DATA,
};
static struct esdhc_platform_data esdhc_imx_pdata2 = {
.wp_gpio = BABBAGE_SDHCI2_WP,
+ .caps = MMC_CAP_4_BIT_DATA,
};
/*
@@ -12,5 +12,6 @@
struct esdhc_platform_data {
unsigned int wp_gpio; /* write protect pin */
+ unsigned int caps; /* hw board esdhc caps */
};
#endif /* __ASM_ARCH_IMX_ESDHC_H */
@@ -129,6 +129,7 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
if (boarddata) {
gpio_request(boarddata->wp_gpio, "SD_WP");
gpio_direction_input(boarddata->wp_gpio);
+ host->caps |= boarddata->caps;
}
return 0;
}
@@ -1848,8 +1848,12 @@ int sdhci_add_host(struct sdhci_host *host)
mmc->f_max = host->max_clk;
mmc->caps |= MMC_CAP_SDIO_IRQ;
- if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
- mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+ if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA)) {
+ if (host->caps & MMC_CAP_8_BIT_DATA)
+ mmc->caps |= MMC_CAP_8_BIT_DATA;
+ if (host->caps & MMC_CAP_4_BIT_DATA)
+ mmc->caps |= MMC_CAP_4_BIT_DATA;
+ }
if (caps & SDHCI_CAN_DO_HISPD)
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;