diff options
author | Marc Dietrich <marvin24@gmx.de> | 2013-01-27 17:43:42 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-29 23:25:09 -0500 |
commit | 85a90528b2b4f2d38a56df5b3f137223983aad4b (patch) | |
tree | c95c3b5b441b26abd8edfcd4a4ef9036155312b4 | |
parent | 518945fbfbe9e2bc39057115aa23e25b084a03e0 (diff) |
staging: nvec: fix mouse suspend/resume calls
The EC command for enable/disable is not an EC command. Instead it needs
to be send to the mouse.
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/nvec/nvec_ps2.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c index 88dd288bf3d7..b1a5a9604ce1 100644 --- a/drivers/staging/nvec/nvec_ps2.c +++ b/drivers/staging/nvec/nvec_ps2.c @@ -25,6 +25,9 @@ #define STOP_STREAMING {'\x06', '\x04'} #define SEND_COMMAND {'\x06', '\x01', '\xf4', '\x01'} +#define ENABLE_MOUSE 0xf4 +#define DISABLE_MOUSE 0xf5 + #ifdef NVEC_PS2_DEBUG #define NVEC_PHD(str, buf, len) \ print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \ @@ -133,27 +136,22 @@ static int nvec_mouse_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int nvec_mouse_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); - /* disable mouse */ - nvec_write_async(nvec, "\x06\xf4", 2); + ps2_sendcommand(ps2_dev.ser_dev, DISABLE_MOUSE); /* send cancel autoreceive */ - nvec_write_async(nvec, "\x06\x04", 2); + ps2_stopstreaming(ps2_dev.ser_dev); return 0; } static int nvec_mouse_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent); - + /* start streaming */ ps2_startstreaming(ps2_dev.ser_dev); /* enable mouse */ - nvec_write_async(nvec, "\x06\xf5", 2); + ps2_sendcommand(ps2_dev.ser_dev, ENABLE_MOUSE); return 0; } |