[PATCH 2/2] sdhci: imx: add callback for card_type inits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/mmc/host/sdhci-esdhc-imx.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index b841bb7..332eb00 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -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 = {
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux