@@ -157,6 +157,39 @@ void input_mt_report_slot_state(struct input_dev *dev,
EXPORT_SYMBOL(input_mt_report_slot_state);
/**
+ * input_mt_report_end_state() - report end touch events
+ * @dev: input device with allocated MT slots
+ *
+ * Reports a touch end event for current active slots (with active tracking id).
+ * This is useful when the device might suspend (or sleep) while there were
+ * still active tracking ids.
+ */
+void input_mt_report_end_state(struct input_dev *dev)
+{
+ struct input_mt *mt = dev->mt;
+ struct input_mt_slot *slot;
+ int id, i;
+
+ if (!mt)
+ return;
+
+ for (i = 0; i < mt->num_slots; ++i) {
+ slot = &mt->slots[i];
+ slot->frame = mt->frame;
+
+ id = input_mt_get_value(slot, ABS_MT_TRACKING_ID);
+
+ /* if id == -1 is 'unused' */
+ if (id >= 0) {
+ input_mt_set_value(slot, ABS_MT_TRACKING_ID, -1);
+ input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
+ }
+ }
+}
+EXPORT_SYMBOL(input_mt_report_end_state);
+
+
+/**
* input_mt_report_finger_count() - report contact count
* @dev: input device with allocated MT slots
* @count: the number of contacts
@@ -103,6 +103,8 @@ static inline bool input_is_mt_axis(int axis)
void input_mt_report_slot_state(struct input_dev *dev,
unsigned int tool_type, bool active);
+void input_mt_report_end_state(struct input_dev *dev);
+
void input_mt_report_finger_count(struct input_dev *dev, int count);
void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count);