return dm_mmc_set_vdd(mmc->dev, enable);
}
+int dm_mmc_card_busy(struct udevice *dev)
+{
+ struct dm_mmc_ops *ops = mmc_get_ops(dev);
+
+ if (!ops->card_busy)
+ return 0;
+ return ops->card_busy(dev);
+}
+
+int mmc_card_busy(struct mmc *mmc)
+{
+ return dm_mmc_card_busy(mmc->dev);
+}
+
int dm_mmc_get_wp(struct udevice *dev)
{
struct dm_mmc_ops *ops = mmc_get_ops(dev);
return ret;
}
+static int mmc_card_busy(struct mmc *mmc)
+{
+ int ret = 0;
+
+ if (mmc->cfg->ops->card_busy)
+ ret = mmc->cfg->ops->card_busy(mmc);
+
+ return ret;
+}
+
static int mmc_set_ios(struct mmc *mmc)
{
int ret = 0;
* @return 0 if OK, -ve on error
*/
int (*execute_tuning)(struct udevice *dev, uint opcode);
+
+ /**
+ * card_busy() - See whether a card is busy
+ *
+ * @dev: Device to check
+ * @return 1 if busy, O if not busy
+ */
+ int (*card_busy)(struct udevice *dev);
};
#define mmc_get_ops(dev) ((struct dm_mmc_ops *)(dev)->driver->ops)
int dm_mmc_get_cd(struct udevice *dev);
int dm_mmc_get_wp(struct udevice *dev);
int dm_mmc_execute_tuning(struct udevice *dev, uint opcode);
+int dm_mmc_card_busy(struct udevice *dev);
/* Transition functions for compatibility */
int mmc_set_ios(struct mmc *mmc);
int mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);
int mmc_execute_tuning(struct mmc *mmc, uint opcode);
+int mmc_card_busy(struct mmc *mmc);
#else
struct mmc_ops {
int (*getcd)(struct mmc *mmc);
int (*getwp)(struct mmc *mmc);
int (*execute_tuning)(struct mmc *mmc, uint opcode);
+ int (*card_busy)(struct mmc *mmc);
};
#endif