diff options
Diffstat (limited to 'drivers/input/tablet/wacom_sys.c')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index c37e22b968d9..d90f4e00e51d 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -100,20 +100,6 @@ static void wacom_sys_irq(struct urb *urb) | |||
100 | __func__, retval); | 100 | __func__, retval); |
101 | } | 101 | } |
102 | 102 | ||
103 | __u16 wacom_be16_to_cpu(unsigned char *data) | ||
104 | { | ||
105 | __u16 value; | ||
106 | value = be16_to_cpu(*(__be16 *) data); | ||
107 | return value; | ||
108 | } | ||
109 | |||
110 | __u16 wacom_le16_to_cpu(unsigned char *data) | ||
111 | { | ||
112 | __u16 value; | ||
113 | value = le16_to_cpu(*(__le16 *) data); | ||
114 | return value; | ||
115 | } | ||
116 | |||
117 | static int wacom_open(struct input_dev *dev) | 103 | static int wacom_open(struct input_dev *dev) |
118 | { | 104 | { |
119 | struct wacom *wacom = input_get_drvdata(dev); | 105 | struct wacom *wacom = input_get_drvdata(dev); |
@@ -210,9 +196,9 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
210 | features->device_type = BTN_TOOL_TRIPLETAP; | 196 | features->device_type = BTN_TOOL_TRIPLETAP; |
211 | } | 197 | } |
212 | features->x_max = | 198 | features->x_max = |
213 | wacom_le16_to_cpu(&report[i + 3]); | 199 | get_unaligned_le16(&report[i + 3]); |
214 | features->x_phy = | 200 | features->x_phy = |
215 | wacom_le16_to_cpu(&report[i + 6]); | 201 | get_unaligned_le16(&report[i + 6]); |
216 | features->unit = report[i + 9]; | 202 | features->unit = report[i + 9]; |
217 | features->unitExpo = report[i + 11]; | 203 | features->unitExpo = report[i + 11]; |
218 | i += 12; | 204 | i += 12; |
@@ -222,7 +208,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
222 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | 208 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
223 | features->device_type = BTN_TOOL_PEN; | 209 | features->device_type = BTN_TOOL_PEN; |
224 | features->x_max = | 210 | features->x_max = |
225 | wacom_le16_to_cpu(&report[i + 3]); | 211 | get_unaligned_le16(&report[i + 3]); |
226 | i += 4; | 212 | i += 4; |
227 | } | 213 | } |
228 | } else if (usage == WCM_DIGITIZER) { | 214 | } else if (usage == WCM_DIGITIZER) { |
@@ -244,15 +230,15 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
244 | features->pktlen = WACOM_PKGLEN_TPC2FG; | 230 | features->pktlen = WACOM_PKGLEN_TPC2FG; |
245 | features->device_type = BTN_TOOL_TRIPLETAP; | 231 | features->device_type = BTN_TOOL_TRIPLETAP; |
246 | features->y_max = | 232 | features->y_max = |
247 | wacom_le16_to_cpu(&report[i + 3]); | 233 | get_unaligned_le16(&report[i + 3]); |
248 | features->y_phy = | 234 | features->y_phy = |
249 | wacom_le16_to_cpu(&report[i + 6]); | 235 | get_unaligned_le16(&report[i + 6]); |
250 | i += 7; | 236 | i += 7; |
251 | } else { | 237 | } else { |
252 | features->y_max = | 238 | features->y_max = |
253 | features->x_max; | 239 | features->x_max; |
254 | features->y_phy = | 240 | features->y_phy = |
255 | wacom_le16_to_cpu(&report[i + 3]); | 241 | get_unaligned_le16(&report[i + 3]); |
256 | i += 4; | 242 | i += 4; |
257 | } | 243 | } |
258 | } else if (pen) { | 244 | } else if (pen) { |
@@ -261,7 +247,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
261 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; | 247 | features->pktlen = WACOM_PKGLEN_GRAPHIRE; |
262 | features->device_type = BTN_TOOL_PEN; | 248 | features->device_type = BTN_TOOL_PEN; |
263 | features->y_max = | 249 | features->y_max = |
264 | wacom_le16_to_cpu(&report[i + 3]); | 250 | get_unaligned_le16(&report[i + 3]); |
265 | i += 4; | 251 | i += 4; |
266 | } | 252 | } |
267 | } | 253 | } |
@@ -280,7 +266,7 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
280 | case HID_USAGE_UNDEFINED: | 266 | case HID_USAGE_UNDEFINED: |
281 | if (usage == WCM_DESKTOP && finger) /* capacity */ | 267 | if (usage == WCM_DESKTOP && finger) /* capacity */ |
282 | features->pressure_max = | 268 | features->pressure_max = |
283 | wacom_le16_to_cpu(&report[i + 3]); | 269 | get_unaligned_le16(&report[i + 3]); |
284 | i += 4; | 270 | i += 4; |
285 | break; | 271 | break; |
286 | } | 272 | } |