summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-02-09 14:09:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-02-09 14:35:38 +0100
commit3c30f3b97167dae992601188fbffd066522d1981 (patch)
tree161216ba2482c39df894fa66013fc6c029af1a60
parentb795a7320b98f9a77a6208368189324445c06686 (diff)
downloadbarebox-3c30f3b97167dae992601188fbffd066522d1981.tar.gz
barebox-3c30f3b97167dae992601188fbffd066522d1981.tar.xz
mci i.MX esdhc: make 8bit modes platform dependent
Whether the controller works in 8bit mode is not only dependent on the controller but also on the board having wired up 8 data lines, so put a capabilities field in platform data. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/include/mach/esdhc.h2
-rw-r--r--drivers/mci/imx-esdhc.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/include/mach/esdhc.h b/arch/arm/mach-imx/include/mach/esdhc.h
index aaf97481f4..b4c1aa9ebe 100644
--- a/arch/arm/mach-imx/include/mach/esdhc.h
+++ b/arch/arm/mach-imx/include/mach/esdhc.h
@@ -32,6 +32,7 @@ enum cd_types {
* @cd_gpio: gpio for card_detect interrupt
* @wp_type: type of write_protect method (see wp_types enum above)
* @cd_type: type of card_detect method (see cd_types enum above)
+ * @caps: supported bus width capabilities (MMC_MODE_4BIT | MMC_MODE_8BIT)
*/
struct esdhc_platform_data {
@@ -39,5 +40,6 @@ struct esdhc_platform_data {
unsigned int cd_gpio;
enum wp_types wp_type;
enum cd_types cd_type;
+ unsigned caps;
};
#endif /* __ASM_ARCH_IMX_ESDHC_H */
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index d36d211e55..c6f2d5c489 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -511,6 +511,7 @@ static int fsl_esdhc_probe(struct device_d *dev)
struct mci_host *mci;
u32 caps;
int ret;
+ struct esdhc_platform_data *pdata = dev->platform_data;
host = xzalloc(sizeof(*host));
mci = &host->mci;
@@ -534,7 +535,10 @@ static int fsl_esdhc_probe(struct device_d *dev)
if (caps & ESDHC_HOSTCAPBLT_VS33)
mci->voltages |= MMC_VDD_32_33 | MMC_VDD_33_34;
- mci->host_caps = MMC_MODE_4BIT | MMC_MODE_8BIT;
+ if (pdata && pdata->caps)
+ mci->host_caps = pdata->caps;
+ else
+ mci->host_caps = MMC_MODE_4BIT;
if (caps & ESDHC_HOSTCAPBLT_HSS)
mci->host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;