From patchwork Tue Sep 21 21:45:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 198082 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 o8LLje3D005129 for ; Tue, 21 Sep 2010 21:45:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756509Ab0IUVpj (ORCPT ); Tue, 21 Sep 2010 17:45:39 -0400 Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]:42367 "EHLO ch-smtp01.sth.basefarm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755582Ab0IUVpi (ORCPT ); Tue, 21 Sep 2010 17:45:38 -0400 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:46322 helo=[192.168.0.183]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.71) (envelope-from ) id 1OyAeW-0000W6-68; Tue, 21 Sep 2010 23:45:31 +0200 Message-ID: <4C992775.3000000@euromail.se> Date: Tue, 21 Sep 2010 23:45:25 +0200 From: Henrik Rydberg User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100916 Thunderbird/3.1.4 MIME-Version: 1.0 To: Jiri Kosina CC: Dmitry Torokhov , Stephane Chatty , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [RESEND] hid: 3m: Adjust major / minor axes to scale X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1OyAeW-0000W6-68. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1OyAeW-0000W6-68 120fa39211d31acac0163e7ba10b14ff Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Sep 2010 21:45:40 +0000 (UTC) diff --git a/drivers/hid/hid-3m-pct.c b/drivers/hid/hid-3m-pct.c index 65441e0..cd4b125 100644 --- a/drivers/hid/hid-3m-pct.c +++ b/drivers/hid/hid-3m-pct.c @@ -162,16 +162,18 @@ static void mmm_filter_event(struct mmm_data *md, struct input_dev *input) if (f->touch) { /* this finger is on the screen */ int wide = (f->w > f->h); + /* divided by two to match visual scale of touch */ + int major = max(f->w, f->h) >> 1; + int minor = min(f->w, f->h) >> 1; + if (!f->prev_touch) f->id = md->id++; input_event(input, EV_ABS, ABS_MT_TRACKING_ID, f->id); input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x); input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y); input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide); - input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, - wide ? f->w : f->h); - input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, - wide ? f->h : f->w); + input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major); + input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor); /* touchscreen emulation: pick the oldest contact */ if (!oldest || ((f->id - oldest->id) & (SHRT_MAX + 1)))