From patchwork Wed Jun 29 11:23:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 928242 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5TBNxwK014966 for ; Wed, 29 Jun 2011 11:24:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755061Ab1F2LYD (ORCPT ); Wed, 29 Jun 2011 07:24:03 -0400 Received: from mga01.intel.com ([192.55.52.88]:64578 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755046Ab1F2LYB (ORCPT ); Wed, 29 Jun 2011 07:24:01 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 29 Jun 2011 04:24:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,442,1304319600"; d="scan'208";a="21856612" Received: from unknown (HELO ahunter-desktop.localhost.com) ([10.255.17.88]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2011 04:23:58 -0700 From: Adrian Hunter To: Chris Ball Cc: linux-mmc , Philip Rakity , Major Lee , Alan Cox , Dirk Brandewie Subject: [PATCH 1/2] mmc: sdhci-pci: add 8-bit bus width support for mrst hc0 Date: Wed, 29 Jun 2011 14:23:46 +0300 Message-Id: <1309346627-32630-2-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1309346627-32630-1-git-send-email-adrian.hunter@intel.com> References: <1309346627-32630-1-git-send-email-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki 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.6 (demeter1.kernel.org [140.211.167.41]); Wed, 29 Jun 2011 11:24:04 +0000 (UTC) From: Major Lee And hook platform_8bit_width to support 8-bit bus width. Signed-off-by: Major Lee Signed-off-by: Alan Cox Signed-off-by: Dirk Brandewie --- drivers/mmc/host/sdhci-pci.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 936bbca..e1ae855 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -143,6 +143,12 @@ static const struct sdhci_pci_fixes sdhci_cafe = { SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, }; +static int mrst_hc_probe_slot(struct sdhci_pci_slot *slot) +{ + slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA; + return 0; +} + /* * ADMA operation is disabled for Moorestown platform due to * hardware bugs. @@ -159,6 +165,7 @@ static int mrst_hc_probe(struct sdhci_pci_chip *chip) static const struct sdhci_pci_fixes sdhci_intel_mrst_hc0 = { .quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_NO_HISPD_BIT, + .probe_slot = mrst_hc_probe_slot, }; static const struct sdhci_pci_fixes sdhci_intel_mrst_hc1_hc2 = { @@ -789,8 +796,34 @@ static int sdhci_pci_enable_dma(struct sdhci_host *host) return 0; } +static int sdhci_pci_8bit_width(struct sdhci_host *host, int width) +{ + u8 ctrl; + + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); + + switch (width) { + case MMC_BUS_WIDTH_8: + ctrl |= SDHCI_CTRL_8BITBUS; + ctrl &= ~SDHCI_CTRL_4BITBUS; + break; + case MMC_BUS_WIDTH_4: + ctrl |= SDHCI_CTRL_4BITBUS; + ctrl &= ~SDHCI_CTRL_8BITBUS; + break; + default: + ctrl &= ~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_4BITBUS); + break; + } + + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); + + return 0; +} + static struct sdhci_ops sdhci_pci_ops = { .enable_dma = sdhci_pci_enable_dma, + .platform_8bit_width = sdhci_pci_8bit_width, }; /*****************************************************************************\