Commit 155e3a353943a3e713cd33357cfd58e995900a81

Authored by Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input layer updates from Dmitry Torokhov:
 "Just a couple of new IDs in Wacom and xpad drivers, i8042 is now
  disabled on ARC, and data checks in Elantech driver that were overly
  relaxed by the previous patch are now tightened"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: i8042 - disable the driver on ARC platforms
  Input: xpad - add signature for Razer Onza Classic Edition
  Input: elantech - fix packet check for v3 and v4 hardware
  Input: wacom - add support for 0x300 and 0x301

Showing 5 changed files Side-by-side Diff

drivers/input/joystick/xpad.c
... ... @@ -167,6 +167,7 @@
167 167 { 0x1430, 0x8888, "TX6500+ Dance Pad (first generation)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
168 168 { 0x146b, 0x0601, "BigBen Interactive XBOX 360 Controller", 0, XTYPE_XBOX360 },
169 169 { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
  170 + { 0x1689, 0xfd01, "Razer Onza Classic Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
170 171 { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
171 172 { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
172 173 { 0x1bad, 0xf016, "Mad Catz Xbox 360 Controller", 0, XTYPE_XBOX360 },
drivers/input/mouse/elantech.c
... ... @@ -672,6 +672,7 @@
672 672 */
673 673 static int elantech_packet_check_v3(struct psmouse *psmouse)
674 674 {
  675 + struct elantech_data *etd = psmouse->private;
675 676 const u8 debounce_packet[] = { 0xc4, 0xff, 0xff, 0x02, 0xff, 0xff };
676 677 unsigned char *packet = psmouse->packet;
677 678  
678 679  
679 680  
680 681  
681 682  
682 683  
... ... @@ -682,20 +683,49 @@
682 683 if (!memcmp(packet, debounce_packet, sizeof(debounce_packet)))
683 684 return PACKET_DEBOUNCE;
684 685  
685   - if ((packet[0] & 0x0c) == 0x04 && (packet[3] & 0xcf) == 0x02)
686   - return PACKET_V3_HEAD;
  686 + /*
  687 + * If the hardware flag 'crc_enabled' is set the packets have
  688 + * different signatures.
  689 + */
  690 + if (etd->crc_enabled) {
  691 + if ((packet[3] & 0x09) == 0x08)
  692 + return PACKET_V3_HEAD;
687 693  
688   - if ((packet[0] & 0x0c) == 0x0c && (packet[3] & 0xce) == 0x0c)
689   - return PACKET_V3_TAIL;
  694 + if ((packet[3] & 0x09) == 0x09)
  695 + return PACKET_V3_TAIL;
  696 + } else {
  697 + if ((packet[0] & 0x0c) == 0x04 && (packet[3] & 0xcf) == 0x02)
  698 + return PACKET_V3_HEAD;
690 699  
  700 + if ((packet[0] & 0x0c) == 0x0c && (packet[3] & 0xce) == 0x0c)
  701 + return PACKET_V3_TAIL;
  702 + }
  703 +
691 704 return PACKET_UNKNOWN;
692 705 }
693 706  
694 707 static int elantech_packet_check_v4(struct psmouse *psmouse)
695 708 {
  709 + struct elantech_data *etd = psmouse->private;
696 710 unsigned char *packet = psmouse->packet;
697 711 unsigned char packet_type = packet[3] & 0x03;
  712 + bool sanity_check;
698 713  
  714 + /*
  715 + * Sanity check based on the constant bits of a packet.
  716 + * The constant bits change depending on the value of
  717 + * the hardware flag 'crc_enabled' but are the same for
  718 + * every packet, regardless of the type.
  719 + */
  720 + if (etd->crc_enabled)
  721 + sanity_check = ((packet[3] & 0x08) == 0x00);
  722 + else
  723 + sanity_check = ((packet[0] & 0x0c) == 0x04 &&
  724 + (packet[3] & 0x1c) == 0x10);
  725 +
  726 + if (!sanity_check)
  727 + return PACKET_UNKNOWN;
  728 +
699 729 switch (packet_type) {
700 730 case 0:
701 731 return PACKET_V4_STATUS;
... ... @@ -1312,6 +1342,12 @@
1312 1342 if (etd->fw_version >= 0x020800)
1313 1343 etd->reports_pressure = true;
1314 1344 }
  1345 +
  1346 + /*
  1347 + * The signatures of v3 and v4 packets change depending on the
  1348 + * value of this hardware flag.
  1349 + */
  1350 + etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000);
1315 1351  
1316 1352 return 0;
1317 1353 }
drivers/input/mouse/elantech.h
... ... @@ -129,6 +129,7 @@
129 129 bool paritycheck;
130 130 bool jumpy_cursor;
131 131 bool reports_pressure;
  132 + bool crc_enabled;
132 133 unsigned char hw_version;
133 134 unsigned int fw_version;
134 135 unsigned int single_finger_reports;
drivers/input/serio/Kconfig
... ... @@ -22,7 +22,8 @@
22 22 tristate "i8042 PC Keyboard controller" if EXPERT || !X86
23 23 default y
24 24 depends on !PARISC && (!ARM || ARCH_SHARK || FOOTBRIDGE_HOST) && \
25   - (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390
  25 + (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
  26 + !ARC
26 27 help
27 28 i8042 is the chip over which the standard AT keyboard and PS/2
28 29 mouse are connected to the computer. If you use these devices,
drivers/input/tablet/wacom_wac.c
... ... @@ -2112,7 +2112,7 @@
2112 2112 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
2113 2113 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2114 2114 .touch_max = 2 };
2115   -static struct wacom_features wacom_features_0xDB =
  2115 +static const struct wacom_features wacom_features_0xDB =
2116 2116 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
2117 2117 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2118 2118 .touch_max = 2 };
... ... @@ -2127,6 +2127,12 @@
2127 2127 { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023,
2128 2128 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2129 2129 .touch_max = 16 };
  2130 +static const struct wacom_features wacom_features_0x300 =
  2131 + { "Wacom Bamboo One S", WACOM_PKGLEN_BBPEN, 14720, 9225, 1023,
  2132 + 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  2133 +static const struct wacom_features wacom_features_0x301 =
  2134 + { "Wacom Bamboo One M", WACOM_PKGLEN_BBPEN, 21648, 13530, 1023,
  2135 + 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2130 2136 static const struct wacom_features wacom_features_0x6004 =
2131 2137 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
2132 2138 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
... ... @@ -2253,6 +2259,8 @@
2253 2259 { USB_DEVICE_WACOM(0x100) },
2254 2260 { USB_DEVICE_WACOM(0x101) },
2255 2261 { USB_DEVICE_WACOM(0x10D) },
  2262 + { USB_DEVICE_WACOM(0x300) },
  2263 + { USB_DEVICE_WACOM(0x301) },
2256 2264 { USB_DEVICE_WACOM(0x304) },
2257 2265 { USB_DEVICE_WACOM(0x4001) },
2258 2266 { USB_DEVICE_WACOM(0x47) },