mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manuel Lauss <mano@roarinelk.homelinux.net>
To: linux-mips@linux-mips.org, sshtylyov@ru.mvista.com,
	drzeus@drzeus.cx, linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] au1xmmc: enable 4 bit transfer mode
Date: Mon, 9 Jun 2008 08:37:33 +0200	[thread overview]
Message-ID: <20080609063733.GD8724@roarinelk.homelinux.net> (raw)
In-Reply-To: <20080609063521.GA8724@roarinelk.homelinux.net>

>From f05df3bb70a64b2996e2c8f1591be35a351959c2 Mon Sep 17 00:00:00 2001
From: Manuel Lauss <mlau@msc-ge.com>
Date: Sat, 17 May 2008 17:53:57 +0200
Subject: [PATCH] au1xmmc: enable 4 bit transfer mode

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
---
 drivers/mmc/host/au1xmmc.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index d8776d6..2bd4cf4 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -95,14 +95,13 @@ static inline void IRQ_OFF(struct au1xmmc_host *host, u32 mask)
 
 static inline void SEND_STOP(struct au1xmmc_host *host)
 {
-
-	/* We know the value of CONFIG2, so avoid a read we don't need */
-	u32 mask = SD_CONFIG2_EN;
+	u32 config2;
 
 	WARN_ON(host->status != HOST_S_DATA);
 	host->status = HOST_S_STOP;
 
-	au_writel(mask | SD_CONFIG2_DF, HOST_CONFIG2(host));
+	config2 = au_readl(HOST_CONFIG2(host));
+	au_writel(config2 | SD_CONFIG2_DF, HOST_CONFIG2(host));
 	au_sync();
 
 	/* Send the stop commmand */
@@ -697,6 +696,7 @@ static void au1xmmc_reset_controller(struct au1xmmc_host *host)
 static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
 {
 	struct au1xmmc_host *host = mmc_priv(mmc);
+	u32 config2;
 
 	if (ios->power_mode == MMC_POWER_OFF)
 		au1xmmc_set_power(host, 0);
@@ -708,6 +708,18 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
 		au1xmmc_set_clock(host, ios->clock);
 		host->clock = ios->clock;
 	}
+
+	config2 = au_readl(HOST_CONFIG2(host));
+	switch (ios->bus_width) {
+	case MMC_BUS_WIDTH_4:
+		config2 |= SD_CONFIG2_WB;
+		break;
+	case MMC_BUS_WIDTH_1:
+		config2 &= ~SD_CONFIG2_WB;
+		break;
+	}
+	au_writel(config2, HOST_CONFIG2(host));
+	au_sync();
 }
 
 #define STATUS_TIMEOUT (SD_STATUS_RAT | SD_STATUS_DT)
@@ -952,7 +964,7 @@ static int __devinit au1xmmc_probe(struct platform_device *pdev)
 	mmc->max_blk_count = 512;
 
 	mmc->ocr_avail = AU1XMMC_OCR;
-	mmc->caps = 0;
+	mmc->caps = MMC_CAP_4_BIT_DATA;
 
 	host->status = HOST_S_IDLE;
 
-- 
1.5.5.3


  parent reply	other threads:[~2008-06-09  6:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-09  6:35 [PATCH 0/8] au1xmmc updates #4 Manuel Lauss
2008-06-09  6:36 ` [PATCH 1/8] au1xmmc: remove db1200 board code, rewrite probe Manuel Lauss
2008-06-09  6:37 ` [PATCH 2/8] Alchemy: register mmc platform device for db1200/pb1200 boards Manuel Lauss
2008-06-12  9:02   ` Ralf Baechle
2008-06-12 10:18     ` Ralf Baechle
2008-06-12 12:18       ` Manuel Lauss
2008-06-12 12:26         ` Ralf Baechle
2008-06-12 13:42           ` Pierre Ossman
2008-06-12 13:47             ` Ralf Baechle
2008-06-12 13:53               ` Pierre Ossman
2008-06-12 13:58               ` Manuel Lauss
2008-06-20 15:46                 ` Pierre Ossman
2008-06-20 16:12                   ` Manuel Lauss
2008-06-20 17:03                     ` Pierre Ossman
2008-06-20 17:13                       ` Manuel Lauss
2008-06-20 17:43                         ` Pierre Ossman
2008-06-09  6:37 ` Manuel Lauss [this message]
2008-06-09  6:38 ` [PATCH 4/8] au1xmmc: SDIO IRQ support Manuel Lauss
2008-06-09  6:38 ` [PATCH 5/8] au1xmmc: codingstyle tidying Manuel Lauss
2008-06-09  6:39 ` [PATCH 6/8] au1xmmc: abort requests early if no card is present Manuel Lauss
2008-06-09  6:39 ` [PATCH 7/8] Alchemy: remove unused MMC macros from db1x00 header Manuel Lauss
2008-06-12 10:21   ` Ralf Baechle
2008-06-09  6:40 ` [PATCH 8/8] au1xmmc: new maintainer Manuel Lauss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080609063733.GD8724@roarinelk.homelinux.net \
    --to=mano@roarinelk.homelinux.net \
    --cc=drzeus@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=sshtylyov@ru.mvista.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®