16 #include <linux/module.h>
17 #include <linux/slab.h>
18 #include <linux/serio.h>
24 #define START_STREAMING {'\x06', '\x03', '\x06'}
25 #define STOP_STREAMING {'\x06', '\x04'}
26 #define SEND_COMMAND {'\x06', '\x01', '\xf4', '\x01'}
29 #define NVEC_PHD(str, buf, len) \
30 print_hex_dump(KERN_DEBUG, str, DUMP_PREFIX_NONE, \
31 16, 1, buf, len, false)
33 #define NVEC_PHD(str, buf, len)
36 static const unsigned char MOUSE_RESET[] = {
'\x06',
'\x01',
'\xff',
'\x03'};
64 dev_dbg(&ser_dev->
dev,
"Sending ps2 cmd %02x\n", cmd);
72 unsigned char *
msg = (
unsigned char *)data;
76 for (i = 0; i < msg[1]; i++)
78 NVEC_PHD(
"ps/2 mouse event: ", &msg[2], msg[1]);
83 for (i = 0; i < (msg[1] - 2); i++)
85 NVEC_PHD(
"ps/2 mouse reply: ", &msg[4], msg[1] - 2);
89 NVEC_PHD(
"unhandled mouse event: ", msg, msg[1] + 2);
99 struct serio *ser_dev;
106 ser_dev->
write = ps2_sendcommand;
107 ser_dev->
start = ps2_startstreaming;
108 ser_dev->
stop = ps2_stopstreaming;
113 ps2_dev.ser_dev = ser_dev;
114 ps2_dev.notifier.notifier_call = nvec_ps2_notifier;
133 #ifdef CONFIG_PM_SLEEP
134 static int nvec_mouse_suspend(
struct device *
dev)
148 static int nvec_mouse_resume(
struct device *
dev)
153 ps2_startstreaming(ps2_dev.ser_dev);
166 .probe = nvec_mouse_probe,
169 .name =
"nvec-mouse",
171 .pm = &nvec_mouse_pm_ops,