@@ -659,6 +659,37 @@ static int input_default_setkeycode(struct input_dev *dev,
}
/**
+ * input_mt_get_abs_value - retrieve MT state variables from a device slot
+ * @dev: input device which state is being queried
+ * @code: ABS code to retrieve
+ * @slot: slot to retrieve from
+ *
+ * Return the ABS state of the given MT slot. If code is not an MT
+ * event, the corresponding ABS event is returned.
+ *
+ * This function may be called by anyone interested in extracting the
+ * current MT state. Used by evdev handlers.
+ */
+int input_mt_get_abs_value(struct input_dev *dev, unsigned int code, int slot)
+{
+ unsigned int mtmap = input_mt_abs_map[code];
+ unsigned long flags;
+ int retval;
+
+ spin_lock_irqsave(&dev->event_lock, flags);
+ if (!mtmap)
+ retval = dev->abs[code];
+ else if (slot >= 0 && slot < dev->mtsize)
+ retval = dev->mt[slot].abs[mtmap - 1];
+ else
+ retval = 0;
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+
+ return retval;
+}
+EXPORT_SYMBOL(input_mt_get_abs_value);
+
+/**
* input_get_keycode - retrieve keycode currently mapped to a given scancode
* @dev: input device which keymap is being queried
* @scancode: scancode (or its equivalent for device in question) for which
@@ -1436,6 +1436,8 @@ static inline void input_mt_slot(struct input_dev *dev, int slot)
input_event(dev, EV_ABS, ABS_MT_SLOT, slot);
}
+int input_mt_get_abs_value(struct input_dev *dev, unsigned int code, int slot);
+
void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat)