From patchwork Sun Mar 22 13:46:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 6066731 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 B977EBF90F for ; Sun, 22 Mar 2015 13:46:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C8B820263 for ; Sun, 22 Mar 2015 13:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8B162025A for ; Sun, 22 Mar 2015 13:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751719AbbCVNqe (ORCPT ); Sun, 22 Mar 2015 09:46:34 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:35865 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751731AbbCVNqd (ORCPT ); Sun, 22 Mar 2015 09:46:33 -0400 Received: by wgra20 with SMTP id a20so126030895wgr.3; Sun, 22 Mar 2015 06:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=RYGECNDRMBQZFuNdsulUDhTkopa1zXJ000HpoPnvONw=; b=OQf8Kn2KkHmsL7BL2vJRp2TmhyICh1lib6GxYh2pCeILr4eHk/6RvE5ceoo85K8lyv JwkL+W0VLF/PElWqH2bmQeV7TdFMYY7RYc4v5en6759n3Y9jdbq2OgVCrLKSAkUCSvSH zlJCeyNZKUDHQ2j/grkoJSThv0eHt999q/fRFFD4y6Sk4bWVVM5twwv3Spa0Cu+A7pK8 kMAtpYvNVvWGki+l8dLwN7B9g1Eh0dmWAuYCbdTlJG5M+KfjgCqSmHpE/2xHHa1jFZq4 mLRNitBcHR2LcX2qsQJ+6zohRPVUl6LT9pJAVi6lY6qgB1JR20s95HS3GgmaNK/mIjPD 60gg== X-Received: by 10.194.63.172 with SMTP id h12mr173401709wjs.48.1427031992029; Sun, 22 Mar 2015 06:46:32 -0700 (PDT) Received: from Pali-Latitude.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id lg18sm6685151wic.23.2015.03.22.06.46.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Mar 2015 06:46:30 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Hans de Goede , Dmitry Torokhov , Santiago Gala Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] Input: ALPS - Detect trackstick presence for v7 protocol Date: Sun, 22 Mar 2015 14:46:11 +0100 Message-Id: <1427031971-13018-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 This patch adds detection of trackstick for v7 protocol devices. Code in this patch is used in official Dell touchpad linux drivers for Dell models: Dell Latitude E5250/5250, E5450/5450, E5550/5550 Detection code and base reg for alps v3 rushmore and v7 devices is exacly same. Also user in bug https://bugzilla.kernel.org/show_bug.cgi?id=94801 reported that Toshiba Sattellite Z30-A-1DG has only alps v7 touchpad device without trackstick and kernel reports to userspace also redundant trackstick device. Signed-off-by: Pali Rohár Tested-by: Alex Hung Reviewed-by: Hans de Goede --- drivers/input/mouse/alps.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 33198b9..c9cd27a 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -30,6 +30,7 @@ #define ALPS_CMD_NIBBLE_10 0x01f2 #define ALPS_REG_BASE_RUSHMORE 0xc2c0 +#define ALPS_REG_BASE_V7 0xc2c0 #define ALPS_REG_BASE_PINNACLE 0x0000 static const struct alps_nibble_commands alps_v3_nibble_commands[] = { @@ -1795,7 +1796,7 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse) return 0; } -static int alps_probe_trackstick_v3(struct psmouse *psmouse, int reg_base) +static int alps_probe_trackstick_v3_v7(struct psmouse *psmouse, int reg_base) { int ret = -EIO, reg_val; @@ -1880,7 +1881,7 @@ static int alps_hw_init_v3(struct psmouse *psmouse) int reg_val; unsigned char param[4]; - reg_val = alps_probe_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE); + reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE); if (reg_val == -EIO) goto error; @@ -2260,8 +2261,8 @@ static int alps_set_protocol(struct psmouse *psmouse, priv->x_bits = 16; priv->y_bits = 12; - if (alps_probe_trackstick_v3(psmouse, - ALPS_REG_BASE_RUSHMORE) < 0) + if (alps_probe_trackstick_v3_v7(psmouse, + ALPS_REG_BASE_RUSHMORE) < 0) priv->flags &= ~ALPS_DUALPOINT; break; @@ -2311,6 +2312,9 @@ static int alps_set_protocol(struct psmouse *psmouse, if (priv->fw_ver[1] != 0xba) priv->flags |= ALPS_BUTTONPAD; + if (alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_V7) < 0) + priv->flags &= ~ALPS_DUALPOINT; + break; }