From patchwork Tue Sep 14 15:08:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Merkel X-Patchwork-Id: 179722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8EFFLhL002286 for ; Tue, 14 Sep 2010 15:15:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657Ab0INPPV (ORCPT ); Tue, 14 Sep 2010 11:15:21 -0400 Received: from mail.planet-school.de ([194.116.187.5]:38732 "EHLO turboconrad.planet-school.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751555Ab0INPPV (ORCPT ); Tue, 14 Sep 2010 11:15:21 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Sep 2010 15:15:22 +0000 (UTC) X-Greylist: delayed 395 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Sep 2010 11:15:20 EDT Received: from [192.168.2.8] (HSI-KBW-078-043-070-183.hsi4.kabel-badenwuerttemberg.de [78.43.70.183]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mail@philmerk.de) by turboconrad.planet-school.de (Postfix) with ESMTPSA id D56B7B6A01B; Tue, 14 Sep 2010 17:08:41 +0200 (CEST) Subject: [PATCH] Fix for problems with eGalax/DWAV multi-touch-screen From: Philipp Merkel To: chatty@enac.fr Cc: linux-input@vger.kernel.org Date: Tue, 14 Sep 2010 17:08:39 +0200 Message-ID: <1284476919.3732.10.camel@PhEeeTab> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff -ru a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c --- a/drivers/hid/usbhid/hid-quirks.c 2010-08-27 18:41:20.000000000 +0200 +++ b/drivers/hid/usbhid/hid-quirks.c 2010-08-27 18:42:07.000000000 +0200 @@ -33,7 +33,6 @@ { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, - { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, diff -ru a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c --- a/drivers/hid/hid-egalax.c 2010-08-27 18:48:17.851442000 +0200 +++ b/drivers/hid/hid-egalax.c 2010-08-29 11:26:02.385106000 +0200 @@ -31,7 +31,7 @@ bool first; /* is this the first finger in the frame? */ bool valid; /* valid finger data, or just placeholder? */ bool activity; /* at least one active finger previously? */ - __u16 lastx, lasty; /* latest valid (x, y) in the frame */ + __u16 lastx, lasty, lastz; /* latest valid (x, y, z) in the frame */ }; static int egalax_input_mapping(struct hid_device *hdev, struct hid_input *hi, @@ -79,6 +79,10 @@ case HID_DG_TIPPRESSURE: hid_map_usage(hi, usage, bit, max, EV_ABS, ABS_MT_PRESSURE); + /* touchscreen emulation */ + input_set_abs_params(hi->input, ABS_PRESSURE, + field->logical_minimum, + field->logical_maximum, 0, 0); return 1; } return 0; @@ -109,8 +113,8 @@ if (td->valid) { /* emit multitouch events */ input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id); - input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x); - input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y); + input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x >> 3); + input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y >> 3); input_event(input, EV_ABS, ABS_MT_PRESSURE, td->z); input_mt_sync(input); @@ -121,6 +125,7 @@ */ td->lastx = td->x; td->lasty = td->y; + td->lastz = td->z; } /* @@ -129,8 +134,9 @@ * the oldest on the panel, the one we want for single touch */ if (!td->first && td->activity) { - input_event(input, EV_ABS, ABS_X, td->lastx); - input_event(input, EV_ABS, ABS_Y, td->lasty); + input_event(input, EV_ABS, ABS_X, td->lastx >> 3); + input_event(input, EV_ABS, ABS_Y, td->lasty >> 3); + input_event(input, EV_ABS, ABS_PRESSURE, td->lastz); } if (!td->valid) {