From: Juergen Kilb <J.Kilb@phytec.de>
To: barebox@lists.infradead.org
Cc: Juergen Kilb <J.Kilb@phytec.de>
Subject: [PATCH] Add omap_hsmmc platform data.
Date: Fri, 9 Sep 2011 14:10:54 +0200 [thread overview]
Message-ID: <1315570256-28614-2-git-send-email-J.Kilb@phytec.de> (raw)
In-Reply-To: <1315570256-28614-1-git-send-email-J.Kilb@phytec.de>
Add platform data to specify maximum frequency of hsmmc interface
which can be restricted due to external level shifters.
Signed-off-by: Juergen Kilb <J.Kilb@phytec.de>
---
arch/arm/mach-omap/include/mach/omap_hsmmc.h | 28 ++++++++++++++++++++++++++
drivers/mci/omap_hsmmc.c | 10 ++++++++-
2 files changed, 37 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/mach-omap/include/mach/omap_hsmmc.h
diff --git a/arch/arm/mach-omap/include/mach/omap_hsmmc.h b/arch/arm/mach-omap/include/mach/omap_hsmmc.h
new file mode 100644
index 0000000..a15f8e6
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/omap_hsmmc.h
@@ -0,0 +1,28 @@
+/**
+ * @file
+ * @brief This file contains exported structure for OMAP hsmmc
+ *
+ * FileName: include/asm-arm/arch-omap/omap_hsmmc.h
+ *
+ * OMAP3 and OMAP4 has a MMC/SD controller embedded.
+ * This file provides the platform data structure required to
+ * addapt to platform specialities.
+ */
+/*
+ * (C) Copyright 2011
+ * Phytec Messtechnik GmbH, <www.phytec.de>
+ * Juergen Kilb <j.kilb@phytec.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_OMAP_HSMMC_H
+#define __ASM_OMAP_HSMMC_H
+
+/** omapmmc platform data structure */
+struct omap_hsmmc_platform_data {
+ unsigned f_max; /* host interface upper limit */
+};
+#endif /* __ASM_OMAP_HSMMC_H */
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 5fdf445..bf8d4a9 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -31,6 +31,8 @@
#include <errno.h>
#include <asm/io.h>
+#include <mach/omap_hsmmc.h>
+
struct hsmmc {
unsigned char res1[0x10];
unsigned int sysconfig; /* 0x10 */
@@ -549,6 +551,7 @@ static void mmc_set_ios(struct mci_host *mci, struct device_d *dev,
static int omap_mmc_probe(struct device_d *dev)
{
struct omap_hsmmc *hsmmc;
+ struct omap_hsmmc_platform_data *pdata;
hsmmc = xzalloc(sizeof(*hsmmc));
@@ -564,7 +567,12 @@ static int omap_mmc_probe(struct device_d *dev)
hsmmc->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
hsmmc->mci.f_min = 400000;
- hsmmc->mci.f_max = 52000000;
+
+ pdata = (struct omap_hsmmc_platform_data *)dev->platform_data;
+ if (pdata->f_max)
+ hsmmc->mci.f_max = pdata->f_max;
+ else
+ hsmmc->mci.f_max = 52000000;
mci_register(&hsmmc->mci);
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-09-09 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 12:10 [PATCH] Add Reset Support for omap3 Juergen Kilb
2011-09-09 12:10 ` Juergen Kilb [this message]
2011-09-09 12:10 ` [PATCH] Added helper function to get CS1 base address Juergen Kilb
2011-09-09 12:10 ` [PATCH] Corrected ns16550 access at all omap based boards Juergen Kilb
2011-09-12 10:32 ` [PATCH] Add Reset Support for omap3 Sascha Hauer
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=1315570256-28614-2-git-send-email-J.Kilb@phytec.de \
--to=j.kilb@phytec.de \
--cc=barebox@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