From patchwork Mon Jun 19 23:20:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Donohue X-Patchwork-Id: 9798011 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 A5575601C8 for ; Mon, 19 Jun 2017 23:20:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 927D22029B for ; Mon, 19 Jun 2017 23:20:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8500A203C0; Mon, 19 Jun 2017 23:20:40 +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, T_TVD_MIME_EPI 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 18182206AC for ; Mon, 19 Jun 2017 23:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752475AbdFSXU3 (ORCPT ); Mon, 19 Jun 2017 19:20:29 -0400 Received: from Lepton.TopQuark.net ([168.235.66.66]:57916 "EHLO Mail2.TopQuark.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420AbdFSXU3 (ORCPT ); Mon, 19 Jun 2017 19:20:29 -0400 Received: from Mail1.TopQuark.net (pool-108-48-201-133.washdc.fios.verizon.net [108.48.201.133]) by Mail2.TopQuark.net (Postfix) with ESMTP id 10BF6F6001D; Mon, 19 Jun 2017 19:20:26 -0400 (EDT) Received: from Mail1.TopQuark.net (unknown [127.0.0.1]) by Mail1.TopQuark.net (Postfix) with ESMTP id 9BD8A27EE0C7; Mon, 19 Jun 2017 19:20:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=PaulSD.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=mail; bh=zYK0b5gqnw+dxTkG8HsdAMuOMqs=; b=JTgnNH9 wOKvP6GT1mgZ+dIV1feXXGyUt4HnCBQJX6rny98+Kp55p1025kAUoBfWJHwPN4Mu n32y4Ksih+aN9sNoCUOFdrMOryuAkAzXanwQwKh5THDtwLgI5F5qZktcmzyHxv5C uK86kZ6GA/qW6QFf/RcpViLdxvoHvdYdvlxI= Received: by Mail1.TopQuark.net (Postfix, from userid 1000) id 801FA27EE0D0; Mon, 19 Jun 2017 19:20:26 -0400 (EDT) Date: Mon, 19 Jun 2017 19:20:26 -0400 From: Paul Donohue To: Laura Abbott Cc: Masaki Ota , Dmitry Torokhov , Pali Rohar , Nick Fletcher , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "scott.s.lowe@gmail.com" Subject: Re: [REGRESSION] Touchpad failure after e7348396c6d5 ("Input: ALPS - fix V8+ protocol handling (73 03 28)") Message-ID: <20170619232026.GG1855@TopQuark.net> References: <937d0082-5c51-e0b5-dcf9-efade5ecbde5@redhat.com> <20170603040349.GB16345@TopQuark.net> <75b84b97-5f36-a3be-bb4e-e43cd72d9921@redhat.com> <20170619184315.GF1855@TopQuark.net> <0995261b-8d19-64af-9b66-e1eab579a3d4@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0995261b-8d19-64af-9b66-e1eab579a3d4@redhat.com> 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 On Mon, Jun 19, 2017 at 01:02:18PM -0700, Laura Abbott wrote: > On 06/19/2017 11:43 AM, Paul Donohue wrote: > > I get the same results as you - x_max and y_max affect cursor speed, and x_res and y_res seem to have no effect. I can't seem to come up with any values that cause intermittent cursor issues on one side of the touchpad. > > Both max and res do get passed up to the X driver, and I do see references to both max and resolution in xf86-input-evdev, although I haven't actually traced it through to see if/where each value is actually consumed with my setup. > > > > Maybe we should ask the user to try a few more tests? > > 1) Using the original code (without the modifications from bug 195215), add the following before 'return 0' at the end of alps_update_device_area_ss4_v2(), then run `dmesg | grep num-electrodes` after loading the alps kernel module to get the output. This should tell us what values the user is actually reading from the hardware: > > psmouse_err(psmouse, > > "pitch %dx%d num-electrodes %dx%d physical size %dx%dmm res %dx%d max %dx%d\n", > > x_pitch, y_pitch, num_x_electrode, num_y_electrode, > > x_phys / 10, y_phys / 10, priv->x_res, priv->y_res, priv->x_max, priv->y_max); > > 2) Use the old electrode count code but the new pitch code: > > if (IS_SS4PLUS_DEV(priv->dev_id)) { > > num_x_electrode = > > SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F); > > num_y_electrode = > > SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F); > > > > priv->x_max = > > (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE; > > priv->y_max = > > (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE; > > > > x_pitch = (otp[0][1] & 0x0F) + SS4PLUS_MIN_PITCH_MM; > > y_pitch = ((otp[0][1] >> 4) & 0x0F) + SS4PLUS_MIN_PITCH_MM; > > > > } else { > > 3) Use the new electrode count code but the old pitch code: > > if (IS_SS4PLUS_DEV(priv->dev_id)) { > > num_x_electrode = > > SS4PLUS_NUMSENSOR_XOFFSET + (otp[0][2] & 0x0F); > > num_y_electrode = > > SS4PLUS_NUMSENSOR_YOFFSET + ((otp[0][2] >> 4) & 0x0F); > > > > priv->x_max = > > (num_x_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; > > priv->y_max = > > (num_y_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; > > > > x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM; > > y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM; > > > > } else { > > > > Can you produce patches for these test cases? I've reduced it to two test cases. Patches attached. diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 262d1057c1da..f57dca5cecd5 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2476,8 +2476,8 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], priv->y_max = (num_y_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; - x_pitch = (otp[0][1] & 0x0F) + SS4PLUS_MIN_PITCH_MM; - y_pitch = ((otp[0][1] >> 4) & 0x0F) + SS4PLUS_MIN_PITCH_MM; + x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM; + y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM; } else { num_x_electrode = @@ -2500,6 +2500,11 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], priv->x_res = priv->x_max * 10 / x_phys; /* units / mm */ priv->y_res = priv->y_max * 10 / y_phys; /* units / mm */ + psmouse_err(psmouse, + "test2 pitch %dx%d num-electrodes %dx%d physical size %dx%dmm res %dx%d max %dx%d\n", + x_pitch, y_pitch, num_x_electrode, num_y_electrode, + x_phys / 10, y_phys / 10, priv->x_res, priv->y_res, priv->x_max, priv->y_max); + return 0; } diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 262d1057c1da..341a6c3bf907 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2467,14 +2467,14 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], if (IS_SS4PLUS_DEV(priv->dev_id)) { num_x_electrode = - SS4PLUS_NUMSENSOR_XOFFSET + (otp[0][2] & 0x0F); + SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F); num_y_electrode = - SS4PLUS_NUMSENSOR_YOFFSET + ((otp[0][2] >> 4) & 0x0F); + SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F); priv->x_max = - (num_x_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; + (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE; priv->y_max = - (num_y_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE; + (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE; x_pitch = (otp[0][1] & 0x0F) + SS4PLUS_MIN_PITCH_MM; y_pitch = ((otp[0][1] >> 4) & 0x0F) + SS4PLUS_MIN_PITCH_MM; @@ -2500,6 +2500,11 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], priv->x_res = priv->x_max * 10 / x_phys; /* units / mm */ priv->y_res = priv->y_max * 10 / y_phys; /* units / mm */ + psmouse_err(psmouse, + "test1 pitch %dx%d num-electrodes %dx%d physical size %dx%dmm res %dx%d max %dx%d\n", + x_pitch, y_pitch, num_x_electrode, num_y_electrode, + x_phys / 10, y_phys / 10, priv->x_res, priv->y_res, priv->x_max, priv->y_max); + return 0; }