From: Ben Dooks <ben@simtec.co.uk>
To: Kukjin Kim <kgene.kim@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-mmc@vger.kernel.org,
Jeongbae Seo <jeongbae.seo@samsung.com>,
Hyuk Lee <hyuk1.lee@samsung.com>,
ben-linux@fluff.org, akpm@linux-foundation.org, cjb@laptop.org
Subject: Re: [PATCH v2 2/2] sdhci-s3c: Add support no internal clock divider in host controller
Date: Tue, 21 Sep 2010 01:24:20 +0100 [thread overview]
Message-ID: <4C97FB34.1000802@simtec.co.uk> (raw)
In-Reply-To: <1284716701-5140-3-git-send-email-kgene.kim@samsung.com>
On 17/09/10 10:45, Kukjin Kim wrote:
> From: Hyuk Lee <hyuk1.lee@samsung.com>
>
> This patch adds to support no internal clock divider in SDHCI.
> The external clock divider can be used to make a proper clock
> because SDHCI doesn't support internal clock divider by itself.
>
> Signed-off-by: Hyuk Lee <hyuk1.lee@samsung.com>
> Signed-off-by: Jeongbae Seo <jeongbae.seo@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> ---
> drivers/mmc/host/sdhci-s3c.c | 60 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 60 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
> index e6e0438..5ad5ed7 100644
> --- a/drivers/mmc/host/sdhci-s3c.c
> +++ b/drivers/mmc/host/sdhci-s3c.c
> @@ -96,6 +96,13 @@ static unsigned int sdhci_s3c_get_max_clk(struct sdhci_host *host)
> unsigned int rate, max;
> int clk;
>
> + /*
> + * There is only one clock source(sclk) if there is no clock divider
> + * in the host controller
> + */
> + if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK)
> + return clk_round_rate(ourhost->clk_bus[2], UINT_MAX);
interesting, <linux/clk.h> doesn't have a second parameter to
clk_round_rate().
> /* note, a reset will reset the clock source */
>
> sdhci_s3c_check_sclk(host);
> @@ -130,6 +137,15 @@ static unsigned int sdhci_s3c_consider_clock(struct sdhci_s3c *ourhost,
> if (!clksrc)
> return UINT_MAX;
>
> + /*
> + * There is only one clock source(sclk) if there is no clock divider
> + * in the host controller
> + */
> + if (ourhost->host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK) {
> + rate = clk_round_rate(clksrc, wanted);
> + return wanted - rate;
> + }
Why does this need a quirk, instead of just having one clock available
in the list of usable clocks?
--
Ben
next prev parent reply other threads:[~2010-09-21 0:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-17 9:44 [PATCH v2 0/2] sdhci-s3c: Add support S5PV310/S5PC210 HSMMC Kukjin Kim
2010-09-17 9:45 ` [PATCH v2 1/2] sdhci-s3c: Add support additional host capabilities Kukjin Kim
2010-09-17 9:45 ` [PATCH v2 2/2] sdhci-s3c: Add support no internal clock divider in host controller Kukjin Kim
2010-09-21 0:24 ` Ben Dooks [this message]
2010-09-28 4:02 ` Jeongbae Seo
2010-09-28 5:21 ` Kukjin Kim
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=4C97FB34.1000802@simtec.co.uk \
--to=ben@simtec.co.uk \
--cc=akpm@linux-foundation.org \
--cc=ben-linux@fluff.org \
--cc=cjb@laptop.org \
--cc=hyuk1.lee@samsung.com \
--cc=jeongbae.seo@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
/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