aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/mmc.c12
-rw-r--r--drivers/mmc/core/sd.c12
-rw-r--r--include/linux/mmc/host.h1
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 7f5dc26865de..f631f5a9bf79 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1577,11 +1577,13 @@ static int mmc_shutdown(struct mmc_host *host)
1577 */ 1577 */
1578static int mmc_resume(struct mmc_host *host) 1578static int mmc_resume(struct mmc_host *host)
1579{ 1579{
1580 int err; 1580 int err = 0;
1581 1581
1582 err = _mmc_resume(host); 1582 if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) {
1583 pm_runtime_set_active(&host->card->dev); 1583 err = _mmc_resume(host);
1584 pm_runtime_mark_last_busy(&host->card->dev); 1584 pm_runtime_set_active(&host->card->dev);
1585 pm_runtime_mark_last_busy(&host->card->dev);
1586 }
1585 pm_runtime_enable(&host->card->dev); 1587 pm_runtime_enable(&host->card->dev);
1586 1588
1587 return err; 1589 return err;
@@ -1612,7 +1614,7 @@ static int mmc_runtime_resume(struct mmc_host *host)
1612{ 1614{
1613 int err; 1615 int err;
1614 1616
1615 if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) 1617 if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
1616 return 0; 1618 return 0;
1617 1619
1618 err = _mmc_resume(host); 1620 err = _mmc_resume(host);
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 447fa8e9f322..6f42050b7ccc 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1139,11 +1139,13 @@ out:
1139 */ 1139 */
1140static int mmc_sd_resume(struct mmc_host *host) 1140static int mmc_sd_resume(struct mmc_host *host)
1141{ 1141{
1142 int err; 1142 int err = 0;
1143 1143
1144 err = _mmc_sd_resume(host); 1144 if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) {
1145 pm_runtime_set_active(&host->card->dev); 1145 err = _mmc_sd_resume(host);
1146 pm_runtime_mark_last_busy(&host->card->dev); 1146 pm_runtime_set_active(&host->card->dev);
1147 pm_runtime_mark_last_busy(&host->card->dev);
1148 }
1147 pm_runtime_enable(&host->card->dev); 1149 pm_runtime_enable(&host->card->dev);
1148 1150
1149 return err; 1151 return err;
@@ -1174,7 +1176,7 @@ static int mmc_sd_runtime_resume(struct mmc_host *host)
1174{ 1176{
1175 int err; 1177 int err;
1176 1178
1177 if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) 1179 if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
1178 return 0; 1180 return 0;
1179 1181
1180 err = _mmc_sd_resume(host); 1182 err = _mmc_sd_resume(host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index f18669e15d4d..99f5709ac343 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -254,6 +254,7 @@ struct mmc_host {
254#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ 254#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */
255#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ 255#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */
256#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ 256#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */
257#define MMC_CAP_RUNTIME_RESUME (1 << 20) /* Resume at runtime_resume. */
257#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ 258#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
258#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ 259#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
259#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ 260#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */