aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2011-09-27 19:01:08 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-29 17:41:40 -0700
commit9feeb0147fe6ae3158db5f319faded5e763744f9 (patch)
tree33c9c66dc018350b16294cc41499402136a834d0
parentde839b8f06bc5dd3f5037c4409a720cbb9bf21c3 (diff)
downloadkernel_goldelico_gta04-9feeb0147fe6ae3158db5f319faded5e763744f9.zip
kernel_goldelico_gta04-9feeb0147fe6ae3158db5f319faded5e763744f9.tar.gz
kernel_goldelico_gta04-9feeb0147fe6ae3158db5f319faded5e763744f9.tar.bz2
staging: nvec: send suspend messages synchronously
The suspend commands need to be sent using the synchronous method, otherwise the power gets disabled before the messages are transferred. Signed-off-by: Marc Dietrich <marvin24@gmx.de> [jak@jak-linux.org: Rewrote commit message] Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/nvec/nvec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 07c8e09..fb0f095 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -861,10 +861,16 @@ static int __devexit tegra_nvec_remove(struct platform_device *pdev)
static int tegra_nvec_suspend(struct platform_device *pdev, pm_message_t state)
{
struct nvec_chip *nvec = platform_get_drvdata(pdev);
+ struct nvec_msg *msg;
dev_dbg(nvec->dev, "suspending\n");
- nvec_write_async(nvec, EC_DISABLE_EVENT_REPORTING, 3);
- nvec_write_async(nvec, "\x04\x02", 2);
+
+ /* keep these sync or you'll break suspend */
+ msg = nvec_write_sync(nvec, EC_DISABLE_EVENT_REPORTING, 3);
+ nvec_msg_free(nvec, msg);
+ msg = nvec_write_sync(nvec, "\x04\x02", 2);
+ nvec_msg_free(nvec, msg);
+
nvec_disable_i2c_slave(nvec);
return 0;