From patchwork Sun Mar 22 13:47:47 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: 6066751 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 886499F318 for ; Sun, 22 Mar 2015 13:48:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B14BF20263 for ; Sun, 22 Mar 2015 13:48:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF6942025B for ; Sun, 22 Mar 2015 13:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750951AbbCVNsM (ORCPT ); Sun, 22 Mar 2015 09:48:12 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:37850 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbbCVNsL (ORCPT ); Sun, 22 Mar 2015 09:48:11 -0400 Received: by wixw10 with SMTP id w10so35549290wix.0; Sun, 22 Mar 2015 06:48:10 -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=BPcY2+P4tR1+63XTeGxUWQHwLzPKK5APteZBJYk3dyw=; b=jqGb7kCYavhFMLWjs+E7q1ywl8/dhh/IRpV/aVp6O7PEsWj3P5vBH4w+PZ7eUcnJrM 6yGsS1TN6cYTLKCVA1TF2+SmhzK0jnhR91mhPZWhG+d6kLEdmLcxogas4UsqiB0eVRpk ZUr/YgcOPdHUqAcVSHlMID47KpHQ/ToHicQZsA3x173ZVN1O6QuOPhA1GJA44zM/wLwe nuGdRA0vtlmQIFEsTAi/8vZ1AxDDCZykyxZFjda/FrBNnweObOMr9srb06OM6G9ITP1K EQLE31MfCXykOMeBtQtOXIfAInJ3iYPwzchUu3HiM0ySNv68Wo7pg0oFwpKCSj1JTScH gkAQ== X-Received: by 10.194.109.70 with SMTP id hq6mr46548141wjb.77.1427032090488; Sun, 22 Mar 2015 06:48:10 -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 q6sm6655179wix.3.2015.03.22.06.48.09 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 22 Mar 2015 06:48:09 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Hans de Goede , Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] Input: ALPS - Report v3 pinnacle trackstick device only if is present Date: Sun, 22 Mar 2015 14:47:47 +0100 Message-Id: <1427032068-13066-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 move v3 pinnacle code for trackstick detection from alps_hw_init_v3() to alps_set_protocol() so ALPS_DUALPOINT flag can be cleared before registering trackstick input device in kernel. Signed-off-by: Pali Rohár Acked-by: Hans de Goede --- drivers/input/mouse/alps.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index c9cd27a..d24e98d 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1877,15 +1877,12 @@ error: static int alps_hw_init_v3(struct psmouse *psmouse) { + struct alps_data *priv = psmouse->private; struct ps2dev *ps2dev = &psmouse->ps2dev; int reg_val; unsigned char param[4]; - reg_val = alps_probe_trackstick_v3_v7(psmouse, ALPS_REG_BASE_PINNACLE); - if (reg_val == -EIO) - goto error; - - if (reg_val == 0 && + if ((priv->flags & ALPS_DUALPOINT) && alps_setup_trackstick_v3(psmouse, ALPS_REG_BASE_PINNACLE) == -EIO) goto error; @@ -2249,6 +2246,11 @@ static int alps_set_protocol(struct psmouse *psmouse, priv->decode_fields = alps_decode_pinnacle; priv->nibble_commands = alps_v3_nibble_commands; priv->addr_command = PSMOUSE_CMD_RESET_WRAP; + + if (alps_probe_trackstick_v3_v7(psmouse, + ALPS_REG_BASE_PINNACLE) < 0) + priv->flags &= ~ALPS_DUALPOINT; + break; case ALPS_PROTO_V3_RUSHMORE: