linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: linux-mmc <linux-mmc@vger.kernel.org>
Cc: Chris Ball <cjb@laptop.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	'kgene kim' <kgene.kim@samsung.com>,
	Wonil Choi <wonil22.choi@samsung.com>
Subject: [PATCH 2/2]mmc: sdhci-s3c: add to enable wakeup for sd-card
Date: Tue, 18 Oct 2011 17:09:29 +0900	[thread overview]
Message-ID: <4E9D3439.1000809@samsung.com> (raw)

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);
 }

                 reply	other threads:[~2011-10-18  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E9D3439.1000809@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=cjb@laptop.org \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=wonil22.choi@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).