]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/mmc/host/sdhci-xenon.c
mmc: sdhci-xenon: add set_power callback
[karo-tx-linux.git] / drivers / mmc / host / sdhci-xenon.c
index bc1781bb070b7b8b83c0132abb114f6905ffddfb..c580af05b033a1f596f4335d90a1e56f84c6903e 100644 (file)
@@ -210,8 +210,27 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host,
        sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
 }
 
+static void xenon_set_power(struct sdhci_host *host, unsigned char mode,
+               unsigned short vdd)
+{
+       struct mmc_host *mmc = host->mmc;
+       u8 pwr = host->pwr;
+
+       sdhci_set_power_noreg(host, mode, vdd);
+
+       if (host->pwr == pwr)
+               return;
+
+       if (host->pwr == 0)
+               vdd = 0;
+
+       if (!IS_ERR(mmc->supply.vmmc))
+               mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
+}
+
 static const struct sdhci_ops sdhci_xenon_ops = {
        .set_clock              = sdhci_set_clock,
+       .set_power              = xenon_set_power,
        .set_bus_width          = sdhci_set_bus_width,
        .reset                  = xenon_reset,
        .set_uhs_signaling      = xenon_set_uhs_signaling,