lkml.org 
[lkml]   [2011]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRE: [PATCH] mfd: call disable_irq()/enable_irq() in suspend/resume
Hi, all
Does there have any updates for this patch?

Thanks
Wei.

-----Original Message-----
From: Wei Ni
Sent: Wednesday, March 30, 2011 2:20 PM
To: sameo@linux.intel.com; linux-kernel@vger.kernel.org
Cc: ccross@android.com; Varun Wadekar; Wei Ni; Emily Jiang
Subject: RE: [PATCH] mfd: call disable_irq()/enable_irq() in suspend/resume

Hi, all
Could anyone review this patch?

Thanks
Wei.

-----Original Message-----
From: Wei Ni
Sent: Tuesday, March 29, 2011 2:17 PM
To: sameo@linux.intel.com; linux-kernel@vger.kernel.org
Cc: ccross@android.com; Varun Wadekar; Wei Ni
Subject: [PATCH] mfd: call disable_irq()/enable_irq() in suspend/resume

From: Wei Ni <wni@nvidia.com>

When use rtc tps6586x wakealarm to suspend/resume system,
it will show a lot error messages:
"tps6586x 4-0034: failed to read interrupt status
tps6586x 4-0034: failed reading from 0xb5"
After resume, the system will call the mfd tps6586x driver's interrupt handle
tps6586x_irq(). This handle will read tps6586x interrupt status (0xb5), but at
that time the i2c driver didn't resume yet, so the reading will be failed.
I call the disble_irq in the suspend, and enable_irq in the resume, which will
delay the delivery of the irq until the i2c driver has been resumed.

Signed-off-by: Wei Ni <wni@nvidia.com>
---
drivers/mfd/tps6586x.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index b600808..c7bd96b 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -569,6 +569,22 @@ static const struct i2c_device_id tps6586x_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, tps6586x_id_table);

+#ifdef CONFIG_PM
+static int tps6586x_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ if (client->irq)
+ disable_irq(client->irq);
+ return 0;
+}
+
+static int tps6586x_resume(struct i2c_client *client)
+{
+ if (client->irq)
+ enable_irq(client->irq);
+ return 0;
+}
+#endif
+
static struct i2c_driver tps6586x_driver = {
.driver = {
.name = "tps6586x",
@@ -577,6 +593,10 @@ static struct i2c_driver tps6586x_driver = {
.probe = tps6586x_i2c_probe,
.remove = __devexit_p(tps6586x_i2c_remove),
.id_table = tps6586x_id_table,
+#ifdef CONFIG_PM
+ .suspend = tps6586x_suspend,
+ .resume = tps6586x_resume,
+#endif
};

static int __init tps6586x_init(void)
--
1.7.0


\
 
 \ /
  Last update: 2011-04-18 11:59    [W:0.908 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site