struct regulator *pbias;
bool pbias_enabled;
void __iomem *base;
+ int vqmmc_enabled;
resource_size_t mapbase;
spinlock_t irq_lock; /* Prevent races with irq handler */
unsigned int dma_len;
static int omap_hsmmc_enable_supply(struct mmc_host *mmc, int vdd)
{
int ret;
+ struct omap_hsmmc_host *host = mmc_priv(mmc);
if (mmc->supply.vmmc) {
ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
}
/* Enable interface voltage rail, if needed */
- if (mmc->supply.vqmmc) {
+ if (mmc->supply.vqmmc && !host->vqmmc_enabled) {
ret = regulator_enable(mmc->supply.vqmmc);
if (ret) {
dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n");
goto err_vqmmc;
}
+ host->vqmmc_enabled = 1;
}
return 0;
{
int ret;
int status;
+ struct omap_hsmmc_host *host = mmc_priv(mmc);
- if (mmc->supply.vqmmc) {
+ if (mmc->supply.vqmmc && host->vqmmc_enabled) {
ret = regulator_disable(mmc->supply.vqmmc);
if (ret) {
dev_err(mmc_dev(mmc), "vmmc_aux reg disable failed\n");
return ret;
}
+ host->vqmmc_enabled = 0;
}
if (mmc->supply.vmmc) {
host->power_mode = MMC_POWER_OFF;
host->next_data.cookie = 1;
host->pbias_enabled = 0;
+ host->vqmmc_enabled = 0;
ret = omap_hsmmc_gpio_init(mmc, host, pdata);
if (ret)