15 #include <linux/module.h>
16 #include <linux/sched.h>
18 #include <linux/input.h>
19 #include <linux/serio.h>
24 #define DRIVER_DESC "PS/2 driver library"
40 serio_pause_rx(ps2dev->
serio);
43 serio_continue_rx(ps2dev->
serio);
45 if (serio_write(ps2dev->
serio, byte) == 0)
50 serio_pause_rx(ps2dev->
serio);
52 serio_continue_rx(ps2dev->
serio);
83 if (maxbytes >
sizeof(ps2dev->
cmdbuf)) {
85 maxbytes =
sizeof(ps2dev->
cmdbuf);
90 serio_pause_rx(ps2dev->
serio);
93 serio_continue_rx(ps2dev->
serio);
110 static const char keyboard_ids[] = {
119 return memchr(keyboard_ids, id_byte,
sizeof(keyboard_ids)) !=
NULL;
151 if (ps2dev->
cmdbuf[1] == 0xaa) {
152 serio_pause_rx(ps2dev->
serio);
154 serio_continue_rx(ps2dev->
serio);
163 serio_pause_rx(ps2dev->
serio);
165 serio_continue_rx(ps2dev->
serio);
187 int send = (command >> 12) & 0xf;
188 int receive = (command >> 8) & 0xf;
192 if (receive >
sizeof(ps2dev->
cmdbuf)) {
197 if (send && !param) {
202 serio_pause_rx(ps2dev->
serio);
205 if (receive && param)
206 for (i = 0; i < receive; i++)
207 ps2dev->
cmdbuf[(receive - 1) -
i] = param[
i];
208 serio_continue_rx(ps2dev->
serio);
219 for (i = 0; i <
send; i++)
233 timeout = ps2_adjust_timeout(ps2dev, command, timeout);
239 for (i = 0; i < receive; i++)
240 param[i] = ps2dev->
cmdbuf[(receive - 1) -
i];
248 serio_pause_rx(ps2dev->
serio);
250 serio_continue_rx(ps2dev->
serio);
277 ps2dev->
serio = serio;