Skip to contentSkip to conversation

mmc: sdhci-esdhc-imx: add sdio wakeup feature

PATCH In review [email protected] 2 participants 2 messages Jun 10, 2021 – Jun 11, 2021

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 mmc: sdhci-esdhc-imx: add sdio wakeup feature

From: Haibo Chen <[email protected]>

Set the wakeup capability for the SDIO device which can wakeup system. And user can enable this wakeup through sysfs interface.

---
 drivers/mmc/host/sdhci-esdhc-imx.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mmc/host/sdhci-esdhc-imx.c +8 -0
index 7336ae749137..72c0bf0c1887 100644
@@ -1620,6 +1620,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	if (err)
 		goto disable_ahb_clk;
 
+	/*
+	 * Setup the wakeup capability here, let user to decide
+	 * whether need to enable this wakeup through sysfs interface.
+	 */
+	if ((host->mmc->pm_caps & MMC_PM_KEEP_POWER) &&
+			(host->mmc->pm_caps & MMC_PM_WAKE_SDIO_IRQ))
+		device_set_wakeup_capable(&pdev->dev, true);
+
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
 	pm_runtime_use_autosuspend(&pdev->dev);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · On Thu, 10 Jun 2021 at 14:19, <[email protected]> wrote:

From: Haibo Chen <[email protected]>

Set the wakeup capability for the SDIO device which can wakeup system. And user can enable this wakeup through sysfs interface.

Applied for next, thanks!

Kind regards
Uffe

Quoted 26 lines
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/mmc/host/sdhci-esdhc-imx.c +8 -1
index 7336ae749137..72c0bf0c1887 100644
@@ -1620,6 +1620,14 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
        if (err)
                goto disable_ahb_clk;
 
+       /*
+        * Setup the wakeup capability here, let user to decide
+        * whether need to enable this wakeup through sysfs interface.
+        */
+       if ((host->mmc->pm_caps & MMC_PM_KEEP_POWER) &&
+                       (host->mmc->pm_caps & MMC_PM_WAKE_SDIO_IRQ))
+               device_set_wakeup_capable(&pdev->dev, true);
+
        pm_runtime_set_active(&pdev->dev);
        pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
        pm_runtime_use_autosuspend(&pdev->dev);
--

2.17.1