aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-15 20:16:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-15 20:16:28 -0400
commit2f39691f31a22e0c6d82573d91306059f8ef920c (patch)
tree6702165407caadb90325baf6042888f10343784a
parentffb29b42271c665cd652dfcaa590895c8a00ac97 (diff)
parent91167e1914673972511617b6f4165bb12c3e0dcf (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer fixes from Dmitry Torokhov: "Second round of updates for the input subsystem. Mostly small fixups to the code merged in the first round (atmel_mxt_ts, wacom) but also a smallish patch to xbox driver to support Xbox One controllers and a patch to better handle Synaptics profile sensors found in Cr-48 Chromebooks that should not affect any other devices" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: edt-ft5x06 - remove superfluous assignment Input: xpad - add support for Xbox One controllers Input: atmel_mxt_ts - fix a few issues reported by Coverity Input: atmel_mxt_ts - split config update a bit Input: atmel_mxt_ts - simplify mxt_initialize a bit Input: joystick - use get_cycles on ARMv8 Input: wacom - fix compiler warning if !CONFIG_PM Input: cap1106 - allow changing key mapping from userspace Input: synaptics - use firmware data for Cr-48 Input: synaptics - properly initialize slots for semi-MT Input: MT - make slot cleanup callable outside mt_sync_frame() Input: atmel_mxt_ts - mXT224 DMA quirk was fixed in firmware v2.0.AA
-rw-r--r--drivers/hid/wacom_sys.c2
-rw-r--r--drivers/input/input-mt.c38
-rw-r--r--drivers/input/joystick/analog.c2
-rw-r--r--drivers/input/joystick/xpad.c174
-rw-r--r--drivers/input/keyboard/cap1106.c8
-rw-r--r--drivers/input/mouse/synaptics.c72
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c366
-rw-r--r--drivers/input/touchscreen/edt-ft5x06.c1
-rw-r--r--include/linux/input/mt.h1
9 files changed, 462 insertions, 202 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 3e388ec31da8..f0db7eca9023 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1416,6 +1416,7 @@ static void wacom_remove(struct hid_device *hdev)
1416 kfree(wacom); 1416 kfree(wacom);
1417} 1417}
1418 1418
1419#ifdef CONFIG_PM
1419static int wacom_resume(struct hid_device *hdev) 1420static int wacom_resume(struct hid_device *hdev)
1420{ 1421{
1421 struct wacom *wacom = hid_get_drvdata(hdev); 1422 struct wacom *wacom = hid_get_drvdata(hdev);
@@ -1436,6 +1437,7 @@ static int wacom_reset_resume(struct hid_device *hdev)
1436{ 1437{
1437 return wacom_resume(hdev); 1438 return wacom_resume(hdev);
1438} 1439}
1440#endif /* CONFIG_PM */
1439 1441
1440static struct hid_driver wacom_driver = { 1442static struct hid_driver wacom_driver = {
1441 .name = "wacom", 1443 .name = "wacom",
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index d398f1321f14..c30204f2fa30 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -237,6 +237,31 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count)
237EXPORT_SYMBOL(input_mt_report_pointer_emulation); 237EXPORT_SYMBOL(input_mt_report_pointer_emulation);
238 238
239/** 239/**
240 * input_mt_drop_unused() - Inactivate slots not seen in this frame
241 * @dev: input device with allocated MT slots
242 *
243 * Lift all slots not seen since the last call to this function.
244 */
245void input_mt_drop_unused(struct input_dev *dev)
246{
247 struct input_mt *mt = dev->mt;
248 int i;
249
250 if (!mt)
251 return;
252
253 for (i = 0; i < mt->num_slots; i++) {
254 if (!input_mt_is_used(mt, &mt->slots[i])) {
255 input_mt_slot(dev, i);
256 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
257 }
258 }
259
260 mt->frame++;
261}
262EXPORT_SYMBOL(input_mt_drop_unused);
263
264/**
240 * input_mt_sync_frame() - synchronize mt frame 265 * input_mt_sync_frame() - synchronize mt frame
241 * @dev: input device with allocated MT slots 266 * @dev: input device with allocated MT slots
242 * 267 *
@@ -247,27 +272,18 @@ EXPORT_SYMBOL(input_mt_report_pointer_emulation);
247void input_mt_sync_frame(struct input_dev *dev) 272void input_mt_sync_frame(struct input_dev *dev)
248{ 273{
249 struct input_mt *mt = dev->mt; 274 struct input_mt *mt = dev->mt;
250 struct input_mt_slot *s;
251 bool use_count = false; 275 bool use_count = false;
252 276
253 if (!mt) 277 if (!mt)
254 return; 278 return;
255 279
256 if (mt->flags & INPUT_MT_DROP_UNUSED) { 280 if (mt->flags & INPUT_MT_DROP_UNUSED)
257 for (s = mt->slots; s != mt->slots + mt->num_slots; s++) { 281 input_mt_drop_unused(dev);
258 if (input_mt_is_used(mt, s))
259 continue;
260 input_mt_slot(dev, s - mt->slots);
261 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
262 }
263 }
264 282
265 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT)) 283 if ((mt->flags & INPUT_MT_POINTER) && !(mt->flags & INPUT_MT_SEMI_MT))
266 use_count = true; 284 use_count = true;
267 285
268 input_mt_report_pointer_emulation(dev, use_count); 286 input_mt_report_pointer_emulation(dev, use_count);
269
270 mt->frame++;
271} 287}
272EXPORT_SYMBOL(input_mt_sync_frame); 288EXPORT_SYMBOL(input_mt_sync_frame);
273 289
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 9135606c8649..ab0fdcd36e18 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -158,7 +158,7 @@ static unsigned int get_time_pit(void)
158#define GET_TIME(x) rdtscl(x) 158#define GET_TIME(x) rdtscl(x)
159#define DELTA(x,y) ((y)-(x)) 159#define DELTA(x,y) ((y)-(x))
160#define TIME_NAME "TSC" 160#define TIME_NAME "TSC"
161#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_TILE) 161#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_TILE)
162#define GET_TIME(x) do { x = get_cycles(); } while (0) 162#define GET_TIME(x) do { x = get_cycles(); } while (0)
163#define DELTA(x,y) ((y)-(x)) 163#define DELTA(x,y) ((y)-(x))
164#define TIME_NAME "get_cycles" 164#define TIME_NAME "get_cycles"
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 603fe0dd3682..177602cf7079 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -95,7 +95,8 @@
95#define XTYPE_XBOX 0 95#define XTYPE_XBOX 0
96#define XTYPE_XBOX360 1 96#define XTYPE_XBOX360 1
97#define XTYPE_XBOX360W 2 97#define XTYPE_XBOX360W 2
98#define XTYPE_UNKNOWN 3 98#define XTYPE_XBOXONE 3
99#define XTYPE_UNKNOWN 4
99 100
100static bool dpad_to_buttons; 101static bool dpad_to_buttons;
101module_param(dpad_to_buttons, bool, S_IRUGO); 102module_param(dpad_to_buttons, bool, S_IRUGO);
@@ -121,6 +122,7 @@ static const struct xpad_device {
121 { 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX }, 122 { 0x045e, 0x0287, "Microsoft Xbox Controller S", 0, XTYPE_XBOX },
122 { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX }, 123 { 0x045e, 0x0289, "Microsoft X-Box pad v2 (US)", 0, XTYPE_XBOX },
123 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 }, 124 { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },
125 { 0x045e, 0x02d1, "Microsoft X-Box One pad", 0, XTYPE_XBOXONE },
124 { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 126 { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
125 { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W }, 127 { 0x045e, 0x0719, "Xbox 360 Wireless Receiver", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
126 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX }, 128 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -231,10 +233,12 @@ static const signed short xpad_abs_triggers[] = {
231 -1 233 -1
232}; 234};
233 235
234/* Xbox 360 has a vendor-specific class, so we cannot match it with only 236/*
237 * Xbox 360 has a vendor-specific class, so we cannot match it with only
235 * USB_INTERFACE_INFO (also specifically refused by USB subsystem), so we 238 * USB_INTERFACE_INFO (also specifically refused by USB subsystem), so we
236 * match against vendor id as well. Wired Xbox 360 devices have protocol 1, 239 * match against vendor id as well. Wired Xbox 360 devices have protocol 1,
237 * wireless controllers have protocol 129. */ 240 * wireless controllers have protocol 129.
241 */
238#define XPAD_XBOX360_VENDOR_PROTOCOL(vend,pr) \ 242#define XPAD_XBOX360_VENDOR_PROTOCOL(vend,pr) \
239 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \ 243 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \
240 .idVendor = (vend), \ 244 .idVendor = (vend), \
@@ -245,9 +249,20 @@ static const signed short xpad_abs_triggers[] = {
245 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \ 249 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,1) }, \
246 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) } 250 { XPAD_XBOX360_VENDOR_PROTOCOL(vend,129) }
247 251
252/* The Xbox One controller uses subclass 71 and protocol 208. */
253#define XPAD_XBOXONE_VENDOR_PROTOCOL(vend, pr) \
254 .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO, \
255 .idVendor = (vend), \
256 .bInterfaceClass = USB_CLASS_VENDOR_SPEC, \
257 .bInterfaceSubClass = 71, \
258 .bInterfaceProtocol = (pr)
259#define XPAD_XBOXONE_VENDOR(vend) \
260 { XPAD_XBOXONE_VENDOR_PROTOCOL(vend, 208) }
261
248static struct usb_device_id xpad_table[] = { 262static struct usb_device_id xpad_table[] = {
249 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */ 263 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */
250 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ 264 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
265 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
251 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 266