summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAniruddha Rao <anrao@nvidia.com>2022-01-13 10:46:09 +0530
committerUlf Hansson <ulf.hansson@linaro.org>2022-02-28 13:06:21 +0100
commit48f6daf188ef51ee60b3dd0a38aff8cc14f14ffb (patch)
treecea3b3e0e7c0a35274b750f9b4202a6e1b14e959 /drivers/mmc
parentb59294d65ae5740e79d70c6712d91f76a667ee2e (diff)
downloadlinux-48f6daf188ef51ee60b3dd0a38aff8cc14f14ffb.tar.bz2
mmc: sdhci-tegra: Enable wake on SD card event
Enable GPIO wake source on SD card detect line. Physical card insertion/removal event should wake the system from suspend. Signed-off-by: Aniruddha Rao <anrao@nvidia.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1642050969-21152-1-git-send-email-anrao@nvidia.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 35ebba067e87..5c84bd5764ee 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1673,6 +1673,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
/* HW busy detection is supported, but R1B responses are required. */
host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
+ /* GPIO CD can be set as a wakeup source */
+ host->mmc->caps |= MMC_CAP_CD_WAKE;
+
tegra_sdhci_parse_dt(host);
tegra_host->power_gpio = devm_gpiod_get_optional(&pdev->dev, "power",
@@ -1840,7 +1843,7 @@ static int sdhci_tegra_suspend(struct device *dev)
return ret;
}
- return 0;
+ return mmc_gpio_set_cd_wake(host->mmc, true);
}
static int sdhci_tegra_resume(struct device *dev)
@@ -1848,6 +1851,10 @@ static int sdhci_tegra_resume(struct device *dev)
struct sdhci_host *host = dev_get_drvdata(dev);
int ret;
+ ret = mmc_gpio_set_cd_wake(host->mmc, false);
+ if (ret)
+ return ret;
+
ret = pm_runtime_force_resume(dev);
if (ret)
return ret;