aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-03-22 16:00:34 +0100
committerJaehoon Chung <jh80.chung@samsung.com>2017-03-30 14:19:58 +0900
commit17c9a1c121e7d78d820fdb4f7ca070f53e23c29a (patch)
tree629e94cd19e8cf9d7b1b9bec203e42556627b3de /drivers
parent3d673ffce32cc65c7fe046c0c314566385a5d586 (diff)
downloadu-boot-17c9a1c121e7d78d820fdb4f7ca070f53e23c29a.zip
u-boot-17c9a1c121e7d78d820fdb4f7ca070f53e23c29a.tar.gz
u-boot-17c9a1c121e7d78d820fdb4f7ca070f53e23c29a.tar.bz2
mmc: omap_hsmmc: add support for CONFIG_BLK
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/omap_hsmmc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 104129f..83dda09 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -58,6 +58,7 @@ DECLARE_GLOBAL_DATA_PTR;
struct omap_hsmmc_plat {
struct mmc_config cfg;
+ struct mmc mmc;
};
struct omap_hsmmc_data {
@@ -814,6 +815,15 @@ static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
return 0;
}
+#ifdef CONFIG_BLK
+
+static int omap_hsmmc_bind(struct udevice *dev)
+{
+ struct omap_hsmmc_plat *plat = dev_get_platdata(dev);
+
+ return mmc_bind(dev, &plat->mmc, &plat->cfg);
+}
+#endif
static int omap_hsmmc_probe(struct udevice *dev)
{
struct omap_hsmmc_plat *plat = dev_get_platdata(dev);
@@ -825,9 +835,13 @@ static int omap_hsmmc_probe(struct udevice *dev)
cfg->name = "OMAP SD/MMC";
cfg->ops = &omap_hsmmc_ops;
+#ifdef CONFIG_BLK
+ mmc = &plat->mmc;
+#else
mmc = mmc_create(cfg, priv);
if (mmc == NULL)
return -1;
+#endif
#ifdef OMAP_HSMMC_USE_GPIO
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
@@ -852,6 +866,9 @@ U_BOOT_DRIVER(omap_hsmmc) = {
.id = UCLASS_MMC,
.of_match = omap_hsmmc_ids,
.ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata,
+#ifdef CONFIG_BLK
+ .bind = omap_hsmmc_bind,
+#endif
.probe = omap_hsmmc_probe,
.priv_auto_alloc_size = sizeof(struct omap_hsmmc_data),
.platdata_auto_alloc_size = sizeof(struct omap_hsmmc_plat),