linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2]mmc: sdhci-s3c: add to enable wakeup for sd-card
@ 2011-10-18  8:09 Jaehoon Chung
  0 siblings, 0 replies; only message in thread
From: Jaehoon Chung @ 2011-10-18  8:09 UTC (permalink / raw)
  To: linux-mmc
  Cc: Chris Ball, Kyungmin Park, linux-samsung-soc, 'kgene kim',
	Wonil Choi

Signed-off-by: Wonil Choi <wonil22.choi@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/sdhci-s3c.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 3d00e72..c544a8c 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -373,6 +373,7 @@ static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc)
 			if (pdata->ext_cd_gpio_invert)
 				status = !status;
 			sdhci_s3c_notify_change(sc->pdev, status);
+			device_init_wakeup(dev, pdata->wakeup);
 		} else {
 			dev_warn(dev, "cannot request irq for card detect\n");
 			sc->ext_cd_irq = 0;
@@ -625,13 +626,25 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
 static int sdhci_s3c_suspend(struct platform_device *dev, pm_message_t pm)
 {
 	struct sdhci_host *host = platform_get_drvdata(dev);
+	struct sdhci_s3c *sc = sdhci_priv(host);
+	int ret = 0;
+
+	ret = sdhci_suspend_host(host, pm);
+	if (!ret && device_may_wakeup(&dev->dev))
+		if (sc->ext_cd_irq)
+			enable_irq_wake(sc->ext_cd_irq);
 
-	return sdhci_suspend_host(host, pm);
+	return ret;
 }
 
 static int sdhci_s3c_resume(struct platform_device *dev)
 {
 	struct sdhci_host *host = platform_get_drvdata(dev);
+	struct sdhci_s3c *sc = sdhci_priv(host);
+
+	if (device_may_wakeup(&dev->dev))
+		if (sc->ext_cd_irq)
+			disable_irq_wake(sc->ext_cd_irq);
 
 	return sdhci_resume_host(host);
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-18  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18  8:09 [PATCH 2/2]mmc: sdhci-s3c: add to enable wakeup for sd-card Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).