aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-wacom.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 17bb88f782b..db232231048 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -177,26 +177,13 @@ static ssize_t wacom_store_speed(struct device *dev,
177static DEVICE_ATTR(speed, S_IRUGO | S_IWUSR | S_IWGRP, 177static DEVICE_ATTR(speed, S_IRUGO | S_IWUSR | S_IWGRP,
178 wacom_show_speed, wacom_store_speed); 178 wacom_show_speed, wacom_store_speed);
179 179
180static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report, 180static int wacom_gr_parse_report(struct hid_device *hdev,
181 u8 *raw_data, int size) 181 struct wacom_data *wdata,
182 struct input_dev *input, unsigned char *data)
182{ 183{
183 struct wacom_data *wdata = hid_get_drvdata(hdev);
184 struct hid_input *hidinput;
185 struct input_dev *input;
186 unsigned char *data = (unsigned char *) raw_data;
187 int tool, x, y, rw; 184 int tool, x, y, rw;
188 185
189 if (!(hdev->claimed & HID_CLAIMED_INPUT))
190 return 0;
191
192 tool = 0; 186 tool = 0;
193 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
194 input = hidinput->input;
195
196 /* Check if this is a tablet report */
197 if (data[0] != 0x03)
198 return 0;
199
200 /* Get X & Y positions */ 187 /* Get X & Y positions */
201 x = le16_to_cpu(*(__le16 *) &data[2]); 188 x = le16_to_cpu(*(__le16 *) &data[2]);
202 y = le16_to_cpu(*(__le16 *) &data[4]); 189 y = le16_to_cpu(*(__le16 *) &data[4]);
@@ -303,6 +290,26 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
303#endif 290#endif
304 return 1; 291 return 1;
305} 292}
293static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
294 u8 *raw_data, int size)
295{
296 struct wacom_data *wdata = hid_get_drvdata(hdev);
297 struct hid_input *hidinput;
298 struct input_dev *input;
299 unsigned char *data = (unsigned char *) raw_data;
300
301 if (!(hdev->claimed & HID_CLAIMED_INPUT))
302 return 0;
303
304 hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
305 input = hidinput->input;
306
307 /* Check if this is a tablet report */
308 if (data[0] != 0x03)
309 return 0;
310
311 return wacom_gr_parse_report(hdev, wdata, input, data);
312}
306 313
307static int wacom_input_mapped(struct hid_device *hdev, struct hid_input *hi, 314static int wacom_input_mapped(struct hid_device *hdev, struct hid_input *hi,
308 struct hid_field *field, struct hid_usage *usage, unsigned long **bit, 315 struct hid_field *field, struct hid_usage *usage, unsigned long **bit,