public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Prchal Jiří" <jiri.prchal@aksignal.cz>
To: linux-mmc@vger.kernel.org, nicolas.ferre@atmel.com,
	linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] mmc, AT91: fix init fequency problem
Date: Thu, 24 Mar 2011 10:10:35 +0100	[thread overview]
Message-ID: <4D8B0A8B.6030002@aksignal.cz> (raw)
In-Reply-To: <1300949648-15078-2-git-send-email-horms@verge.net.au>

Hi,
this patch fixes problem with some SD cards during initialization. Not all SD(HC) card can run at even 375kHz. Sets
minimal frequency to 200kHz.
And in function "at91_mci_set_ios" is limit to maximum division, it's only 8 bit value.

Kernel version: 2.6.38
Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
---

diff -uprN -X linux-2.6.38-vanilla/Documentation/dontdiff linux-2.6.38-vanilla/drivers/mmc/host/at91_mci.c
/home/prchal/arm/fw-cdu/linux/linux-2.6.38/drivers/mmc/host/at91_mci.c
--- linux-2.6.38-vanilla/drivers/mmc/host/at91_mci.c	2011-03-15 02:20:32.000000000 +0100
+++ /home/prchal/arm/fw-cdu/linux/linux-2.6.38/drivers/mmc/host/at91_mci.c	2011-03-24 09:20:22.869370179 +0100
@@ -724,6 +724,10 @@ static void at91_mci_set_ios(struct mmc_
 		else
 			clkdiv = (at91_master_clock / ios->clock) / 2;

+		/* set maximum divider */
+		if (clkdiv > 255)
+			clkdiv = 255;
+
 		pr_debug("clkdiv = %d. mcck = %ld\n", clkdiv,
 			at91_master_clock / (2 * (clkdiv + 1)));
 	}
@@ -944,7 +948,7 @@ static int __init at91_mci_probe(struct
 	}

 	mmc->ops = &at91_mci_ops;
-	mmc->f_min = 375000;
+	mmc->f_min = 200000; /* not all cards can run at 375kHz */
 	mmc->f_max = 25000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
 	mmc->caps = 0;

       reply	other threads:[~2011-03-24  9:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1300949648-15078-1-git-send-email-horms@verge.net.au>
     [not found] ` <1300949648-15078-2-git-send-email-horms@verge.net.au>
2011-03-24  9:10   ` Prchal Jiří [this message]
2011-03-24 10:20   ` [PATCH 1/2] ALSA: ASoc: TLV320AIC3X: ad SPI and clock on GPIO2 or BCLK Prchal Jiří
2011-04-02  8:26     ` [alsa-devel] " Mark Brown
2011-04-04  7:49       ` Prchal Jiří
2011-04-04  8:03         ` Mark Brown
2011-04-04  8:01       ` [PATCH] ALSA: ASoc: new functions snd_soc_7_8_* Prchal Jiří
2011-04-04  8:05         ` Mark Brown
2011-03-24 10:43   ` [PATCH 2/2] ALSA: ASoc: putting together AT91SAM9260 and TLV320AIC3X Prchal Jiří
2011-03-24 20:07     ` Ryan Mallon
2011-04-04  8:57       ` Prchal Jiří
2011-04-04 20:07         ` Ryan Mallon
2011-04-04  9:10       ` [PATCH] ARCH arm: adding new board: CDU Prchal Jiří
2011-04-04  9:16         ` Russell King - ARM Linux
2011-04-04  9:24           ` Russell King - ARM Linux
2011-04-04 20:25         ` Ryan Mallon

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=4D8B0A8B.6030002@aksignal.cz \
    --to=jiri.prchal@aksignal.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nicolas.ferre@atmel.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