return dm_mmc_set_ios(mmc->dev);
}
+int dm_mmc_set_vdd(struct udevice *dev, bool enable)
+{
+ struct dm_mmc_ops *ops = mmc_get_ops(dev);
+
+ if (!ops->set_vdd)
+ return -ENOSYS;
+ return ops->set_vdd(dev, enable);
+}
+
+int mmc_set_vdd(struct mmc *mmc, bool enable)
+{
+ return dm_mmc_set_vdd(mmc->dev, enable);
+}
+
int dm_mmc_get_wp(struct udevice *dev)
{
struct dm_mmc_ops *ops = mmc_get_ops(dev);
}
#ifndef CONFIG_DM_MMC_OPS
+static int mmc_set_vdd(struct mmc *mmc, bool enable)
+{
+ int ret = 0;
+
+ if (mmc->cfg->ops->set_vdd)
+ ret = mmc->cfg->ops->set_vdd(mmc, enable);
+
+ return ret;
+}
+
static int mmc_set_ios(struct mmc *mmc)
{
int ret = 0;
return err;
#endif
mmc->ddr_mode = 0;
-
+ mmc_set_vdd(mmc, true);
/* First try to set 3.3V. If it fails set to 1.8V */
err = mmc_set_signal_voltage(mmc, MMC_SIGNAL_VOLTAGE_330);
if (err != 0)
*/
int (*set_ios)(struct udevice *dev);
+ /**
+ * set_vdd() - Enable or Disable the Vdd line
+ *
+ * @dev: Device to update
+ * @enable: true or false to enable or disable Vdd respectively
+ * @return 0 if OK, -ve on error
+ */
+ int (*set_vdd)(struct udevice *dev, bool enable);
+
/**
* get_cd() - See whether a card is present
*
int dm_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
struct mmc_data *data);
int dm_mmc_set_ios(struct udevice *dev);
+int dm_mmc_set_vdd(struct udevice *dev, bool enable);
int dm_mmc_get_cd(struct udevice *dev);
int dm_mmc_get_wp(struct udevice *dev);
/* Transition functions for compatibility */
int mmc_set_ios(struct mmc *mmc);
+int mmc_set_vdd(struct mmc *mmc, bool enable);
int mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);
struct mmc_cmd *cmd, struct mmc_data *data);
int (*set_ios)(struct mmc *mmc);
int (*init)(struct mmc *mmc);
+ int (*set_vdd)(struct mmc *mmc, bool enable);
int (*getcd)(struct mmc *mmc);
int (*getwp)(struct mmc *mmc);
};