summaryrefslogtreecommitdiffstats
path: root/drivers/mci
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-01-09 10:29:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-09 10:29:08 +0100
commitdb31ccf293a58a2ce4a53859328c20269f44fd90 (patch)
treeb1d9b1431ffe3d78fa25a45eaedac0e1559b79d6 /drivers/mci
parentfca2d7947016af0fb9b1daf9d4c037c83ec9aea9 (diff)
parent04cb446c9a1bdddae41b20df5de8825df44e8dfe (diff)
downloadbarebox-db31ccf293a58a2ce4a53859328c20269f44fd90.tar.gz
barebox-db31ccf293a58a2ce4a53859328c20269f44fd90.tar.xz
Merge branch 'for-next/omap'
Diffstat (limited to 'drivers/mci')
-rw-r--r--drivers/mci/Kconfig2
-rw-r--r--drivers/mci/omap_hsmmc.c45
2 files changed, 40 insertions, 7 deletions
diff --git a/drivers/mci/Kconfig b/drivers/mci/Kconfig
index 68761173c9..9558f287d3 100644
--- a/drivers/mci/Kconfig
+++ b/drivers/mci/Kconfig
@@ -67,7 +67,7 @@ config MCI_IMX_ESDHC_PIO
config MCI_OMAP_HSMMC
bool "OMAP HSMMC"
- depends on ARCH_OMAP4 || ARCH_OMAP3
+ depends on ARCH_OMAP4 || ARCH_OMAP3 || ARCH_AM33XX
help
Enable this entry to add support to read and write SD cards on
both OMAP3 and OMAP4 based systems.
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index d1e4c362aa..ffcb4ae75c 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -59,6 +59,18 @@ struct hsmmc {
unsigned int capa; /* 0x140 */
};
+struct omap_mmc_driver_data {
+ unsigned long reg_ofs;
+};
+
+static struct omap_mmc_driver_data omap3_data = {
+ .reg_ofs = 0,
+};
+
+static struct omap_mmc_driver_data omap4_data = {
+ .reg_ofs = 0x100,
+};
+
/*
* OMAP HS MMC Bit definitions
*/
@@ -175,6 +187,7 @@ struct omap_hsmmc {
struct mci_host mci;
struct device_d *dev;
struct hsmmc *base;
+ void __iomem *iobase;
};
#define to_hsmmc(mci) container_of(mci, struct omap_hsmmc, mci)
@@ -565,6 +578,13 @@ static int omap_mmc_probe(struct device_d *dev)
{
struct omap_hsmmc *hsmmc;
struct omap_hsmmc_platform_data *pdata;
+ struct omap_mmc_driver_data *drvdata;
+ unsigned long reg_ofs = 0;
+ int ret;
+
+ ret = dev_get_drvdata(dev, (unsigned long *)&drvdata);
+ if (!ret)
+ reg_ofs = drvdata->reg_ofs;
hsmmc = xzalloc(sizeof(*hsmmc));
@@ -575,7 +595,8 @@ static int omap_mmc_probe(struct device_d *dev)
hsmmc->mci.host_caps = MMC_MODE_4BIT | MMC_MODE_HS_52MHz | MMC_MODE_HS;
hsmmc->mci.hw_dev = dev;
- hsmmc->base = dev_request_mem_region(dev, 0);
+ hsmmc->iobase = dev_request_mem_region(dev, 0);
+ hsmmc->base = hsmmc->iobase + reg_ofs;
hsmmc->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -592,16 +613,28 @@ static int omap_mmc_probe(struct device_d *dev)
return 0;
}
+static struct platform_device_id omap_mmc_ids[] = {
+ {
+ .name = "omap3-hsmmc",
+ .driver_data = (unsigned long)&omap3_data,
+ }, {
+ .name = "omap4-hsmmc",
+ .driver_data = (unsigned long)&omap4_data,
+ }, {
+ /* sentinel */
+ },
+};
+
static struct driver_d omap_mmc_driver = {
- .name = "omap-hsmmc",
- .probe = omap_mmc_probe,
+ .name = "omap-hsmmc",
+ .probe = omap_mmc_probe,
+ .id_table = omap_mmc_ids,
};
static int omap_mmc_init_driver(void)
{
- platform_driver_register(&omap_mmc_driver);
- return 0;
+ platform_driver_register(&omap_mmc_driver);
+ return 0;
}
device_initcall(omap_mmc_init_driver);
-