aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/psmouse.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/psmouse.h')
-rw-r--r--drivers/input/mouse/psmouse.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index 1317bdd8cc7c..8b608a1cdd12 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -39,7 +39,7 @@ struct psmouse {
39 void *private; 39 void *private;
40 struct input_dev *dev; 40 struct input_dev *dev;
41 struct ps2dev ps2dev; 41 struct ps2dev ps2dev;
42 struct work_struct resync_work; 42 struct delayed_work resync_work;
43 char *vendor; 43 char *vendor;
44 char *name; 44 char *name;
45 unsigned char packet[8]; 45 unsigned char packet[8];
@@ -89,20 +89,24 @@ enum psmouse_type {
89 PSMOUSE_TRACKPOINT, 89 PSMOUSE_TRACKPOINT,
90 PSMOUSE_TOUCHKIT_PS2, 90 PSMOUSE_TOUCHKIT_PS2,
91 PSMOUSE_CORTRON, 91 PSMOUSE_CORTRON,
92 PSMOUSE_HGPK,
92 PSMOUSE_AUTO /* This one should always be last */ 93 PSMOUSE_AUTO /* This one should always be last */
93}; 94};
94 95
96void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
97 unsigned long delay);
95int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command); 98int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
96int psmouse_reset(struct psmouse *psmouse); 99int psmouse_reset(struct psmouse *psmouse);
100void psmouse_set_state(struct psmouse *psmouse, enum psmouse_state new_state);
97void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution); 101void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution);
98 102
99
100struct psmouse_attribute { 103struct psmouse_attribute {
101 struct device_attribute dattr; 104 struct device_attribute dattr;
102 void *data; 105 void *data;
103 ssize_t (*show)(struct psmouse *psmouse, void *data, char *buf); 106 ssize_t (*show)(struct psmouse *psmouse, void *data, char *buf);
104 ssize_t (*set)(struct psmouse *psmouse, void *data, 107 ssize_t (*set)(struct psmouse *psmouse, void *data,
105 const char *buf, size_t count); 108 const char *buf, size_t count);
109 int protect;
106}; 110};
107#define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr) 111#define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr)
108 112
@@ -111,7 +115,7 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *at
111ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *attr, 115ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *attr,
112 const char *buf, size_t count); 116 const char *buf, size_t count);
113 117
114#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \ 118#define __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, _protect) \
115static ssize_t _show(struct psmouse *, void *data, char *); \ 119static ssize_t _show(struct psmouse *, void *data, char *); \
116static ssize_t _set(struct psmouse *, void *data, const char *, size_t); \ 120static ssize_t _set(struct psmouse *, void *data, const char *, size_t); \
117static struct psmouse_attribute psmouse_attr_##_name = { \ 121static struct psmouse_attribute psmouse_attr_##_name = { \
@@ -126,6 +130,10 @@ static struct psmouse_attribute psmouse_attr_##_name = { \
126 .data = _data, \ 130 .data = _data, \
127 .show = _show, \ 131 .show = _show, \
128 .set = _set, \ 132 .set = _set, \
133 .protect = _protect, \
129} 134}
130 135
136#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
137 __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, 1)
138
131#endif /* _PSMOUSE_H */ 139#endif /* _PSMOUSE_H */