4 #define PSMOUSE_CMD_SETSCALE11 0x00e6
5 #define PSMOUSE_CMD_SETSCALE21 0x00e7
6 #define PSMOUSE_CMD_SETRES 0x10e8
7 #define PSMOUSE_CMD_GETINFO 0x03e9
8 #define PSMOUSE_CMD_SETSTREAM 0x00ea
9 #define PSMOUSE_CMD_SETPOLL 0x00f0
10 #define PSMOUSE_CMD_POLL 0x03eb
11 #define PSMOUSE_CMD_GETID 0x02f2
12 #define PSMOUSE_CMD_SETRATE 0x10f3
13 #define PSMOUSE_CMD_ENABLE 0x00f4
14 #define PSMOUSE_CMD_DISABLE 0x00f5
15 #define PSMOUSE_CMD_RESET_DIS 0x00f6
16 #define PSMOUSE_CMD_RESET_BAT 0x02ff
18 #define PSMOUSE_RET_BAT 0xaa
19 #define PSMOUSE_RET_ID 0x00
20 #define PSMOUSE_RET_ACK 0xfa
21 #define PSMOUSE_RET_NAK 0xfe
30 /* psmouse protocol handler return codes */
43 unsigned char packet
[8];
45 unsigned char pktsize
;
49 unsigned long out_of_sync
;
50 enum psmouse_state state
;
55 unsigned int resolution
;
56 unsigned int resetafter
;
57 unsigned int smartscroll
; /* Logitech only */
59 psmouse_ret_t (*protocol_handler
)(struct psmouse
*psmouse
, struct pt_regs
*regs
);
60 void (*set_rate
)(struct psmouse
*psmouse
, unsigned int rate
);
61 void (*set_resolution
)(struct psmouse
*psmouse
, unsigned int resolution
);
63 int (*reconnect
)(struct psmouse
*psmouse
);
64 void (*disconnect
)(struct psmouse
*psmouse
);
66 void (*pt_activate
)(struct psmouse
*psmouse
);
67 void (*pt_deactivate
)(struct psmouse
*psmouse
);
81 PSMOUSE_AUTO
/* This one should always be last */
84 int psmouse_sliced_command(struct psmouse
*psmouse
, unsigned char command
);
85 int psmouse_reset(struct psmouse
*psmouse
);
86 void psmouse_set_resolution(struct psmouse
*psmouse
, unsigned int resolution
);
88 ssize_t
psmouse_attr_show_helper(struct device
*dev
, char *buf
,
89 ssize_t (*handler
)(struct psmouse
*, char *));
90 ssize_t
psmouse_attr_set_helper(struct device
*dev
, const char *buf
, size_t count
,
91 ssize_t (*handler
)(struct psmouse
*, const char *, size_t));
93 #define PSMOUSE_DEFINE_ATTR(_name) \
94 static ssize_t psmouse_attr_show_##_name(struct psmouse *, char *); \
95 static ssize_t psmouse_attr_set_##_name(struct psmouse *, const char *, size_t);\
96 static ssize_t psmouse_do_show_##_name(struct device *d, struct device_attribute *attr, char *b) \
98 return psmouse_attr_show_helper(d, b, psmouse_attr_show_##_name); \
100 static ssize_t psmouse_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s)\
102 return psmouse_attr_set_helper(d, b, s, psmouse_attr_set_##_name); \
104 static struct device_attribute psmouse_attr_##_name = \
105 __ATTR(_name, S_IWUSR | S_IRUGO, \
106 psmouse_do_show_##_name, psmouse_do_set_##_name);
108 #endif /* _PSMOUSE_H */