From 9c70cefed5bc44284a2cd63fc5e3b4ab3d90d0bf Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 30 Aug 2010 00:45:50 +0200 Subject: Fix bitmask bug in position reporting Signed-off-by: Henrik Rydberg --- usr/src/dkms_source_tree/dkms.conf | 2 +- usr/src/dkms_source_tree/wacom_wac.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'usr') diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf index 9d2da13..fc054d5 100644 --- a/usr/src/dkms_source_tree/dkms.conf +++ b/usr/src/dkms_source_tree/dkms.conf @@ -1,5 +1,5 @@ NAME=wacom -VERSION=1.0.1 +VERSION=1.0.2 PACKAGE_NAME="$NAME" PACKAGE_VERSION="$VERSION" MAKE[0]="make -C ${kernel_source_dir} diff --git a/usr/src/dkms_source_tree/wacom_wac.c b/usr/src/dkms_source_tree/wacom_wac.c index 03a3fdc..d1c388e 100644 --- a/usr/src/dkms_source_tree/wacom_wac.c +++ b/usr/src/dkms_source_tree/wacom_wac.c @@ -869,8 +869,11 @@ static int wacom_bbt_irq(struct wacom_wac *wacom, size_t len) int p = data[9 * i + 2]; input_mt_slot(input, i); if (p) { - int x = get_unaligned_be16(&data[9 * i + 3]) << 4; - int y = get_unaligned_be16(&data[9 * i + 5]) << 4; + int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; + int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; + /* artificial scaling */ + x <<= 4; + y <<= 4; input_report_abs(input, ABS_MT_PRESSURE, p); input_report_abs(input, ABS_MT_POSITION_X, x); input_report_abs(input, ABS_MT_POSITION_Y, y); -- cgit v1.2.3