Skip to content

Commit

Permalink
staging: nvec: send suspend messages synchronously
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Dietrich authored and Greg Kroah-Hartman committed Sep 30, 2011
1 parent de839b8 commit 9feeb01
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9feeb01

Please sign in to comment.