@@ -18,6 +18,7 @@
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sdio.h>
@@ -878,6 +879,20 @@ static int esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
return esdhc_change_pinstate(host, uhs);
}
+static void esdhc_init_card_type(struct sdhci_host *host, struct mmc_card *card)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct pltfm_imx_data *imx_data = pltfm_host->priv;
+ struct mmc_host *mmc = host->mmc;
+
+ if (imx_data->socdata->flags & ESDHC_FLAG_ENGCM07207) {
+ if (card->type == MMC_TYPE_SDIO)
+ mmc->max_blk_count = 65535;
+ else
+ mmc->max_blk_count = 1;
+ }
+}
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = esdhc_readl_le,
.read_w = esdhc_readw_le,
@@ -890,6 +905,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_ro = esdhc_pltfm_get_ro,
.platform_bus_width = esdhc_pltfm_bus_width,
.set_uhs_signaling = esdhc_set_uhs_signaling,
+ .card_type_init = esdhc_init_card_type,
};
static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
At least the i.MX35 (there may be others) currently implements a quirk to turn of multiblock transfers for the esdhc host. According to the errata this is only true for SD cards and NOT for sdio cards. When the sdio driver initializes the card, it knows the type of card we actually have. So now the sdhci-esdhc-imx could decide based on card type if multiblock transfers should be used or not. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> --- drivers/mmc/host/sdhci-esdhc-imx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)