]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: nvec: send suspend messages synchronously
authorMarc Dietrich <marvin24@gmx.de>
Tue, 27 Sep 2011 17:01:08 +0000 (19:01 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 Sep 2011 00:41:40 +0000 (17:41 -0700)
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>
drivers/staging/nvec/nvec.c

index 07c8e0952a24aeaaf615b2d2e1dbd37af4632020..fb0f0959eafaea403c45c8fe8a96531789174b3e 100644 (file)
@@ -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;