From patchwork Fri Aug 5 06:35:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phidias Chiang X-Patchwork-Id: 656039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3s5H714Jr5z9snm; Fri, 5 Aug 2016 16:33:01 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1bVYgk-0002ha-Gn; Fri, 05 Aug 2016 06:32:58 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1bVYgd-0002gu-5K for kernel-team@lists.ubuntu.com; Fri, 05 Aug 2016 06:32:51 +0000 Received: from 114-34-181-73.hinet-ip.hinet.net ([114.34.181.73] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1bVYgb-0003NI-RK for kernel-team@lists.ubuntu.com; Fri, 05 Aug 2016 06:32:50 +0000 From: Phidias Chiang To: kernel-team@lists.ubuntu.com Subject: [Xenial][SAUCE][PATCH 1/3] UBUNTU: SAUCE: input/alps: Split up ALPS_BUTTONPAD behavior change Date: Fri, 5 Aug 2016 14:35:31 +0800 Message-Id: <20160805063533.94569-2-phidias.chiang@canonical.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160805063533.94569-1-phidias.chiang@canonical.com> References: <20160805063533.94569-1-phidias.chiang@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Ben Gamari BugLink: http://bugs.launchpad.net/bugs/1571530 It seems that curerntly ALPS_BUTTONPAD is rather overloaded. First, it disables a number of key events (since presumably buttonpads have only one button). Secondly, it seems to change the decoding behavior of position data. In the case of the Latitude 7470's touchpad we need the modified position decoding but keeping all of the buttons. Introduce a new flag, ALPS_SS4_V4_ALT_DECODING, to capture this. Signed-off-by: Ben Gamari --- drivers/input/mouse/alps.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 41e6cb5..81f4d4a 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -103,6 +103,11 @@ static const struct alps_nibble_commands alps_v6_nibble_commands[] = { #define ALPS_STICK_BITS 0x100 /* separate stick button bits */ #define ALPS_BUTTONPAD 0x200 /* device is a clickpad */ +/* + * Button-pad and some other SS4 V2 devices use an alternative position decoding +*/ +#define ALPS_SS4_V2_ALT_DECODING 0x400 + static const struct alps_model_info alps_model_data[] = { { { 0x32, 0x02, 0x14 }, 0x00, { ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT } }, /* Toshiba Salellite Pro M10 */ { { 0x33, 0x02, 0x0a }, 0x00, { ALPS_PROTO_V1, 0x88, 0xf8, 0 } }, /* UMAX-530T */ @@ -1190,7 +1195,7 @@ static int alps_decode_ss4_v2(struct alps_fields *f, break; case SS4_PACKET_ID_TWO: - if (priv->flags & ALPS_BUTTONPAD) { + if (priv->flags & ALPS_SS4_V2_ALT_DECODING) { f->mt[0].x = SS4_BTL_MF_X_V2(p, 0); f->mt[0].y = SS4_BTL_MF_Y_V2(p, 0); f->mt[1].x = SS4_BTL_MF_X_V2(p, 1); @@ -1214,7 +1219,7 @@ static int alps_decode_ss4_v2(struct alps_fields *f, break; case SS4_PACKET_ID_MULTI: - if (priv->flags & ALPS_BUTTONPAD) { + if (priv->flags & ALPS_SS4_V2_ALT_DECODING) { f->mt[2].x = SS4_BTL_MF_X_V2(p, 0); f->mt[2].y = SS4_BTL_MF_Y_V2(p, 0); f->mt[3].x = SS4_BTL_MF_X_V2(p, 1); @@ -2431,8 +2436,9 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], is_btnless = (otp[1][1] >> 3) & 0x01; + /* buttonless devices also use the alternative position decoding */ if (is_btnless) - priv->flags |= ALPS_BUTTONPAD; + priv->flags |= ALPS_BUTTONPAD | ALPS_SS4_V2_ALT_DECODING; return 0; }