All of lore.kernel.org
 help / color / mirror / Atom feed
From: MyungJoo Ham <myungjoo.ham@samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Donggeun Kim <dg77.kim@samsung.com>,
	myungjoo.ham@gmail.com
Subject: [PATCH 2/3] MFD: MAX8997: Support Wake-up from Suspend
Date: Thu, 30 Jun 2011 10:31:46 +0900	[thread overview]
Message-ID: <1309397507-24959-2-git-send-email-myungjoo.ham@samsung.com> (raw)
In-Reply-To: <1309397507-24959-1-git-send-email-myungjoo.ham@samsung.com>

- Support wake-up from suspend-to-ram.
- Handle pending interrupt after a resume.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mfd/max8997.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index f83103b..4ae42c6 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -23,6 +23,7 @@
 
 #include <linux/slab.h>
 #include <linux/i2c.h>
+#include <linux/interrupt.h>
 #include <linux/pm_runtime.h>
 #include <linux/mutex.h>
 #include <linux/mfd/core.h>
@@ -398,7 +399,29 @@ static int max8997_restore(struct device *dev)
 	return 0;
 }
 
+static int max8997_suspend(struct device *dev)
+{
+	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+	struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
+
+	if (max8997->wakeup && max8997->irq)
+		irq_set_irq_wake(max8997->irq, 1);
+	return 0;
+}
+
+static int max8997_resume(struct device *dev)
+{
+	struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
+	struct max8997_dev *max8997 = i2c_get_clientdata(i2c);
+
+	if (max8997->wakeup && max8997->irq)
+		irq_set_irq_wake(max8997->irq, 0);
+	return max8997_irq_resume(max8997);
+}
+
 const struct dev_pm_ops max8997_pm = {
+	.suspend = max8997_suspend,
+	.resume = max8997_resume,
 	.freeze = max8997_freeze,
 	.restore = max8997_restore,
 };
-- 
1.7.4.1


  reply	other threads:[~2011-06-30  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30  1:31 [PATCH 1/3] MFD: MAX8997: IRQ Handling Bugfix MyungJoo Ham
2011-06-30  1:31 ` MyungJoo Ham [this message]
2011-06-30  1:31 ` [PATCH 3/3] MFD: MAX8997: IRQ definition moved to public header MyungJoo Ham
2011-06-30  5:28   ` Mark Brown
2011-06-30  5:56     ` MyungJoo Ham
2011-06-30  5:57       ` Mark Brown
2011-06-30  8:00         ` MyungJoo Ham
2011-06-30 15:56           ` Mark Brown
2011-07-01  0:43             ` MyungJoo Ham
2011-07-04 17:16               ` Mark Brown
2011-07-05  5:57                 ` MyungJoo Ham
2011-07-05  6:19                   ` Mark Brown
2011-07-05  6:49                     ` MyungJoo Ham
2011-07-05 19:53                       ` Mark Brown

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=1309397507-24959-2-git-send-email-myungjoo.ham@samsung.com \
    --to=myungjoo.ham@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dg77.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=myungjoo.ham@gmail.com \
    --cc=sameo@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.