From patchwork Wed Apr 8 16:04:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 6181321 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3AF65BF4A6 for ; Wed, 8 Apr 2015 16:05:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7C9F20373 for ; Wed, 8 Apr 2015 16:05:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D38D92011D for ; Wed, 8 Apr 2015 16:05:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754218AbbDHQE5 (ORCPT ); Wed, 8 Apr 2015 12:04:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45983 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754014AbbDHQE4 (ORCPT ); Wed, 8 Apr 2015 12:04:56 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 932AE41; Wed, 8 Apr 2015 16:04:55 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-5-67.ams2.redhat.com [10.36.5.67]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t38G4ruc004840; Wed, 8 Apr 2015 12:04:54 -0400 From: Hans de Goede To: Dmitry Torokhov Cc: Hans de Bruin , linux-input@vger.kernel.org, Hans de Goede Subject: [PATCH] alps: Non interleaved V2 dualpoint has separate stick button bits Date: Wed, 8 Apr 2015 18:04:52 +0200 Message-Id: <1428509092-25794-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Non interleaved V2 dualpoint touchpad / stick combos have separate stick button bits in the touchpad packets, if we do not check these then the trackpoint buttons will not work when using the touchpad, and when pressed when the user starts using the touchpad will report a release event even though the button is still pressed. This commit fixes this by checking the separate bits, note that we simply combine the buttons, since the hardware does the same when using the touchpad buttons with the trackpoint, so we do not have enough information to properly separate them. Reported-by: Hans de Bruin Signed-off-by: Hans de Goede --- drivers/input/mouse/alps.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 6962c26..58987b5 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -243,6 +243,14 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse) return; } + /* Non interleaved V2 dualpoint has separate stick button bits */ + if (priv->proto_version == ALPS_PROTO_V2 && + priv->flags == (ALPS_PASS | ALPS_DUALPOINT)) { + left |= packet[0] & 1; + right |= packet[0] & 2; + middle |= packet[0] & 4; + } + alps_report_buttons(dev, dev2, left, right, middle); /* Convert hardware tap to a reasonable Z value */