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 */
39 struct input_dev
*dev
;
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
);
82 PSMOUSE_AUTO
/* This one should always be last */
85 int psmouse_sliced_command(struct psmouse
*psmouse
, unsigned char command
);
86 int psmouse_reset(struct psmouse
*psmouse
);
87 void psmouse_set_resolution(struct psmouse
*psmouse
, unsigned int resolution
);
90 struct psmouse_attribute
{
91 struct device_attribute dattr
;
93 ssize_t (*show
)(struct psmouse
*psmouse
, void *data
, char *buf
);
94 ssize_t (*set
)(struct psmouse
*psmouse
, void *data
,
95 const char *buf
, size_t count
);
97 #define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr)
99 ssize_t
psmouse_attr_show_helper(struct device
*dev
, struct device_attribute
*attr
,
101 ssize_t
psmouse_attr_set_helper(struct device
*dev
, struct device_attribute
*attr
,
102 const char *buf
, size_t count
);
104 #define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
105 static ssize_t _show(struct psmouse *, void *data, char *); \
106 static ssize_t _set(struct psmouse *, void *data, const char *, size_t); \
107 static struct psmouse_attribute psmouse_attr_##_name = { \
110 .name = __stringify(_name), \
112 .owner = THIS_MODULE, \
114 .show = psmouse_attr_show_helper, \
115 .store = psmouse_attr_set_helper, \
122 #endif /* _PSMOUSE_H */