From patchwork Thu Nov 10 16:44:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donohue X-Patchwork-Id: 9421473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C1DCB60512 for ; Thu, 10 Nov 2016 16:45:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB8C529769 for ; Thu, 10 Nov 2016 16:45:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B06EE2976E; Thu, 10 Nov 2016 16:45:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6646C29769 for ; Thu, 10 Nov 2016 16:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935176AbcKJQpE (ORCPT ); Thu, 10 Nov 2016 11:45:04 -0500 Received: from Lepton.TopQuark.net ([168.235.66.66]:47346 "EHLO Mail2.TopQuark.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935106AbcKJQpE (ORCPT ); Thu, 10 Nov 2016 11:45:04 -0500 Received: from Mail1.TopQuark.net (pool-108-48-201-133.washdc.fios.verizon.net [108.48.201.133]) by Mail2.TopQuark.net (Postfix) with ESMTP id 82F02F6043C; Thu, 10 Nov 2016 11:45:02 -0500 (EST) Received: from Mail1.TopQuark.net (unknown [127.0.0.1]) by Mail1.TopQuark.net (Postfix) with ESMTP id 28C1927EE2DC; Thu, 10 Nov 2016 11:45:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=PaulSD.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=mail; bh=sqXc zoJxWMFekpXoeZIoQ/AHAog=; b=Rs4JLAYRVZzTj8wvorP/w590SfF7saVCAGqL fUrPOcLd8iNx9Ai9JgKk7HpNkQRhh2kgF7P971DWcUFXEc16DUCl9Ghvqjyvq7ZM mFc99gAt+w8H86/zSoju19kvS/hhkO01gDrDspGsjU4KAcyXncAZRUijI7cE+ZPC /Gnq8GY= Received: by Mail1.TopQuark.net (Postfix, from userid 1000) id 1473C27EE376; Thu, 10 Nov 2016 11:45:01 -0500 (EST) From: Paul Donohue To: linux-input@vger.kernel.org Cc: Ben Gamari , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Michal Hocko , Paul Donohue Subject: [PATCH v5 1/3] Input: ALPS - Fix TrackStick support for SS5 hardware Date: Thu, 10 Nov 2016 11:44:44 -0500 Message-Id: <1478796286-1924-2-git-send-email-linux-kernel@PaulSD.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478796286-1924-1-git-send-email-linux-kernel@PaulSD.com> References: <20161110151942.GA3969@pali> <1478796286-1924-1-git-send-email-linux-kernel@PaulSD.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current Alps SS5 (SS4 v2) code generates bogus TouchPad events when TrackStick packets are processed. This causes the xorg synaptics driver to print "unable to find touch point 0" and "BUG: triggered 'if (priv->num_active_touches > priv->num_slots)'" messages. It also causes unexpected TouchPad button release and reclick event sequences if the TrackStick is moved while holding a TouchPad button. This commit corrects the problem by adjusting alps_process_packet_ss4_v2() so that it only sends TrackStick reports when processing TrackStick packets. Signed-off-by: Paul Donohue --- drivers/input/mouse/alps.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 6d7de9b..b93fe83 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1346,6 +1346,18 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) priv->multi_packet = 0; + /* Report trackstick */ + if (alps_get_pkt_id_ss4_v2(packet) == SS4_PACKET_ID_STICK) { + if (priv->flags & ALPS_DUALPOINT) { + input_report_key(dev2, BTN_LEFT, f->ts_left); + input_report_key(dev2, BTN_RIGHT, f->ts_right); + input_report_key(dev2, BTN_MIDDLE, f->ts_middle); + input_sync(dev2); + } + return; + } + + /* Report touchpad */ alps_report_mt_data(psmouse, (f->fingers <= 4) ? f->fingers : 4); input_mt_report_finger_count(dev, f->fingers); @@ -1356,13 +1368,6 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse) input_report_abs(dev, ABS_PRESSURE, f->pressure); input_sync(dev); - - if (priv->flags & ALPS_DUALPOINT) { - input_report_key(dev2, BTN_LEFT, f->ts_left); - input_report_key(dev2, BTN_RIGHT, f->ts_right); - input_report_key(dev2, BTN_MIDDLE, f->ts_middle); - input_sync(dev2); - } } static bool alps_is_valid_package_ss4_v2(struct psmouse *psmouse)