From: Chris Ball <cjb@laptop.org>
To: linux-mmc@vger.kernel.org
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
Wolfram Sang <w.sang@pengutronix.de>
Subject: [PATCH 2/2] mmc: sdhci: Replace SDHCI_QUIRK_NO_MULTIBLOCK with a platform hook.
Date: Sun, 06 Feb 2011 01:13:26 -0500 [thread overview]
Message-ID: <m3zkq9n115.fsf@pullcord.laptop.org> (raw)
Part of a quirk cleanup run. This quirk was only used by sdhci-esdhc.
This patch is untested.
Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 12 ++++++++----
drivers/mmc/host/sdhci.c | 5 ++++-
drivers/mmc/host/sdhci.h | 1 +
include/linux/mmc/sdhci.h | 4 ++--
4 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 6249b75..f19b818 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -107,6 +107,13 @@ static unsigned int esdhc_pltfm_get_max_blk_size(struct sdhci_host *host)
return 2;
}
+static unsigned int esdhc_pltfm_get_max_blk_count(struct sdhci_host *host)
+{
+ /* Fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
+
+ return (cpu_is_mx25() || cpu_is_mx35()) ? 1 : 65535;
+}
+
static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pdata)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -123,10 +130,6 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
if (cpu_is_mx35() || cpu_is_mx51())
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
- /* Fix errata ENGcm07207 which is present on i.MX25 and i.MX35 */
- if (cpu_is_mx25() || cpu_is_mx35())
- host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
-
return 0;
}
@@ -146,6 +149,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_max_clock = esdhc_pltfm_get_max_clock,
.get_min_clock = esdhc_pltfm_get_min_clock,
.get_max_blk_size = esdhc_pltfm_get_max_blk_size,
+ .get_max_blk_count = esdhc_pltfm_get_max_blk_count,
};
struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fcd6188..8a794fb 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1979,7 +1979,10 @@ int sdhci_add_host(struct sdhci_host *host)
/*
* Maximum block count.
*/
- mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535;
+ if (host->ops->get_max_blk_count)
+ mmc->max_blk_count = host->ops->get_max_blk_count(host);
+ else
+ mmc->max_blk_count = 65535;
/*
* Init tasklets.
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 08c1071..a9de7b1 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -218,6 +218,7 @@ struct sdhci_ops {
unsigned int (*get_min_clock)(struct sdhci_host *host);
unsigned int (*get_timeout_clock)(struct sdhci_host *host);
unsigned int (*get_max_blk_size)(struct sdhci_host *host);
+ unsigned int (*get_max_blk_count)(struct sdhci_host *host);
int (*platform_8bit_width)(struct sdhci_host *host,
int width);
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 2fde25c..52de824 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -65,8 +65,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
/* Reclaimed */
#define SDHCI_QUIRK_UNUSED_20 (1<<20)
-/* Controller cannot do multi-block transfers */
-#define SDHCI_QUIRK_NO_MULTIBLOCK (1<<21)
+/* Reclaimed */
+#define SDHCI_QUIRK_UNUSED_21 (1<<21)
/* Controller can only handle 1-bit data transfers */
#define SDHCI_QUIRK_FORCE_1_BIT_DATA (1<<22)
/* Controller needs 10ms delay between applying power and clock */
--
Chris Ball <cjb@laptop.org>
One Laptop Per Child
next reply other threads:[~2011-02-06 6:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 6:13 Chris Ball [this message]
2011-02-07 17:48 ` [PATCH 2/2] mmc: sdhci: Replace SDHCI_QUIRK_NO_MULTIBLOCK with a platform hook Wolfram Sang
2011-02-12 20:22 ` Chris Ball
2011-02-12 20:43 ` Wolfram Sang
2011-02-12 21:05 ` Chris Ball
2011-02-13 21:13 ` Wolfram Sang
2011-05-29 2:28 ` 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=m3zkq9n115.fsf@pullcord.laptop.org \
--to=cjb@laptop.org \
--cc=cbouatmailru@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=w.sang@pengutronix.de \
/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.