[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291014802-17061-5-git-send-email-rydberg@euromail.se>
Date: Mon, 29 Nov 2010 08:13:22 +0100
From: "Henrik Rydberg" <rydberg@...omail.se>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, Henrik Rydberg <rydberg@...omail.se>
Subject: [PATCH 4/4] input: mt: Add pressure to pointer emulation code
Some MT devices report pressure per contact. This patch adds
ABS_PRESSURE to the pointer emulation code.
Signed-off-by: Henrik Rydberg <rydberg@...omail.se>
---
drivers/input/input-mt.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index 08aa682..49ccd15 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -97,7 +97,8 @@ EXPORT_SYMBOL(input_mt_report_slot_state);
* input_mt_report_pointer_emulation() - common pointer emulation
* @dev: input device with allocated MT slots
*
- * Performs legacy pointer emulation via BTN_TOUCH, ABS_X and ABS_Y.
+ * Performs legacy pointer emulation via BTN_TOUCH, ABS_X, ABS_Y and
+ * ABS_PRESSURE.
*/
void input_mt_report_pointer_emulation(struct input_dev *dev)
{
@@ -124,9 +125,13 @@ void input_mt_report_pointer_emulation(struct input_dev *dev)
if (oldest) {
int x = input_mt_get_value(oldest, ABS_MT_POSITION_X);
int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y);
+ int p = input_mt_get_value(oldest, ABS_MT_PRESSURE);
input_event(dev, EV_ABS, ABS_X, x);
input_event(dev, EV_ABS, ABS_Y, y);
+ input_event(dev, EV_ABS, ABS_PRESSURE, p);
+ } else {
+ input_event(dev, EV_ABS, ABS_PRESSURE, 0);
}
}
EXPORT_SYMBOL(input_mt_report_pointer_emulation);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists