diff options
author | Simon Glass <sjg@chromium.org> | 2016-05-01 13:52:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-05-17 09:54:43 -0600 |
commit | ad27dd5e13436b554f0f3cb9cd3e79634494072d (patch) | |
tree | fc6a8492dcf32788ad177b1f1e3c4e17e1e3809b /include/mmc.h | |
parent | 8ef761ed4cda2d078b3d8b098d105472cbad8fb5 (diff) | |
download | u-boot-ad27dd5e13436b554f0f3cb9cd3e79634494072d.tar.gz |
dm: mmc: Add a way to bind MMC devices with driver model
Binding an MMC device when CONFIG_BLK is enabled requires that a block
device be bound as a child of the MMC device. Add a function to do this.
The mmc_create() method will be used only when DM_BLK is disabled.
Add an unbind method also.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/mmc.h')
-rw-r--r-- | include/mmc.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h index 6d1f05c328..fb8d9b2f55 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -409,7 +409,29 @@ enum mmc_hwpart_conf_mode { int mmc_register(struct mmc *mmc); struct mmc *mmc_create(const struct mmc_config *cfg, void *priv); + +/** + * mmc_bind() - Set up a new MMC device ready for probing + * + * A child block device is bound with the IF_TYPE_MMC interface type. This + * allows the device to be used with CONFIG_BLK + * + * @dev: MMC device to set up + * @mmc: MMC struct + * @cfg: MMC configuration + * @return 0 if OK, -ve on error + */ +int mmc_bind(struct udevice *dev, struct mmc *mmc, + const struct mmc_config *cfg); void mmc_destroy(struct mmc *mmc); + +/** + * mmc_unbind() - Unbind a MMC device's child block device + * + * @dev: MMC device + * @return 0 if OK, -ve on error + */ +int mmc_unbind(struct udevice *dev); int mmc_initialize(bd_t *bis); int mmc_init(struct mmc *mmc); int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); |