diff mbox

[1/4] Input: New property to indicate that a device's report rate may not be consistent

Message ID 1307735704-30673-2-git-send-email-derek.foreman@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Derek Foreman June 10, 2011, 7:55 p.m. UTC
Some (multi-touch) devices are capable of reporting 1 finger at 80Hz or 2 fingers at 40Hz.
This property allows a user space driver to know that this can happen, and perform extrapolation to present the illusion of fluidity.

Signed-off-by: Derek Foreman <derek.foreman@collabora.co.uk>
---
 drivers/input/mouse/synaptics.c |    1 +
 include/linux/input.h           |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

Comments

Henrik Rydberg June 10, 2011, 8:49 p.m. UTC | #1
Hi Derek,

> Some (multi-touch) devices are capable of reporting 1 finger at 80Hz or 2 fingers at 40Hz.
> This property allows a user space driver to know that this can happen, and perform extrapolation to present the illusion of fluidity.

Evdev events contain a timestamp, so any rate or rate variation can
easily be detected in userspace.

Thanks,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index e06e045..40748e3 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -695,6 +695,7 @@  static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
 	input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
 
 	if (SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) {
+		__set_bit(INPUT_PROP_INCONSISTENT_RATE, dev->propbit);
 		__set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
 		input_mt_init_slots(dev, 2);
 		input_set_abs_params(dev, ABS_MT_POSITION_X, XMIN_NOMINAL,
diff --git a/include/linux/input.h b/include/linux/input.h
index 771d6d8..f8a0c2d 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -137,6 +137,7 @@  struct input_keymap_entry {
 #define INPUT_PROP_DIRECT		0x01	/* direct input devices */
 #define INPUT_PROP_BUTTONPAD		0x02	/* has button(s) under pad */
 #define INPUT_PROP_SEMI_MT		0x03	/* touch rectangle only */
+#define INPUT_PROP_INCONSISTENT_RATE	0x05	/* device report rate changes */
 
 #define INPUT_PROP_MAX			0x1f
 #define INPUT_PROP_CNT			(INPUT_PROP_MAX + 1)