From patchwork Tue Mar 18 08:31:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steffen Trumtrar X-Patchwork-Id: 3852611 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A5EE79F334 for ; Wed, 19 Mar 2014 17:38:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 556C82011B for ; Wed, 19 Mar 2014 17:38:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 773DB20176 for ; Wed, 19 Mar 2014 17:38:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753900AbaCRIbf (ORCPT ); Tue, 18 Mar 2014 04:31:35 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:35782 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754637AbaCRIb3 (ORCPT ); Tue, 18 Mar 2014 04:31:29 -0400 Received: from unicorn.hi.pengutronix.de ([2001:6f8:1178:2:a61f:72ff:fe69:16d]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WPpQm-0001V2-N7; Tue, 18 Mar 2014 09:31:28 +0100 Received: from str by unicorn.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1WPpQt-0003D7-LU; Tue, 18 Mar 2014 09:31:35 +0100 From: Steffen Trumtrar To: linux-mmc@vger.kernel.org Cc: Chris Ball , Dong Aisheng , Steffen Trumtrar Subject: [PATCH 2/2] sdhci: imx: add callback for card_type inits Date: Tue, 18 Mar 2014 09:31:30 +0100 Message-Id: <1395131490-11919-2-git-send-email-s.trumtrar@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395131490-11919-1-git-send-email-s.trumtrar@pengutronix.de> References: <1395131490-11919-1-git-send-email-s.trumtrar@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:a61f:72ff:fe69:16d X-SA-Exim-Mail-From: str@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include #include +#include #include #include #include @@ -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 = {