From patchwork Thu Aug 20 22:56:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7047251 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 8167BC05AC for ; Thu, 20 Aug 2015 22:56:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4614F2058E for ; Thu, 20 Aug 2015 22:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2FEC820585 for ; Thu, 20 Aug 2015 22:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbbHTW4h (ORCPT ); Thu, 20 Aug 2015 18:56:37 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:36613 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbbHTW4g (ORCPT ); Thu, 20 Aug 2015 18:56:36 -0400 Received: by pdbmi9 with SMTP id mi9so19050202pdb.3 for ; Thu, 20 Aug 2015 15:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=XR7AHX5uRVvuzYV4S8sCzd7D91Rre03my/1voQgq4dQ=; b=d1xRdMjz+hpn0mjki/U0aJ3FpDi2189R/wxqpltID1z5L4VCdk5W7eoKNAODOE64pK UHgdXvhEsvG8NL1/sFVzEcYU5XGxUoXRmON9E/vgyFau9bIo0HPTKsK+1bT5wdeIo/fp RuS/MM4cotGQoIrBUymVuIOci40MWY+9FxnKVgKvuCqRoIuX9PW+BOl4+D5S6L74uR+H r75Q0ViGgZicyMrxuioaciiMdc+cFg7psm67yyeRQPLP3x8omA5r2ARAeH+NPe9FDQX1 7eQK0R+HGgyxskpBoGuH4f0WUe+zlMjp/uGJd99kZb3SYuAvEHLEK73YH22ID7cU7V7w FgZQ== X-Received: by 10.70.59.42 with SMTP id w10mr758543pdq.66.1440111396087; Thu, 20 Aug 2015 15:56:36 -0700 (PDT) Received: from localhost ([69.84.245.29]) by smtp.gmail.com with ESMTPSA id hv5sm5505266pdb.32.2015.08.20.15.56.35 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Thu, 20 Aug 2015 15:56:35 -0700 (PDT) Date: Thu, 20 Aug 2015 15:56:33 -0700 From: Dmitry Torokhov To: Gabor Balla Cc: linux-input@vger.kernel.org, Benjamin Tissoires , Stephen Chandler Paul , Nick Bowler , Andrew Duggan Subject: Re: PROBLEM: Missing events on thinkpad trackpoint buttons Message-ID: <20150820225633.GA12900@localhost> References: <20150820213526.GA10980@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 On Fri, Aug 21, 2015 at 12:24:59AM +0200, Gabor Balla wrote: > Hi Dmitry, > > On Thu, Aug 20, 2015 at 11:35 PM, Dmitry Torokhov > wrote: > > On Thu, Aug 20, 2015 at 10:50:27PM +0200, Gabor Balla wrote: > [...] > >> At some point a new PS/2 mode was introduced by Synaptics, called EWmode. This > >> can be enabled by setting bit 2 of the mode byte. But previously this bit was > >> used for 'Disable Gesture', whatever that stands for, and it was reused for > >> selecting EWmode. Now if plain Wmode is selected, with bit 0 of the mode byte, > >> than disable gesture is on by default and bit 2 selects EWmode instead. > >> > >> Reference: > >> http://www.synaptics.com/sites/default/files/511-000275-01_RevB.pdf > [...] > >> A quick fix follows: > [...] > > > > It looks like the patch "direction" is reverted. Also, the presence of > > extended capabilities is not the indication that gesture mode should not > > be used: in relative mode bit 2 disables gesture reporting, in absolute > > mode it enables Extended W-mode. > > > > Does the patch below also work for you? > > If I'm not mistaken, the function of bit 2 depends on the state of W mode rather > than absolute vs relative mode. From page 40 of the PDF: > > "If the Wmode bit is not set (0), then Gesture is reported and bit 2 refers to > DisGest. (..) When this bit is 1, the Relative mode mouse packet reports the > true physical button states, and the Absolute mode packet’s Gesture bit always > reports as zero." > > So it still has a meaning in absolute mode, when Wmode is disabled. > I've tried the patch, it works, but I don't believe it's correct. Yes, you are right, the bot does have meaning on Absolute mode, however we want to give option to enable gestures only when in relative mode; I've adjusted the description accordingly. By the way, I re-read the spec and it says that when in Relative mode we should not touch W-mode bit at all so I adjusted it as well. Thanks. diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 28daca1..298f65d 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -519,14 +519,17 @@ static int synaptics_set_mode(struct psmouse *psmouse) struct synaptics_data *priv = psmouse->private; priv->mode = 0; - if (priv->absolute_mode) + + if (priv->absolute_mode) { priv->mode |= SYN_BIT_ABSOLUTE_MODE; - if (priv->disable_gesture) + if (SYN_CAP_EXTENDED(priv->capabilities)) + priv->mode |= SYN_BIT_W_MODE; + } else if (priv->disable_gesture) { priv->mode |= SYN_BIT_DISABLE_GESTURE; + } + if (psmouse->rate >= 80) priv->mode |= SYN_BIT_HIGH_RATE; - if (SYN_CAP_EXTENDED(priv->capabilities)) - priv->mode |= SYN_BIT_W_MODE; if (synaptics_mode_cmd(psmouse, priv->mode)) return -1; @@ -1482,7 +1485,7 @@ static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode) } priv->absolute_mode = absolute_mode; - if (SYN_ID_DISGEST_SUPPORTED(priv->identity)) + if (!absolute_mode && SYN_ID_DISGEST_SUPPORTED(priv->identity)) priv->disable_gesture = true; /*