aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2011-12-26 17:57:32 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-31 10:27:57 -0800
commitd1b5342c1f5946c2219e4e5bd770b1c1fc186272 (patch)
tree4c3fee0ea7ea7bc5a661b6129b8ba24dd3f525bd /drivers/staging/nvec
parentstaging: sep: Fix warnings caused by sizeof() types (diff)
downloadlinux-dev-d1b5342c1f5946c2219e4e5bd770b1c1fc186272.tar.xz
linux-dev-d1b5342c1f5946c2219e4e5bd770b1c1fc186272.zip
staging: nvec: ps2: add suspend/resume functions
This adds suspend and resume functions to the nvec_ps2 mouse driver. During suspend the nvec sends a "Cancel all mouse events" command. If this is missed, there will be still some bytes in the received buffer after resume which make the mouse go out of sync. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec_ps2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 742f5ccfe763..4410dfb3e33b 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -111,8 +111,27 @@ static int __devinit nvec_mouse_probe(struct platform_device *pdev)
return 0;
}
+static int nvec_mouse_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
+
+ /* send cancel autoreceive */
+ nvec_write_async(nvec, "\x06\x04", 2);
+
+ return 0;
+}
+
+static int nvec_mouse_resume(struct platform_device *pdev)
+{
+ ps2_startstreaming(ps2_dev.ser_dev);
+
+ return 0;
+}
+
static struct platform_driver nvec_mouse_driver = {
.probe = nvec_mouse_probe,
+ .suspend = nvec_mouse_suspend,
+ .resume = nvec_mouse_resume,
.driver = {
.name = "nvec-mouse",
.owner = THIS_MODULE,