summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Armstrong <neil.armstrong@linaro.org>2024-10-16 11:17:16 +0200
committerCaleb Connolly <caleb.connolly@linaro.org>2024-11-20 17:57:57 +0100
commit615dfe1aeaf6e536a123cd79f6fcbe47efe5ff07 (patch)
treebe421c3c6689f3a43c938806475a10ea9de58cda
parentab76484cf24d206aadcc5caac7e590606df41963 (diff)
mmc: msm_sdhci: enable vqmmc at probe if available
On earlier platforms, the vqmmc regulator was enabled by the previous bootloader, but on the newest (SM8650) it's not and we need vqmmc to be enabled in order to have the card to respond. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
-rw-r--r--drivers/mmc/msm_sdhci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 4e5c932c071..27bb7052fca 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -15,6 +15,7 @@
#include <asm/global_data.h>
#include <asm/io.h>
#include <linux/bitops.h>
+#include <power/regulator.h>
/* Non-standard registers needed for SDHCI startup */
#define SDCC_MCI_POWER 0x0
@@ -43,6 +44,7 @@ struct msm_sdhc {
struct sdhci_host host;
void *base;
struct clk_bulk clks;
+ struct udevice *vqmmc;
};
struct msm_sdhc_variant_info {
@@ -163,6 +165,16 @@ static int msm_sdc_probe(struct udevice *dev)
if (ret)
return ret;
+ /* Get the vqmmc regulator and enable it if available */
+ device_get_supply_regulator(dev, "vqmmc-supply", &prv->vqmmc);
+ if (prv->vqmmc) {
+ ret = regulator_set_enable_if_allowed(prv->vqmmc, true);
+ if (ret) {
+ printf("Failed to enable the VQMMC regulator\n");
+ return ret;
+ }
+ }
+
var_info = (void *)dev_get_driver_data(dev);
if (!var_info->mci_removed) {
ret = msm_sdc_mci_init(prv);