From patchwork Wed Apr 17 12:37:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 10905305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30E7014DB for ; Wed, 17 Apr 2019 12:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A0362625B for ; Wed, 17 Apr 2019 12:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07CFA288DD; Wed, 17 Apr 2019 12:37:34 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1ACAE2625B for ; Wed, 17 Apr 2019 12:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732134AbfDQMhc (ORCPT ); Wed, 17 Apr 2019 08:37:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36384 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732080AbfDQMhc (ORCPT ); Wed, 17 Apr 2019 08:37:32 -0400 Received: from [123.114.56.210] (helo=[192.168.1.107]) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hGjoZ-0005XC-Kt; Wed, 17 Apr 2019 12:37:24 +0000 To: masaki.ota@jp.alps.com Cc: "open list:HID CORE LAYER" From: hwang4 Subject: The alps i8042 trackstick doesn't work on a latest Lenovo laptop Message-ID: <305b3772-8441-adb1-93df-8fb629fbf1a9@canonical.com> Date: Wed, 17 Apr 2019 20:37:17 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Language: en-US 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 Hello Masaki, Recently I worked on a latest lenovo laptop, but found the trackstick and 3 buttons on top of the trackpad can't work with the latest linux kernel. But the trackpad worked well. On this machine the trackpad is is connected to an i2c synaptics controller while the trackstick and 3 buttons are connected to an i8042 alps controller. When I touch the trackstick or 3 buttons, the linux kernel will print "Rejected trackstick packet from non DualPoint device". I enabled the debug on psmouse.ko, then the kernel print: [    4.122673] psmouse serio1: alps: E6 report: 00 00 64 [    4.146342] psmouse serio1: alps: E7 report: 73 03 28 [    4.169612] psmouse serio1: alps: EC report: 73 01 03 I noticed that you wrote a patch for a similar issue: 567b9b549cfa (Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370), then I printed out the content of otp[][], they are all 0x00,  so it looks like there is no "PS2 interface Firmware setting" in this i8042 alps controller too. And when reading the register 0xD7, it returns 0x3D rather than 0x0C or 0x1D, so I put the 0x3D in the code like below:                 input_report_key(dev2, BTN_LEFT, f->ts_left); u@u-ThinkPad:~$ sudo evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0:    Sleep Button /dev/input/event1:    Lid Switch /dev/input/event2:    Power Button /dev/input/event3:    AT Translated Set 2 keyboard /dev/input/event4:    Wacom Pen and multitouch sensor Finger /dev/input/event5:    Wacom Pen and multitouch sensor Pen /dev/input/event6:    Video Bus /dev/input/event7:    AlpsPS/2 ALPS DualPoint Stick /dev/input/event8:    AlpsPS/2 ALPS DualPoint TouchPad /dev/input/event9:    Intel HID events /dev/input/event10:    Integrated Camera: Integrated C /dev/input/event11:    ThinkPad Extra Buttons /dev/input/event12:    SYNA8004:00 06CB:CD8B Touchpad /dev/input/event13:    HDA Intel PCH Mic /dev/input/event14:    HDA Intel PCH Headphone /dev/input/event15:    HDA Intel PCH HDMI/DP,pcm=3 /dev/input/event16:    HDA Intel PCH HDMI/DP,pcm=7 /dev/input/event17:    HDA Intel PCH HDMI/DP,pcm=8 /dev/input/event18:    HDA Intel PCH HDMI/DP,pcm=9 /dev/input/event19:    HDA Intel PCH HDMI/DP,pcm=10 Select the device event number [0-19]: 7 Input driver version is 1.0.1 Input device ID: bus 0x11 vendor 0x2 product 0x8 version 0x800 Input device name: "AlpsPS/2 ALPS DualPoint Stick" Supported events:   Event type 0 (EV_SYN)   Event type 1 (EV_KEY)     Event code 272 (BTN_LEFT)     Event code 273 (BTN_RIGHT)     Event code 274 (BTN_MIDDLE)   Event type 2 (EV_REL)     Event code 0 (REL_X)     Event code 1 (REL_Y)   Event type 3 (EV_ABS)     Event code 24 (ABS_PRESSURE)       Value      0       Min        0       Max      127 Properties:   Property type 0 (INPUT_PROP_POINTER)   Property type 5 (INPUT_PROP_POINTING_STICK) Testing ... (interrupt to exit) Event: time 1555485544.948547, type 2 (EV_REL), code 0 (REL_X), value 15 Event: time 1555485544.948547, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485544.948547, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 3 Event: time 1555485544.948547, -------------- SYN_REPORT ------------ Event: time 1555485544.956929, type 2 (EV_REL), code 0 (REL_X), value 15 Event: time 1555485544.956929, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485544.956929, -------------- SYN_REPORT ------------ Event: time 1555485544.966070, type 2 (EV_REL), code 0 (REL_X), value 16 Event: time 1555485544.966070, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485544.966070, -------------- SYN_REPORT ------------ Event: time 1555485544.974722, type 2 (EV_REL), code 0 (REL_X), value 16 Event: time 1555485544.974722, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485544.974722, -------------- SYN_REPORT ------------ Event: time 1555485544.984756, type 2 (EV_REL), code 0 (REL_X), value 17 Event: time 1555485544.984756, type 2 (EV_REL), code 1 (REL_Y), value -3 Event: time 1555485544.984756, -------------- SYN_REPORT ------------ Event: time 1555485544.994990, type 2 (EV_REL), code 0 (REL_X), value 17 Event: time 1555485544.994990, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485544.994990, -------------- SYN_REPORT ------------ Event: time 1555485545.005373, type 2 (EV_REL), code 0 (REL_X), value 19 Event: time 1555485545.005373, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485545.005373, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 2 Event: time 1555485545.005373, -------------- SYN_REPORT ------------ Event: time 1555485545.015056, type 2 (EV_REL), code 0 (REL_X), value 19 Event: time 1555485545.015056, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485545.015056, -------------- SYN_REPORT ------------ Event: time 1555485545.024815, type 2 (EV_REL), code 0 (REL_X), value 20 Event: time 1555485545.024815, type 2 (EV_REL), code 1 (REL_Y), value -2 Event: time 1555485545.024815, -------------- SYN_REPORT ------------ Event: time 1555485545.034701, type 2 (EV_REL), code 0 (REL_X), value 19 Event: time 1555485545.034701, type 2 (EV_REL), code 1 (REL_Y), value -3 Event: time 1555485545.034701, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 3 Thanks, Hui. --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2568,7 +2568,7 @@ static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],                         alps_exit_command_mode(psmouse);                         ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); -                       if (reg_val == 0x0C || reg_val == 0x1D) +                       if (reg_val == 0x0C || reg_val == 0x1D || reg_val == 0x3D)                                 is_dual = true;                 }         } After that, the 3 buttons worked well, and the trackstick basically worked. Basically work here means when I move trackstick, the cursor can move, but the cursor moves very fast, it doesn't like the trackpad which moves smoothly. If I run sudo evtest on other tracksticks or trackpads, they basically report +1 or -1 for rel_x or rel_y, but on this alps trackstick, it reports 10+ for rel_x or rel_y usually (evtest log is pasted at the end of this email),  If I did some hack in the code like below, the trackstick can move smoothly too, but it is really a ugly hack. Do you have any idea why it moves so fast? Is it has something to do with the "PS2 interface Firmware setting" too? --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -1362,8 +1362,8 @@ static void alps_process_packet_ss4_v2(struct psmouse *psmouse)                         return;                 } -               input_report_rel(dev2, REL_X, SS4_TS_X_V2(packet)); -               input_report_rel(dev2, REL_Y, SS4_TS_Y_V2(packet)); +               input_report_rel(dev2, REL_X, SS4_TS_X_V2(packet)/16); +               input_report_rel(dev2, REL_Y, SS4_TS_Y_V2(packet)/16);                 input_report_abs(dev2, ABS_PRESSURE, SS4_TS_Z_V2(packet));