path: root/drivers/input/input-mt.c
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-27 09:16:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-27 09:16:53 -0700
commitc92067ae06cb71561628d9f4b24b56c1813c54e0 (patch)
tree775d6d419057de760b25dc8773cacbf65d567514 /drivers/input/input-mt.c
parentMerge branch 'fixes-v4.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security (diff)
parentInput: psmouse - fix button reporting for basic protocols (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - the main change is a fix for my brain-dead patch to PS/2 button reporting for some protocols that made it in 4.17 - there is a new driver for Spreadtum vibrator that I intended to send during merge window but ended up not sending the 2nd pull request. Given that this is a brand new driver we should not see regressions here - a fixup to Elantech PS/2 driver to avoid decoding errors on Thinkpad P52 - addition of few more ACPI IDs for Silead and Elan drivers - RMI4 is switched to using IRQ domain code instead of rolling its own implementation * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: psmouse - fix button reporting for basic protocols Input: xpad - fix GPD Win 2 controller name Input: elan_i2c_smbus - fix more potential stack buffer overflows Input: elan_i2c - add ELAN0618 (Lenovo v330 15IKB) ACPI ID Input: elantech - fix V4 report decoding for module with middle key Input: elantech - enable middle button of touchpads on ThinkPad P52 Input: do not assign new tracking ID when changing tool type Input: make input_report_slot_state() return boolean Input: synaptics-rmi4 - fix axis-swap behavior Input: synaptics-rmi4 - fix the error return code in rmi_probe_interrupts() Input: synaptics-rmi4 - convert irq distribution to irq_domain Input: silead - add MSSL0002 ACPI HID Input: goldfish_events - fix checkpatch warnings Input: add Spreadtrum vibrator driver
Diffstat (limited to 'drivers/input/input-mt.c')
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index cf30523c6ef6..6c7326c93721 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -131,8 +131,10 @@ EXPORT_SYMBOL(input_mt_destroy_slots);
* inactive, or if the tool type is changed, a new tracking id is
* assigned to the slot. The tool type is only reported if the
* corresponding absbit field is set.
+ *
+ * Returns true if contact is active.
-void input_mt_report_slot_state(struct input_dev *dev,
+bool input_mt_report_slot_state(struct input_dev *dev,
unsigned int tool_type, bool active)
struct input_mt *mt = dev->mt;
@@ -140,22 +142,24 @@ void input_mt_report_slot_state(struct input_dev *dev,
int id;
if (!mt)
- return;
+ return false;
slot = &mt->slots[mt->slot];
slot->frame = mt->frame;
if (!active) {
input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
- return;
+ return false;
id = input_mt_get_value(slot, ABS_MT_TRACKING_ID);
- if (id < 0 || input_mt_get_value(slot, ABS_MT_TOOL_TYPE) != tool_type)
+ if (id < 0)
id = input_mt_new_trkid(mt);
input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id);
input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type);
+ return true;