public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <philipp.zabel@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ian Molton <ian@mnementh.co.uk>, Pierre Ossman <pierre@ossman.eu>,
	Philipp Zabel <philipp.zabel@gmail.com>
Subject: [PATCH 6/7] mmc: tmio_mmc: fix SDCLK divider setting
Date: Thu,  4 Jun 2009 20:12:36 +0200	[thread overview]
Message-ID: <1244139157-16404-7-git-send-email-philipp.zabel@gmail.com> (raw)
In-Reply-To: <1244139157-16404-1-git-send-email-philipp.zabel@gmail.com>

Except for the SDCLK = HCLK (divider bypassed) case, the clock
setting resulted in double the requested frequency.
The smallest possible frequency (f_max/512) is configured with
a divider setting 0x80, not 0x40.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
---
 drivers/mmc/host/tmio_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index fe6d2b6..9f6e180 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -44,10 +44,10 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)
 			clock <<= 1;
 			clk >>= 1;
 		}
-		if (clk & 0x1)
-			clk = 0x20000;
+		if (clk == 0)
+			clk = 0x8000 << 1;
 
-		clk >>= 2;
+		clk >>= 1;
 		sd_config_write8(host, CNF_SD_CLK_MODE, (clk & 0x8000) ? 0 : 1);
 		clk |= 0x100;
 	}
-- 
1.6.3.1


  parent reply	other threads:[~2009-06-04 18:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-04 18:12 [PATCH 0/7] ASIC3 support for tmio_mmc Philipp Zabel
2009-06-04 18:12 ` [PATCH 1/7] MFD,mmc: tmio_mmc: make HCLK configurable Philipp Zabel
2009-06-04 22:55   ` Samuel Ortiz
2009-06-04 18:12 ` [PATCH 2/7] mmc: tmio_mmc: add bus_shift support Philipp Zabel
2009-06-04 18:12 ` [PATCH 3/7] mmc: tmio_mmc: don't use set_irq_type (v2) Philipp Zabel
2009-06-04 18:12 ` [PATCH 4/7] mmc: tmio_mmc: correct probe return value for num_resources != 3 Philipp Zabel
2009-06-04 18:12 ` [PATCH 5/7] mmc: tmio_mmc: map SD control registers after enabling the MFD cell Philipp Zabel
2009-06-12 21:36   ` Ian molton
2009-06-04 18:12 ` Philipp Zabel [this message]
2009-06-12 21:44   ` [PATCH 6/7] mmc: tmio_mmc: fix SDCLK divider setting Ian Molton
2009-06-04 18:12 ` [PATCH 7/7] mmc: tmio_mmc: allow compilation for ASIC3 Philipp Zabel
2009-06-12 21:47   ` Ian molton
2009-06-12 22:38     ` pHilipp Zabel
2009-06-13 11:58 ` [PATCH 0/7] ASIC3 support for tmio_mmc Pierre Ossman
2009-06-13 18:42   ` Ian Molton
2009-06-13 19:32     ` Pierre Ossman
2009-06-13 19:57       ` Ian Molton

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=1244139157-16404-7-git-send-email-philipp.zabel@gmail.com \
    --to=philipp.zabel@gmail.com \
    --cc=ian@mnementh.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre@ossman.eu \
    /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