From: Daniel Mack <zonque@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org,
Daniel Mack <zonque@gmail.com>
Subject: [PATCH] ARM: OMAP: hsmmc: add max_freq field
Date: Wed, 14 Dec 2011 14:22:07 +0100 [thread overview]
Message-ID: <1323868927-3738-1-git-send-email-zonque@gmail.com> (raw)
External circuitry like level shifters may limit the maximum operation
speed of the hsmmc controller. Add a field to struct omap2_hsmmc_info
so boards can adjust the setting on demand.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/hsmmc.c | 1 +
arch/arm/mach-omap2/hsmmc.h | 2 ++
drivers/mmc/host/omap_hsmmc.c | 8 ++++++--
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index f4a1020..4c7bc36 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -298,6 +298,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].caps = c->caps;
mmc->slots[0].internal_clock = !c->ext_clock;
mmc->dma_mask = 0xffffffff;
+ mmc->max_freq = c->max_freq;
if (cpu_is_omap44xx())
mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
else
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index f757e78..65a8c12 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -25,6 +25,8 @@ struct omap2_hsmmc_info {
char *name; /* or NULL for default */
struct device *dev; /* returned: pointer to mmc adapter */
int ocr_mask; /* temporary HACK */
+ int max_freq; /* maximum clock, if constrained by external
+ * circuitry, or 0 for default */
/* Remux (pad configuration) when powering on/off */
void (*remux)(struct device *dev, int slot, int power_on);
/* init some special card */
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 101cd31..8215ef9 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1927,8 +1927,12 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
if (mmc_slot(host).vcc_aux_disable_is_sleep)
mmc_slot(host).no_off = 1;
- mmc->f_min = OMAP_MMC_MIN_CLOCK;
- mmc->f_max = OMAP_MMC_MAX_CLOCK;
+ mmc->f_min = OMAP_MMC_MIN_CLOCK;
+
+ if (pdata->max_freq > 0)
+ mmc->f_max = pdata->max_freq;
+ else
+ mmc->f_max = OMAP_MMC_MAX_CLOCK;
spin_lock_init(&host->irq_lock);
--
1.7.7.4
WARNING: multiple messages have this Message-ID (diff)
From: zonque@gmail.com (Daniel Mack)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP: hsmmc: add max_freq field
Date: Wed, 14 Dec 2011 14:22:07 +0100 [thread overview]
Message-ID: <1323868927-3738-1-git-send-email-zonque@gmail.com> (raw)
External circuitry like level shifters may limit the maximum operation
speed of the hsmmc controller. Add a field to struct omap2_hsmmc_info
so boards can adjust the setting on demand.
Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/hsmmc.c | 1 +
arch/arm/mach-omap2/hsmmc.h | 2 ++
drivers/mmc/host/omap_hsmmc.c | 8 ++++++--
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index f4a1020..4c7bc36 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -298,6 +298,7 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->slots[0].caps = c->caps;
mmc->slots[0].internal_clock = !c->ext_clock;
mmc->dma_mask = 0xffffffff;
+ mmc->max_freq = c->max_freq;
if (cpu_is_omap44xx())
mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
else
diff --git a/arch/arm/mach-omap2/hsmmc.h b/arch/arm/mach-omap2/hsmmc.h
index f757e78..65a8c12 100644
--- a/arch/arm/mach-omap2/hsmmc.h
+++ b/arch/arm/mach-omap2/hsmmc.h
@@ -25,6 +25,8 @@ struct omap2_hsmmc_info {
char *name; /* or NULL for default */
struct device *dev; /* returned: pointer to mmc adapter */
int ocr_mask; /* temporary HACK */
+ int max_freq; /* maximum clock, if constrained by external
+ * circuitry, or 0 for default */
/* Remux (pad configuration) when powering on/off */
void (*remux)(struct device *dev, int slot, int power_on);
/* init some special card */
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 101cd31..8215ef9 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1927,8 +1927,12 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
if (mmc_slot(host).vcc_aux_disable_is_sleep)
mmc_slot(host).no_off = 1;
- mmc->f_min = OMAP_MMC_MIN_CLOCK;
- mmc->f_max = OMAP_MMC_MAX_CLOCK;
+ mmc->f_min = OMAP_MMC_MIN_CLOCK;
+
+ if (pdata->max_freq > 0)
+ mmc->f_max = pdata->max_freq;
+ else
+ mmc->f_max = OMAP_MMC_MAX_CLOCK;
spin_lock_init(&host->irq_lock);
--
1.7.7.4
next reply other threads:[~2011-12-14 13:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 13:22 Daniel Mack [this message]
2011-12-14 13:22 ` [PATCH] ARM: OMAP: hsmmc: add max_freq field Daniel Mack
2011-12-22 18:51 ` Tony Lindgren
2011-12-22 18:51 ` Tony Lindgren
2011-12-22 19:37 ` Kishore Kadiyala
2011-12-22 19:37 ` Kishore Kadiyala
2011-12-22 23:02 ` Daniel Mack
2011-12-22 23:02 ` Daniel Mack
2011-12-23 15:40 ` T Krishnamoorthy, Balaji
2011-12-23 15:40 ` T Krishnamoorthy, Balaji
2011-12-29 13:22 ` Daniel Mack
2011-12-29 13:22 ` Daniel Mack
2012-02-17 13:44 ` Daniel Mack
2012-02-17 13:44 ` Daniel Mack
2012-02-17 17:09 ` Cousson, Benoit
2012-02-17 17:09 ` Cousson, Benoit
2012-03-02 0:11 ` Tony Lindgren
2012-03-02 0:11 ` Tony Lindgren
2012-03-02 7:11 ` S, Venkatraman
2012-03-02 7:11 ` S, Venkatraman
2012-03-02 9:14 ` S, Venkatraman
2012-03-02 9:14 ` S, Venkatraman
-- strict thread matches above, loose matches on Subject: below --
2012-02-19 12:20 Daniel Mack
2012-02-19 12:20 ` Daniel Mack
2012-02-19 16:16 ` Chris Ball
2012-02-19 16:16 ` 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=1323868927-3738-1-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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.