From patchwork Fri Mar 18 22:11:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 645601 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 p2IMDLGl005861 for ; Fri, 18 Mar 2011 22:13:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932968Ab1CRWMv (ORCPT ); Fri, 18 Mar 2011 18:12:51 -0400 Received: from mail.atheros.com ([12.19.149.2]:44359 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932935Ab1CRWMS (ORCPT ); Fri, 18 Mar 2011 18:12:18 -0400 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Fri, 18 Mar 2011 15:11:54 -0700 Received: from tux (10.10.11.73) by SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.2.213.0; Fri, 18 Mar 2011 15:12:16 -0700 Received: by tux (sSMTP sendmail emulation); Fri, 18 Mar 2011 15:12:13 -0700 From: "Luis R. Rodriguez" To: CC: , , , , , , "Luis R. Rodriguez" , Naveen Singh , Vipin Mehta Subject: [RFC 3/4] sdhci: cache when the MMC bus width is 4 bits wide Date: Fri, 18 Mar 2011 15:11:59 -0700 Message-ID: <1300486320-23607-4-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.7.4.15.g7811d In-Reply-To: <1300486320-23607-1-git-send-email-lrodriguez@atheros.com> References: <1300486320-23607-1-git-send-email-lrodriguez@atheros.com> MIME-Version: 1.0 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]); Fri, 18 Mar 2011 22:13:21 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7074870..a4cf0c0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1206,10 +1206,13 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) } else { if (host->version >= SDHCI_SPEC_300) ctrl &= ~SDHCI_CTRL_8BITBUS; - if (ios->bus_width == MMC_BUS_WIDTH_4) + if (ios->bus_width == MMC_BUS_WIDTH_4) { ctrl |= SDHCI_CTRL_4BITBUS; - else + host->flags |= SDHCI_IN_4BIT_MODE; + } else { ctrl &= ~SDHCI_CTRL_4BITBUS; + host->flags &= ~SDHCI_IN_4BIT_MODE; + } } sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 83bd9f7..266f796 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -109,6 +109,7 @@ struct sdhci_host { #define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */ #define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */ #define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */ +#define SDHCI_IN_4BIT_MODE (1<<4) /* bus is in 4-bit mode */ unsigned int version; /* SDHCI spec. version */