patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / input / mouse / psmouse.h
1 #ifndef _PSMOUSE_H
2 #define _PSMOUSE_H
3
4 #define PSMOUSE_CMD_SETSCALE11  0x00e6
5 #define PSMOUSE_CMD_SETRES      0x10e8
6 #define PSMOUSE_CMD_GETINFO     0x03e9
7 #define PSMOUSE_CMD_SETSTREAM   0x00ea
8 #define PSMOUSE_CMD_POLL        0x03eb
9 #define PSMOUSE_CMD_GETID       0x02f2
10 #define PSMOUSE_CMD_SETRATE     0x10f3
11 #define PSMOUSE_CMD_ENABLE      0x00f4
12 #define PSMOUSE_CMD_RESET_DIS   0x00f6
13 #define PSMOUSE_CMD_RESET_BAT   0x02ff
14
15 #define PSMOUSE_RET_BAT         0xaa
16 #define PSMOUSE_RET_ID          0x00
17 #define PSMOUSE_RET_ACK         0xfa
18 #define PSMOUSE_RET_NAK         0xfe
19
20 /* psmouse states */
21 #define PSMOUSE_CMD_MODE        0
22 #define PSMOUSE_ACTIVATED       1
23 #define PSMOUSE_IGNORE          2
24
25 /* psmouse protocol handler return codes */
26 typedef enum {
27         PSMOUSE_BAD_DATA,
28         PSMOUSE_GOOD_DATA,
29         PSMOUSE_FULL_PACKET
30 } psmouse_ret_t;
31
32 struct psmouse;
33
34 struct psmouse_ptport {
35         struct serio serio;
36
37         void (*activate)(struct psmouse *parent);
38         void (*deactivate)(struct psmouse *parent);
39 };
40
41 struct psmouse {
42         void *private;
43         struct input_dev dev;
44         struct serio *serio;
45         struct psmouse_ptport *ptport;
46         char *vendor;
47         char *name;
48         unsigned char cmdbuf[8];
49         unsigned char packet[8];
50         unsigned char cmdcnt;
51         unsigned char pktcnt;
52         unsigned char type;
53         unsigned char model;
54         unsigned long last;
55         unsigned long out_of_sync;
56         unsigned char state;
57         char acking;
58         volatile char ack;
59         char error;
60         char devname[64];
61         char phys[32];
62
63         psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse, struct pt_regs *regs); 
64         int (*reconnect)(struct psmouse *psmouse);
65         void (*disconnect)(struct psmouse *psmouse);
66 };
67
68 #define PSMOUSE_PS2             1
69 #define PSMOUSE_PS2PP           2
70 #define PSMOUSE_PS2TPP          3
71 #define PSMOUSE_GENPS           4
72 #define PSMOUSE_IMPS            5
73 #define PSMOUSE_IMEX            6
74 #define PSMOUSE_SYNAPTICS       7
75
76 int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
77 int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
78 int psmouse_reset(struct psmouse *psmouse);
79
80 extern int psmouse_smartscroll;
81 extern unsigned int psmouse_rate;
82
83 #endif /* _PSMOUSE_H */