All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: David Vrabel <david.vrabel@csr.com>
Cc: zhangfei gao <zhangfei.gao@gmail.com>,
	linux-mmc@vger.kernel.org,
	Anton Vorontsov <cbouatmailru@gmail.com>,
	Ben Dooks <ben-linux@fluff.org>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Eric Miao <eric.y.miao@gmail.com>
Subject: Re: [patch v2 1/1]sdhci support 10 bit divided clock Mode for spec 3.0
Date: Mon, 16 Aug 2010 19:27:10 +0100	[thread overview]
Message-ID: <20100816182710.GA6338@console-pimps.org> (raw)
In-Reply-To: <4C696233.6000408@csr.com>

On Mon, Aug 16, 2010 at 05:07:15PM +0100, David Vrabel wrote:
> zhangfei gao wrote:
> > 
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> > index 913555e..32dcac9 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> [...]
> > @@ -1001,13 +1001,23 @@ static void sdhci_set_clock(struct sdhci_host
> > *host, unsigned int clock)
> >  	if (clock == 0)
> >  		goto out;
> > 
> > -	for (div = 1;div < 256;div *= 2) {
> > -		if ((host->max_clk / div) <= clock)
> > -			break;
> > +	if (host->version >= SDHCI_SPEC_300)
> > +		max_div = 2046;
> > +	else
> > +		max_div = 256;
> > +
> > +	if(host->max_clk <= clock)
> > +		div = 1;
> > +	else {
> > +		for (div = 2; div < max_div; div += 2) {
> > +			if ((host->max_clk / div) <= clock)
> > +				break;
> > +		}
> 
> This isn't correct.  The divisor must be a power of two for 2.00
> controllers.

Sorry, I did mean to reply to this sooner but I've been travelling. Yeah
David, you're right. Zhangfei, have you confused the Programmable Clock
Mode in the 3.00 spec here with 10-bit Divided Clock Mode?

Both 8-bit Divided Clock Mode and 10-bit Divided Clock Mode require the
divisor to be a power of two. Support for Programmable Clock Mode would
require a bit more work because not all clock multiplier values are
valid. Support for that should be done as a separate patch.

  reply	other threads:[~2010-08-16 18:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 13:41 [patch v2 1/1]sdhci support 10 bit divided clock Mode for spec 3.0 zhangfei gao
2010-08-16 13:48 ` zhangfei gao
2010-08-16 16:07 ` David Vrabel
2010-08-16 18:27   ` Matt Fleming [this message]
2010-08-16 18:54     ` David Vrabel
2010-08-16 19:27       ` Matt Fleming
2010-08-17 11:08         ` zhangfei gao
2010-08-17 11:32           ` David Vrabel
2010-08-17 11:42           ` Matt Fleming
2010-09-14 13:12           ` Chris Ball

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=20100816182710.GA6338@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=ben-linux@fluff.org \
    --cc=cbouatmailru@gmail.com \
    --cc=david.vrabel@csr.com \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=w.sang@pengutronix.de \
    --cc=zhangfei.gao@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.