From: abrestic@chromium.org (Andrew Bresticker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] mmc: tegra: fix reporting of base clock frequency
Date: Wed, 16 Apr 2014 16:08:38 -0700 [thread overview]
Message-ID: <1397689719-28882-3-git-send-email-abrestic@chromium.org> (raw)
In-Reply-To: <1397689719-28882-1-git-send-email-abrestic@chromium.org>
Tegra SDHCI controllers, by default, report a base clock frequency
of 208Mhz in SDHCI_CAPABILTIES which may or may not be equal to the
actual base clock frequency. This is because the clock rate is
configured by the clock controller, which is external to the SD/MMC
controller. Since the SD/MMC controller has no knowledge of how this
clock is configured, it will simply report the maximum frequency.
While the reported value can be overridden by setting BASE_CLK_FREQ in
VENDOR_CLOCK_CTRL on Tegra30 and later SoCs, just set CAP_CLOCK_BASE_BROKEN
and supply sdhci_pltfm_clk_get_max_clock(), which simply does a
clk_get_rate(), as the get_max_clock() callback.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes from v1:
- fixed up commit message per Stephen's suggestions
---
drivers/mmc/host/sdhci-tegra.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 3cadd9c..c3f92d9 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -165,13 +165,15 @@ static const struct sdhci_ops tegra_sdhci_ops = {
.write_l = tegra_sdhci_writel,
.platform_bus_width = tegra_sdhci_buswidth,
.platform_reset_exit = tegra_sdhci_reset_exit,
+ .get_max_clock = sdhci_pltfm_clk_get_max_clock,
};
static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_NO_HISPD_BIT |
- SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
+ SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
.ops = &tegra_sdhci_ops,
};
@@ -186,7 +188,8 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_NO_HISPD_BIT |
- SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
+ SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
.ops = &tegra_sdhci_ops,
};
@@ -202,7 +205,8 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_NO_HISPD_BIT |
- SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
+ SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
.ops = &tegra_sdhci_ops,
};
--
1.9.1.423.g4596e3a
next prev parent reply other threads:[~2014-04-16 23:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-15 1:42 [PATCH 0/4] Tegra SD/MMC fixes Andrew Bresticker
2014-04-15 1:42 ` [PATCH 1/4] mmc: tegra: disable UHS modes Andrew Bresticker
2014-04-15 1:42 ` [PATCH 2/4] mmc: tegra: fix reporting of base clock frequency Andrew Bresticker
2014-04-15 18:25 ` Stephen Warren
2014-04-15 19:36 ` Andrew Bresticker
2014-04-15 1:42 ` [PATCH 3/4] mmc: sdhci: defer probing on regulator_get_optional() failures Andrew Bresticker
2014-04-15 6:06 ` Alexandre Courbot
2014-04-15 22:56 ` Andrew Bresticker
2014-04-15 18:28 ` Stephen Warren
2014-04-15 19:59 ` Andrew Bresticker
2014-04-15 20:42 ` Russell King - ARM Linux
2014-04-15 19:03 ` Tim Kryger
2014-04-15 19:44 ` Andrew Bresticker
2014-04-15 1:42 ` [PATCH 4/4] ARM: tegra: fix Venice2 VQMMC regulators Andrew Bresticker
2014-04-15 18:31 ` Stephen Warren
2014-04-15 19:12 ` Chris Ball
2014-04-16 0:29 ` Andrew Bresticker
2014-04-16 16:19 ` Stephen Warren
2014-04-16 20:24 ` Andrew Bresticker
2014-04-16 23:08 ` [PATCH v2 0/3] Tegra SD/MMC fixes Andrew Bresticker
2014-04-16 23:08 ` [PATCH v2 1/3] mmc: tegra: disable UHS modes Andrew Bresticker
2014-05-20 17:25 ` Stephen Warren
2014-05-21 0:43 ` Chris Ball
2014-05-22 11:00 ` Ulf Hansson
2014-05-22 15:25 ` Andrew Bresticker
2014-04-16 23:08 ` Andrew Bresticker [this message]
2014-04-16 23:08 ` [PATCH v2 3/3] ARM: tegra: fix Venice2 SD card VQMMC supply Andrew Bresticker
2014-04-16 23:16 ` Stephen Warren
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=1397689719-28882-3-git-send-email-abrestic@chromium.org \
--to=abrestic@chromium.org \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).