From patchwork Mon Mar 22 20:43:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafi Rubin X-Patchwork-Id: 87508 X-Patchwork-Delegate: jikos@jikos.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2MKha7O002831 for ; Mon, 22 Mar 2010 20:43:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755395Ab0CVUnf (ORCPT ); Mon, 22 Mar 2010 16:43:35 -0400 Received: from LION.seas.upenn.edu ([158.130.12.194]:49754 "EHLO lion.seas.upenn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752137Ab0CVUne (ORCPT ); Mon, 22 Mar 2010 16:43:34 -0400 Received: from [158.130.62.102] (SEASNet-62-02.seas.UPENN.EDU [158.130.62.102]) (authenticated bits=0) by lion.seas.upenn.edu (8.13.6/8.13.6) with ESMTP id o2MKhJPF010766 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT); Mon, 22 Mar 2010 16:43:19 -0400 Message-ID: <4BA7D666.5030608@seas.upenn.edu> Date: Mon, 22 Mar 2010 16:43:18 -0400 From: Rafi Rubin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100316 Thunderbird/3.0.3 MIME-Version: 1.0 To: Micki Balanga CC: jkosina@suse.cz, chatty@enac.fr, peterhuewe@gmx.de, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: Re: [PATCH 1/2] HID: N-trig Add set feature commands to driver References: <1269260173-2543-1-git-send-email-micki@n-trig.com> <20100322172920.GA18658@seas.upenn.edu> <48A28051AC6D7A48B64F28272458190326DEE8@Exchange-IL.n-trig.com> <20100322181722.GA24483@seas.upenn.edu> <48A28051AC6D7A48B64F28272458190326DEEB@Exchange-IL.n-trig.com> In-Reply-To: <48A28051AC6D7A48B64F28272458190326DEEB@Exchange-IL.n-trig.com> 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 (demeter.kernel.org [140.211.167.41]); Mon, 22 Mar 2010 20:43:36 +0000 (UTC) diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3234c72..25ee5a4 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -35,6 +35,9 @@ struct ntrig_data { __u8 mt_footer[4]; __u8 mt_foot_count; + + __u8 deactivate_slack; + __u8 deactivate_state; }; /* @@ -192,6 +195,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, /* Pen activity signal, trigger end of touch. */ if (nd->mt_footer[2]) { nd->confidence = 0; + nd->deactivate_state = 0; break; } @@ -252,14 +256,16 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, BTN_TOOL_QUADTAP, 1); } input_report_key(input, BTN_TOUCH, 1); - } else { + nd->deactivate_state = nd->deactivate_slack; + } else if (! nd->deactivate_state) { input_report_key(input, BTN_TOOL_DOUBLETAP, 0); input_report_key(input, BTN_TOOL_TRIPLETAP, 0); input_report_key(input, BTN_TOOL_QUADTAP, 0); - } + } else + nd->deactivate_state--; break; default: @@ -292,6 +298,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) } nd->reading_mt = 0; + nd->deactivate_slack = 4; + nd->deactivate_state = 0; hid_set_drvdata(hdev, nd); ret = hid_parse(hdev);