@@ -458,6 +458,25 @@ int input_mt_get_slot_by_key(struct input_dev *dev, int key)
return s - mt->slots;
}
+ int active = 0;
+ int used = 0;
+ for (s = mt->slots; s != mt->slots + mt->num_slots; s++) {
+ active += input_mt_is_active(s);
+ used += input_mt_is_used(mt, s);
+ }
+
+ if (active == mt->num_slots && used == 0) {
+ dev_err(&dev->dev, "%s: XXX: All slots active, none in use, "
+ "searched for key:%d, mt->frame:%d\n",
+ __PRETTY_FUNCTION__, key, mt->frame);
+
+ for (s = mt->slots; s != mt->slots + mt->num_slots; s++)
+ dev_err(&dev->dev, "%s: XXX: slot[%d] key:%d frame:%d\n",
+ __PRETTY_FUNCTION__, s - mt->slots, s->key, s->frame);
+
+ input_mt_drop_unused(dev); /* HACK */
+ }
+
return -1;
}
EXPORT_SYMBOL(input_mt_get_slot_by_key);