aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libps2.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/libps2.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/libps2.h')
-rw-r--r--include/linux/libps2.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
new file mode 100644
index 000000000000..923bdbc6d9e4
--- /dev/null
+++ b/include/linux/libps2.h
@@ -0,0 +1,50 @@
1#ifndef _LIBPS2_H
2#define _LIBPS2_H
3
4/*
5 * Copyright (C) 1999-2002 Vojtech Pavlik
6 * Copyright (C) 2004 Dmitry Torokhov
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published by
10 * the Free Software Foundation.
11 */
12
13
14#define PS2_CMD_GETID 0x02f2
15#define PS2_CMD_RESET_BAT 0x02ff
16
17#define PS2_RET_BAT 0xaa
18#define PS2_RET_ID 0x00
19#define PS2_RET_ACK 0xfa
20#define PS2_RET_NAK 0xfe
21
22#define PS2_FLAG_ACK 1 /* Waiting for ACK/NAK */
23#define PS2_FLAG_CMD 2 /* Waiting for command to finish */
24#define PS2_FLAG_CMD1 4 /* Waiting for the first byte of command response */
25#define PS2_FLAG_WAITID 8 /* Command execiting is GET ID */
26
27struct ps2dev {
28 struct serio *serio;
29
30 /* Ensures that only one command is executing at a time */
31 struct semaphore cmd_sem;
32
33 /* Used to signal completion from interrupt handler */
34 wait_queue_head_t wait;
35
36 unsigned long flags;
37 unsigned char cmdbuf[6];
38 unsigned char cmdcnt;
39 unsigned char nak;
40};
41
42void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
43int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
44int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
45int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command);
46int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
47int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data);
48void ps2_cmd_aborted(struct ps2dev *ps2dev);
49
50#endif /* _LIBPS2_H */