From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751156AbdKTInu (ORCPT ); Mon, 20 Nov 2017 03:43:50 -0500 Received: from mail-ty1jpn01on0067.outbound.protection.outlook.com ([104.47.93.67]:29600 "EHLO JPN01-TY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751087AbdKTInt (ORCPT ); Mon, 20 Nov 2017 03:43:49 -0500 From: Masaki Ota To: =?utf-8?B?UGFsaSBSb2jDoXI=?= , Masaki Ota <012nexus@gmail.com>, "dmitry.torokhov@gmail.com" CC: "benjamin.tissoires@redhat.com" , "aaron.ma@canonical.com" , "jaak@ristioja.ee" , "linux-input@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] Support TrackStick of Thinkpad L570 Thread-Topic: [PATCH] Support TrackStick of Thinkpad L570 Thread-Index: AQHTYdT2HFG582h6Z0eoBSc7x32zcKMc78IAgAACa7A= Date: Mon, 20 Nov 2017 08:43:45 +0000 Message-ID: References: <20171120075530.4880-1-masaki.ota@jp.alps.com> <20171120082942.hgvxguc6vjusi52k@pali> In-Reply-To: <20171120082942.hgvxguc6vjusi52k@pali> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [106.184.109.136] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;TYXPR01MB0719;20:ZKoumZv2PKX7Cd2Yu3syCFSxfdWjjp8gDWgNJpSq+KRQnk6/n9mx5oIs3OwNnNErN3zjZ9jxiMYpfz4xqwFDh+7SdOAA12T8qhezU47plHe8ySgZehwPkhpO9E3fRV5/hy+YsT0bsPSaKbhFl7sg8cXJjqbgaz1H9+LlLH/PpoU= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 7ca81598-f686-4da5-625f-08d52ff2cfd7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603258);SRVR:TYXPR01MB0719; x-ms-traffictypediagnostic: TYXPR01MB0719: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(198206253151910)(9931346810618); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231022)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:TYXPR01MB0719;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:TYXPR01MB0719; x-forefront-prvs: 04976078F0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(13464003)(24454002)(189002)(2900100001)(3846002)(74316002)(6436002)(6116002)(102836003)(53546010)(33656002)(106356001)(105586002)(86362001)(229853002)(110136005)(85182001)(316002)(6506006)(54906003)(575784001)(68736007)(8936002)(77096006)(97736004)(53936002)(4326008)(99286004)(39060400002)(6246003)(2501003)(54356999)(101416001)(50986999)(76176999)(9686003)(305945005)(55016002)(25786009)(5660300001)(189998001)(2906002)(478600001)(7736002)(7696004)(3280700002)(2950100002)(42882006)(3660700001)(66066001)(14454004)(8676002)(81166006)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:TYXPR01MB0719;H:TYXPR01MB0719.jpnprd01.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:0;MX:1;LANG:en; authentication-results: spf=none (sender IP is ) smtp.mailfrom=masaki.ota@jp.alps.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: jp.alps.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca81598-f686-4da5-625f-08d52ff2cfd7 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Nov 2017 08:43:45.5883 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 57e76998-77bd-4b82-a424-198f46eb2254 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYXPR01MB0719 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAK8hvg5006278 Hi, Pali, 1) Yes, but we don't have FW update plan. And this device works as SMBus in Windows, so this issue happens on only Linux. 2) Yes. Best Regards, Masaki Ota -----Original Message----- From: Pali Rohár [mailto:pali.rohar@gmail.com] Sent: Monday, November 20, 2017 5:30 PM To: Masaki Ota <012nexus@gmail.com>; dmitry.torokhov@gmail.com Cc: benjamin.tissoires@redhat.com; aaron.ma@canonical.com; jaak@ristioja.ee; 太田 真喜 Masaki Ota ; linux-input@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] Support TrackStick of Thinkpad L570 On Monday 20 November 2017 16:55:30 Masaki Ota wrote: > From: Masaki Ota > - The issue is that Thinkpad L570 TrackStick does not work. Because the main interface of Thinkpad L570 device is SMBus, so ALPS overlooked PS2 interface Firmware setting of TrackStick. The detail is that TrackStick otp bit is disabled. > - Add the code that checks 0xD7 address value. This value is device number information, so we can identify the device by checking this value. > - If we check 0xD7 value, we need to enable Command mode and after check the value we need to disable Command mode, then we have to enable the device(0xF4 command). > - Thinkpad L570 device number is 0x0C or 0x1D. If it is TRUE, enable ALPS_DUALPOINT flag. So, the root of this problem is in ALPS firmware which provides wrong information to kernel? Masaki, I have two questions: 1) Can ALPS or Lenovo release a new firmware update for this Thinkpad to fix this issue? 2) Have all Thinkpad L570 machines trackpoint? Dmitry, as a workaround for firmware bug on particular notebook, would not be better to check DMI information and DMI based hook? > Signed-off-by: Masaki Ota > --- > drivers/input/mouse/alps.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c > index 850b00e3ad8e..cce52104ed5a 100644 > --- a/drivers/input/mouse/alps.c > +++ b/drivers/input/mouse/alps.c > @@ -2541,13 +2541,28 @@ static int > alps_update_btn_info_ss4_v2(unsigned char otp[][4], } > > static int alps_update_dual_info_ss4_v2(unsigned char otp[][4], > - struct alps_data *priv) > + struct alps_data *priv, > + struct psmouse *psmouse) > { > bool is_dual = false; > + int reg_val = 0; > + struct ps2dev *ps2dev = &psmouse->ps2dev; > > - if (IS_SS4PLUS_DEV(priv->dev_id)) > + if (IS_SS4PLUS_DEV(priv->dev_id)) { > is_dual = (otp[0][0] >> 4) & 0x01; > > + /* For support TrackStick of Thinkpad L570 device */ > + if (alps_exit_command_mode(psmouse) == 0 && > + alps_enter_command_mode(psmouse) == 0) { > + reg_val = alps_command_mode_read_reg(psmouse, 0xD7); > + } > + alps_exit_command_mode(psmouse); > + ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); > + > + if (reg_val == 0x0C || reg_val == 0x1D) > + is_dual = true; > + } > + > if (is_dual) > priv->flags |= ALPS_DUALPOINT | > ALPS_DUALPOINT_WITH_PRESSURE; > @@ -2570,7 +2585,7 @@ static int alps_set_defaults_ss4_v2(struct > psmouse *psmouse, > > alps_update_btn_info_ss4_v2(otp, priv); > > - alps_update_dual_info_ss4_v2(otp, priv); > + alps_update_dual_info_ss4_v2(otp, priv, psmouse); > > return 0; > } -- Pali Rohár pali.rohar@gmail.com