From patchwork Mon Nov 8 11:48:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 308142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA8BmYQJ024241 for ; Mon, 8 Nov 2010 11:48:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754542Ab0KHLse (ORCPT ); Mon, 8 Nov 2010 06:48:34 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:39423 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754497Ab0KHLsd convert rfc822-to-8bit (ORCPT ); Mon, 8 Nov 2010 06:48:33 -0500 Received: by fxm16 with SMTP id 16so3908962fxm.19 for ; Mon, 08 Nov 2010 03:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=7qBUR67uWdW4+dvhKvBC+z+nmbU0IPppxOBXdrmRQxo=; b=cJ2a9bQzR4C3Xr6CZTNlTeL80tFDOWdQWmw4xJDhkaThvQAkHpdxkxzJGj+TKoMLJL ZGofru75I0bwQmPREMNb4rnhUShjB1B8up8CrUQrJkENP4Qy6n+eR8qwrKRc4/a1GKln B0znpeI9OzS7JgdQjqxp+2YOFTSmO1nGVbSoU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uvJ7YyceFqExWNwPznr9T/8oguN1i7YGp5Hd0Pe6UKmboC3eJKs9bT+KYGacfIP/PW rXF1Ty5dbDjUkCpW6b0oLSTNOZLumEOefEVHFFTirLsJLwfeouVfEKcfE5t1Hw++hC8Y PK9lkjW1ziaPYeQJqtG3oGtRjAr6/JgUUJlBI= MIME-Version: 1.0 Received: by 10.223.116.69 with SMTP id l5mr3664488faq.129.1289216912282; Mon, 08 Nov 2010 03:48:32 -0800 (PST) Received: by 10.223.1.80 with HTTP; Mon, 8 Nov 2010 03:48:32 -0800 (PST) In-Reply-To: <20101108091754.GA8638@pengutronix.de> References: <74C0C915-257F-41CC-AEA8-C6F5B839586B@marvell.com> <20101107220411.GB5376@pengutronix.de> <20101108091754.GA8638@pengutronix.de> Date: Mon, 8 Nov 2010 06:48:32 -0500 Message-ID: Subject: Re: [PATCH] sdhci: 8 bit widths - allow new QUIRK for 8 bit and v3 sd controller From: zhangfei gao To: Wolfram Sang , Philip Rakity Cc: "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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Nov 2010 11:48:35 +0000 (UTC) diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h b/arch/arm/plat-pxa/include/plat/sdhci.h index e49c5b6..661dc48 100644 --- a/arch/arm/plat-pxa/include/plat/sdhci.h +++ b/arch/arm/plat-pxa/include/plat/sdhci.h @@ -16,6 +16,8 @@ /* pxa specific flag */ /* Require clock free running */ #define PXA_FLAG_DISABLE_CLOCK_GATING (1<<0) +#define PXA_FLAG_FORCE_1_BIT_DATA (1<<2) +#define PXA_FLAG_CAN_DO_8_BIT_DATA (1<<3) /* * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c index fc406ac..3d63a37 100644 --- a/drivers/mmc/host/sdhci-pxa.c +++ b/drivers/mmc/host/sdhci-pxa.c @@ -147,6 +147,11 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev) goto out; } + if (pxa->pdata->flags & PXA_FLAG_FORCE_1_BIT_DATA) + host->mmc->caps &= ~(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); + if (pxa->pdata->flags & PXA_FLAG_CAN_DO_8_BIT_DATA) + host->mmc->caps |= MMC_CAP_8_BIT_DATA; + if (pxa->pdata->max_speed) host->mmc->f_max = pxa->pdata->max_speed; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 154cbf8..2628ec2 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1858,9 +1858,6 @@ 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 (caps & SDHCI_CAN_DO_HISPD) mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1fdc673..ede02a4 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -67,8 +67,6 @@ struct sdhci_host { #define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20) /* Controller cannot do multi-block transfers */ #define SDHCI_QUIRK_NO_MULTIBLOCK (1<<21) -/* Controller can only handle 1-bit data transfers */ -#define SDHCI_QUIRK_FORCE_1_BIT_DATA (1<<22) /* Controller needs 10ms delay between applying power and clock */ #define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23) /* Controller uses SDCLK instead of TMCLK for data timeouts */