aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 002781c5a616..132b0019365e 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -225,7 +225,10 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
225 * Verify and convert units. 225 * Verify and convert units.
226 * See HID specification v1.11 6.2.2.7 Global Items for unit decoding 226 * See HID specification v1.11 6.2.2.7 Global Items for unit decoding
227 */ 227 */
228 if (code == ABS_X || code == ABS_Y || code == ABS_Z) { 228 switch (code) {
229 case ABS_X:
230 case ABS_Y:
231 case ABS_Z:
229 if (field->unit == 0x11) { /* If centimeters */ 232 if (field->unit == 0x11) { /* If centimeters */
230 /* Convert to millimeters */ 233 /* Convert to millimeters */
231 unit_exponent += 1; 234 unit_exponent += 1;
@@ -239,7 +242,13 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
239 } else { 242 } else {
240 return 0; 243 return 0;
241 } 244 }
242 } else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) { 245 break;
246
247 case ABS_RX:
248 case ABS_RY:
249 case ABS_RZ:
250 case ABS_TILT_X:
251 case ABS_TILT_Y:
243 if (field->unit == 0x14) { /* If degrees */ 252 if (field->unit == 0x14) { /* If degrees */
244 /* Convert to radians */ 253 /* Convert to radians */
245 prev = logical_extents; 254 prev = logical_extents;
@@ -250,7 +259,9 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
250 } else if (field->unit != 0x12) { /* If not radians */ 259 } else if (field->unit != 0x12) { /* If not radians */
251 return 0; 260 return 0;
252 } 261 }
253 } else { 262 break;
263
264 default:
254 return 0; 265 return 0;
255 } 266 }
256 267
@@ -623,6 +634,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
623 map_key_clear(BTN_TOOL_RUBBER); 634 map_key_clear(BTN_TOOL_RUBBER);
624 break; 635 break;
625 636
637 case 0x3d: /* X Tilt */
638 map_abs_clear(ABS_TILT_X);
639 break;
640
641 case 0x3e: /* Y Tilt */
642 map_abs_clear(ABS_TILT_Y);
643 break;
644
626 case 0x33: /* Touch */ 645 case 0x33: /* Touch */
627 case 0x42: /* TipSwitch */ 646 case 0x42: /* TipSwitch */
628 case 0x43: /* TipSwitch2 */ 647 case 0x43: /* TipSwitch2 */
@@ -638,10 +657,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
638 map_key_clear(BTN_STYLUS2); 657 map_key_clear(BTN_STYLUS2);
639 break; 658 break;
640 659
641 case 0x51: /* ContactID */
642 device->quirks |= HID_QUIRK_MULTITOUCH;
643 goto unknown;
644
645 default: goto unknown; 660 default: goto unknown;
646 } 661 }
647 break; 662 break;
@@ -1208,13 +1223,6 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
1208 } 1223 }
1209 } 1224 }
1210 1225
1211 if (hid->quirks & HID_QUIRK_MULTITOUCH) {
1212 /* generic hid does not know how to handle multitouch devices */
1213 if (hidinput)
1214 goto out_cleanup;
1215 goto out_unwind;
1216 }
1217
1218 if (hidinput && input_register_device(hidinput->input)) 1226 if (hidinput && input_register_device(hidinput->input))
1219 goto out_cleanup; 1227 goto out_cleanup;
1220 1228