Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp174399yba; Mon, 20 May 2019 06:55:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdVQbGbEwdgJ7nAmsrIcNkxLusjKRQJSbgxOl6ujonSAVzuubh+FRzhAYpu/NT6bGcBqUC X-Received: by 2002:a65:5c89:: with SMTP id a9mr76179071pgt.334.1558360557069; Mon, 20 May 2019 06:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558360557; cv=none; d=google.com; s=arc-20160816; b=kVJ1TRo1Ah7B+TnxfEkcb44wh5qXXUsO/OUrPiF5cH3XYWBKXxrE0sU/zFUU6ExpAH TeNp5zZ2sscf/bAKyMuieWxeKOyHZRuuLfWKBYxOtxSgbi0OywkXhiznGMwYCH+HZop0 1+g/nzR0SwMLpThBEF4VRy339WyFQZlNqJAf4Eg7ePKwN+gQ/XW4Hx239WUshYsLqtht VI3iwdbC3LJY6VMNHcTjS2JkaIW0XGhpGU5IjGpVlM1eYn9gHHz2LVRHZMVGtZerk2Zg 2MpCtR/5pL8GBTVl2Ipli3rV0F4ew7Ds6Iefn4YwLV8QEkT0Ne/f4GvDu6N3O8LvrvfT t0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QmVusOGH+GOOLFNfFS+v085kQTbudSCxdmKH/aKofHU=; b=v4o+/HoMFK2U7OB4AsYuzPn13zzqoGO/8vKOPCiTjqp1cMhnAqzskyFHuI8XMcVwLL eAOy69ImcPnGRLGqt3IX/KXN7iJ6+Cmgwt/inDfc6SHrr1y5ywyOtqxwX74LTYBY/cIC 44OYR9EO+B1hfegOdn84s8UX309/MP1Fp/iU/0At9JBSMkFVvTGgQmn3r1EaC+OcSgb8 N5MnPaN+q3mKG1X7CASwJyM3YUksPRGY26X8ATOyn+mT+FzT306jt6ucsYhm3QqbpEjK F1yYnzPxj+L4umYbmBKwxZBEXoXRFz7xvxCqB7DH0wSanI7MLdopbDSwHErWeKJ7rAtq 1/qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GWvIKwCG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si18329233plb.30.2019.05.20.06.55.41; Mon, 20 May 2019 06:55:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GWvIKwCG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732103AbfETLBy (ORCPT + 99 others); Mon, 20 May 2019 07:01:54 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40272 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731332AbfETLBx (ORCPT ); Mon, 20 May 2019 07:01:53 -0400 Received: by mail-pl1-f196.google.com with SMTP id g69so6561247plb.7; Mon, 20 May 2019 04:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QmVusOGH+GOOLFNfFS+v085kQTbudSCxdmKH/aKofHU=; b=GWvIKwCG8q/IawfL7yqNiyGfq7EGhV/0kfZcUH8bxpzHDb54v7B7vkE+pGYx5hbneK H0+4HO1YfUQBdJF8Sirs+rLxhJjrnhZaOJ5mP3T2V5nUZXy8I/jRSPRQyNwjZxdI+vlJ Eatz57NnnFCz8kB3fhRU7W/lBNgmN9kY5by+hdNCZZ7Hr4pGejGPOHZDszwx4K+KTN5D USux0Fp2z5xKKPSgILjqq9kL/q2hos/wuBxad89orOiSLdometeZYhf2qzl/Mah1bpo2 Xp0hW3KGzD+FIEOnvfPsLgiI9qF0T+38YFLaEbqxLZokwI17lA3SyuHnDEq7lJn183CG r/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QmVusOGH+GOOLFNfFS+v085kQTbudSCxdmKH/aKofHU=; b=rtmmKYz/u5EuOivV9QcWK5/vOhmMFflxuxxHG9LcHaW/oEkIL86s5v6uVv7Gj8NkeW jXVx/JOqJZAa34rqI0PNKvBCA9z+Q9aqqKwPwAMZwsbm5qexk0SFFxI1wfn+B5jvSSh0 2bZoXb2TIliW+C0jyAIKeymgr1qvZKNJirQ0nE48kfvKb6khd1CPx5upZIYwk9ett6mX s4u1xXMin38TfSQsdlyRtamaRhDFgYovPLyMhrebMTXkd76bbWy5nlJoqY74X7kl6Hri diBgxl5VcBb3MxMCylLA35pfYhJfyDP7PJemz+az50qe5j4qYuZepnCXB/pwmJgF6Cut f8/g== X-Gm-Message-State: APjAAAVmcNUu3ZBkK6kJh0TNPOpxk7c2sXVG7MJFK41E4jFw4moAItiG LmJB28/N+3e2Y7Ry67LQof4= X-Received: by 2002:a17:902:4203:: with SMTP id g3mr56745535pld.288.1558350113231; Mon, 20 May 2019 04:01:53 -0700 (PDT) Received: from localhost ([45.32.43.45]) by smtp.gmail.com with ESMTPSA id s32sm16248735pgm.19.2019.05.20.04.01.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 04:01:52 -0700 (PDT) From: XiaoXiao Liu To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, hui.wang@canonical.com, xiaojian.cao@cn.alps.com, zhangfp1@lenovo.com, xiaoxiao.liu-1@cn.alps.com, XiaoXiao Liu Subject: [PATCH] input: alps-fix the issue the special alps trackpoint do not work. Date: Mon, 20 May 2019 07:01:49 -0400 Message-Id: <20190520110149.27107-1-sliuuxiaonxiao@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org when the alps trackpoint is detected and using the alps_v8_protocol_data procotol, the alps driver will not report the input data. solution: use standard mouse driver instead of alps driver when the specail trackpoint was detected. Signed-off-by: XiaoXiao Liu --- drivers/input/mouse/alps.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 0a6f7ca883e7..516ae1d0eb17 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -24,7 +24,7 @@ #include "psmouse.h" #include "alps.h" - +#include "trackpoint.h" /* * Definitions for ALPS version 3 and 4 command mode protocol */ @@ -2864,6 +2864,22 @@ static const struct alps_protocol_info *alps_match_table(unsigned char *e7, return NULL; } +int alps_check_is_trackpoint(struct psmouse *psmouse) +{ + u8 param[2] = { 0 }; + int error; + + error = ps2_command(&psmouse->ps2dev, + param, MAKE_PS2_CMD(0, 2, TP_READ_ID)); + if (error) + return error; + + if (param[0] == TP_VARIANT_ALPS) + return 0; + psmouse_warn(psmouse, "It is not alps trackpoint.\n"); + return -ENODEV; +} + static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) { const struct alps_protocol_info *protocol; @@ -2912,6 +2928,11 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) protocol = &alps_v3_protocol_data; } else if (e7[0] == 0x73 && e7[1] == 0x03 && (e7[2] == 0x14 || e7[2] == 0x28)) { + if (alps_check_is_trackpoint(psmouse) == 0) { + psmouse_warn(psmouse, + "It is alps trackpoint, use the standard mouse driver.\n"); + return -EINVAL; + } protocol = &alps_v8_protocol_data; } else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0xc8) { protocol = &alps_v9_protocol_data; -- 2.20.1