@@ -416,12 +416,33 @@ static void sdhci_sprd_request_done(struct sdhci_host *host,
416
416
mmc_request_done (host -> mmc , mrq );
417
417
}
418
418
419
+ static void sdhci_sprd_set_power (struct sdhci_host * host , unsigned char mode ,
420
+ unsigned short vdd )
421
+ {
422
+ struct mmc_host * mmc = host -> mmc ;
423
+
424
+ switch (mode ) {
425
+ case MMC_POWER_OFF :
426
+ mmc_regulator_set_ocr (host -> mmc , mmc -> supply .vmmc , 0 );
427
+
428
+ mmc_regulator_disable_vqmmc (mmc );
429
+ break ;
430
+ case MMC_POWER_ON :
431
+ mmc_regulator_enable_vqmmc (mmc );
432
+ break ;
433
+ case MMC_POWER_UP :
434
+ mmc_regulator_set_ocr (host -> mmc , mmc -> supply .vmmc , vdd );
435
+ break ;
436
+ }
437
+ }
438
+
419
439
static struct sdhci_ops sdhci_sprd_ops = {
420
440
.read_l = sdhci_sprd_readl ,
421
441
.write_l = sdhci_sprd_writel ,
422
442
.write_w = sdhci_sprd_writew ,
423
443
.write_b = sdhci_sprd_writeb ,
424
444
.set_clock = sdhci_sprd_set_clock ,
445
+ .set_power = sdhci_sprd_set_power ,
425
446
.get_max_clock = sdhci_sprd_get_max_clock ,
426
447
.get_min_clock = sdhci_sprd_get_min_clock ,
427
448
.set_bus_width = sdhci_set_bus_width ,
@@ -823,6 +844,10 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
823
844
host -> caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 |
824
845
SDHCI_SUPPORT_DDR50 );
825
846
847
+ ret = mmc_regulator_get_supply (host -> mmc );
848
+ if (ret )
849
+ goto pm_runtime_disable ;
850
+
826
851
ret = sdhci_setup_host (host );
827
852
if (ret )
828
853
goto pm_runtime_disable ;
0 commit comments