common: Drop linux/delay.h from common header
[oweals/u-boot.git] / drivers / mmc / mmc-uclass.c
index c7a832ca900a6bfe0b8cee2aa17e6d351ca8cd2f..c5b7872900104acb19fa76f503ebac1b3302465b 100644 (file)
@@ -5,12 +5,31 @@
  */
 
 #include <common.h>
+#include <log.h>
 #include <mmc.h>
 #include <dm.h>
 #include <dm/device-internal.h>
+#include <dm/device_compat.h>
 #include <dm/lists.h>
+#include <linux/compat.h>
 #include "mmc_private.h"
 
+int dm_mmc_get_b_max(struct udevice *dev, void *dst, lbaint_t blkcnt)
+{
+       struct dm_mmc_ops *ops = mmc_get_ops(dev);
+       struct mmc *mmc = mmc_get_mmc_dev(dev);
+
+       if (ops->get_b_max)
+               return ops->get_b_max(dev, dst, blkcnt);
+       else
+               return mmc->cfg->b_max;
+}
+
+int mmc_get_b_max(struct mmc *mmc, void *dst, lbaint_t blkcnt)
+{
+       return dm_mmc_get_b_max(mmc->dev, dst, blkcnt);
+}
+
 int dm_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                    struct mmc_data *data)
 {
@@ -136,6 +155,21 @@ int mmc_host_power_cycle(struct mmc *mmc)
        return dm_mmc_host_power_cycle(mmc->dev);
 }
 
+int dm_mmc_deferred_probe(struct udevice *dev)
+{
+       struct dm_mmc_ops *ops = mmc_get_ops(dev);
+
+       if (ops->deferred_probe)
+               return ops->deferred_probe(dev);
+
+       return 0;
+}
+
+int mmc_deferred_probe(struct mmc *mmc)
+{
+       return dm_mmc_deferred_probe(mmc->dev);
+}
+
 int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
 {
        int val;
@@ -206,7 +240,7 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
        return 0;
 }
 
-struct mmc *mmc_get_mmc_dev(struct udevice *dev)
+struct mmc *mmc_get_mmc_dev(const struct udevice *dev)
 {
        struct mmc_uclass_priv *upriv;