From patchwork Thu May 26 08:55:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 9136835 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 9D272607D5 for ; Thu, 26 May 2016 08:56:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92B1727D11 for ; Thu, 26 May 2016 08:56:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87BA228299; Thu, 26 May 2016 08:56:15 +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 263C6281D4 for ; Thu, 26 May 2016 08:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbcEZI4O (ORCPT ); Thu, 26 May 2016 04:56:14 -0400 Received: from mail.smart-cactus.org ([54.187.36.80]:56245 "EHLO mail.smart-cactus.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751134AbcEZI4N (ORCPT ); Thu, 26 May 2016 04:56:13 -0400 Received: from localhost.localdomain (ec2-52-9-124-254.us-west-1.compute.amazonaws.com [52.9.124.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: ben@smart-cactus.org) by mail.smart-cactus.org (Postfix) with ESMTPSA id 2F7A740513; Thu, 26 May 2016 08:39:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.smart-cactus.org; s=mail; t=1464251989; bh=KVkDbra3XSypytm4FRA9FH44F2GZUN6RsGYQs/d7mXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZRSVzICCUG4HCRBCobZflQic4mGMpa5+h24INIm31/Ykc1vdw8aIOlN5e3aw3nLj y2l0kwJvAbWg8w4pwh/KWskHXRx2mc7LCJfDY9hQTSLIdnBTP7E78oTwIl7txrKos0 pNu7nWp0wl1MxnkAYWV4VZTE82hCMAnGgV+obK34= From: Ben Gamari To: =?UTF-8?q?Pali=20Roh=C3=A1r?= , linux-input@vger.kernel.org Cc: Hans de Goede , Allen Hung , Masaki Ota , Ben Gamari Subject: [PATCH 1/3] input/alps: Split up ALPS_BUTTONPAD behavior change Date: Thu, 26 May 2016 10:55:12 +0200 Message-Id: <1464252914-11450-2-git-send-email-ben@smart-cactus.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1464252914-11450-1-git-send-email-ben@smart-cactus.org> References: <201605251801.45240@pali> <1464252914-11450-1-git-send-email-ben@smart-cactus.org> 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 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. --- 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 936f07a..daf9421 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -104,6 +104,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 */ @@ -1191,7 +1196,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); @@ -1215,7 +1220,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); @@ -2429,8 +2434,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; }