Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2922599imu; Fri, 18 Jan 2019 01:31:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7HwauvGIs+8WiTIGRzMvp8AhtDkHqF6rWnNyTbVlDOWwOJfFjQ/wGv7pbzAqZQOTAaCJKW X-Received: by 2002:a17:902:7896:: with SMTP id q22mr18745141pll.280.1547803889668; Fri, 18 Jan 2019 01:31:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547803889; cv=none; d=google.com; s=arc-20160816; b=brWrf4aTbWf6qYU9+pXoY7zDzcJD1U96Yuj9sED1M1Xgfmx3SBaXiICAlXErIbcKdf 7Qyi3mFzxsc20hoeqmJhYoop/LnLVttD3FAZJxkR4IxKzdeoRsVLp+sJwRnV53JDwetv mtHGS6Ydqw6IugQK0S3btGEWYlI9rj3x2ZUEMzCzpfXSe5yJdoy3sHBJdLTaW+bAimj2 bolpzMrMOiu4xXg6XYtoW/9EVJmc0kNJHnNQgtsEa7f0Vo98BcOhQ1DvduBtybjvL1fm I2yzvzGCCwhV9NXepcPP5kuElnEHhGhQgouBtcUxo7lef8h1LbP/F4wbOXRx69HjAoib YyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from; bh=a5i7hY+jXoYpS0lmsp0uRN5emPJXkkbJjwOlIGdycww=; b=G10yuSCfJzt5X062YOBwFF3cbrtOcR97Bkf0aerCsIwnlf/Q7txIbb+ebXRTnn9xBY bFdrYereuqWJ/0MminPgY6IKbkyKAOP2E1BEDQ2i7q1rcX3SE5P3LsWAA+4jicj/bNjv dMyeHyR3JIA1/+hMwELTNW50H5x9QYxezAHdwwFWf0HEZLYdA53lYZHlGfj44NCyYC/H 27wIrnn6ySjFLTrInJ7RFATdk4Npea5+fvezyCn6hC5pMub6JHGys8Na4euzawRW0c6q HyWVeXS9s+jXFm2scVpcOa8Ik+WMEq1hjJgoYz7PrUtGCHbLci0mxMgvkAfZ6IaclEAw aU2w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si1224760pgf.527.2019.01.18.01.31.10; Fri, 18 Jan 2019 01:31:29 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726880AbfARJ3w convert rfc822-to-8bit (ORCPT + 99 others); Fri, 18 Jan 2019 04:29:52 -0500 Received: from emcscan.emc.com.tw ([192.72.220.5]:40447 "EHLO emcscan.emc.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfARJ3v (ORCPT ); Fri, 18 Jan 2019 04:29:51 -0500 Received: from unknown (HELO elanic) ([192.168.10.6]) by emcscan.emc.com.tw with ESMTP; 18 Jan 2019 17:29:48 +0800 Received: from elanic (elanic.emc.com.tw [127.0.0.1]) by elanic (Postfix) with ESMTP id 76F793CAA48; Fri, 18 Jan 2019 17:29:47 +0800 (CST) Received: from nb92073 (unknown [192.168.33.46]) by elanic (Postfix) with ESMTP id 55BB83C9A1A; Fri, 18 Jan 2019 17:29:47 +0800 (CST) From: =?big5?B?ufmxUrph?= To: "'Kai Heng Feng'" , "'Benjamin Tissoires'" Cc: "'Dmitry Torokhov'" , "'open list:HID CORE LAYER'" , "'lkml'" References: <20190117092948.32079-1-kai.heng.feng@canonical.com> <0BD3A587-B7B6-4C99-8F87-187394FF6EFC@canonical.com> In-Reply-To: <0BD3A587-B7B6-4C99-8F87-187394FF6EFC@canonical.com> Subject: RE: [PATCH 1/1] Input: elantech: Use SMBus based on bus info Date: Fri, 18 Jan 2019 17:29:48 +0800 Message-ID: <008c01d4af10$5b157f20$11407d60$@emc.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHJ0ez6sNBF33KjOgYLuyaFbXnUWQExGMrGAaD412qls+jlsA== Content-Language: zh-tw Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----Original Message----- From: Kai Heng Feng [mailto:kai.heng.feng@canonical.com] Sent: Friday, January 18, 2019 12:15 AM To: Benjamin Tissoires Cc: Dmitry Torokhov; ???R?a; open list:HID CORE LAYER; lkml Subject: Re: [PATCH 1/1] Input: elantech: Use SMBus based on bus info > On Jan 17, 2019, at 10:42 PM, Benjamin Tissoires wrote: > > Hi Kai-Heng, > > On Thu, Jan 17, 2019 at 10:30 AM Kai-Heng Feng > wrote: >> >> There are some new HP laptops with Elantech touchpad don't support >> multitouch. >> >> Both ETP_BUS_SMB_HST_NTFY_ONLY and ETP_BUS_PS2_SMB_HST_NTFY devices >> can use SMBus to support 5 fingers touch, so we need to chech them too. >> >> So use elantech_use_host_notify() to do a more thouroughly check. >> >> Signed-off-by: Kai-Heng Feng >> --- >> drivers/input/mouse/elantech.c | 58 >> +++++++++++++++++----------------- >> 1 file changed, 29 insertions(+), 29 deletions(-) >> >> diff --git a/drivers/input/mouse/elantech.c >> b/drivers/input/mouse/elantech.c index 9fe075c137dc..5bcf1c147eb1 >> 100644 >> --- a/drivers/input/mouse/elantech.c >> +++ b/drivers/input/mouse/elantech.c >> @@ -1799,6 +1799,34 @@ static int elantech_create_smbus(struct psmouse *psmouse, >> leave_breadcrumbs); } >> >> +static bool elantech_use_host_notify(struct psmouse *psmouse, >> + struct elantech_device_info >> +*info) { >> + if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version)) >> + return true; >> + >> + switch (info->bus) { >> + case ETP_BUS_PS2_ONLY: >> + /* expected case */ >> + break; >> + case ETP_BUS_SMB_ALERT_ONLY: >> + /* fall-through */ >> + case ETP_BUS_PS2_SMB_ALERT: >> + psmouse_dbg(psmouse, "Ignoring SMBus provider through alert protocol.\n"); >> + break; >> + case ETP_BUS_SMB_HST_NTFY_ONLY: >> + /* fall-through */ >> + case ETP_BUS_PS2_SMB_HST_NTFY: >> + return true; >> + default: >> + psmouse_dbg(psmouse, >> + "Ignoring SMBus bus provider %d.\n", >> + info->bus); >> + } >> + >> + return false; >> +} >> + >> /** >> * elantech_setup_smbus - called once the PS/2 devices are enumerated >> * and decides to instantiate a SMBus InterTouch device. >> @@ -1818,7 +1846,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse, >> * i2c_blacklist_pnp_ids. >> * Old ICs are up to the user to decide. >> */ >> - if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) || >> + if (!elantech_use_host_notify(psmouse, info) || > > That was my initial approach of the series, but I ended up being more > conservative as this would flip all of the existing elantech SMBUS > capable touchpads to use elan_i2c. > And I didn't want to deal with 4/5 year old laptops that suddenly broke. > > So I wonder if you can restrict this default change to the recent > laptops (let's say 2018+). Maybe by looking at their FW version or > something else in the DMI? It was KT who told me that I should use ETP_BUS_PS2_SMB_HST_NTFY. As for date, KT still knows better than me. KT, Can you name a year which is safe enough to enable SMBus? I have discussed it internally. The internal rule for FW's SMbus implementation is stable after 2018 If you meet some special case, please let me know. BTW, The SMbus supporting is requested by HP this time, and there are plenty of HP laptop use old IC which doesn't meet " ETP_NEW_IC_SMBUS_HOST_NOTIFY". Elan touchpad works well in PS/2 for HP, because it don't support TrackPoint. You may let old HP platform work as PS/2 for safety. Thanks KT Kai-Heng > > Cheers, > Benjamin > >> psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids)) >> return -ENXIO; >> } >> @@ -1838,34 +1866,6 @@ static int elantech_setup_smbus(struct psmouse *psmouse, >> return 0; >> } >> >> -static bool elantech_use_host_notify(struct psmouse *psmouse, >> - struct elantech_device_info *info) >> -{ >> - if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version)) >> - return true; >> - >> - switch (info->bus) { >> - case ETP_BUS_PS2_ONLY: >> - /* expected case */ >> - break; >> - case ETP_BUS_SMB_ALERT_ONLY: >> - /* fall-through */ >> - case ETP_BUS_PS2_SMB_ALERT: >> - psmouse_dbg(psmouse, "Ignoring SMBus provider through alert protocol.\n"); >> - break; >> - case ETP_BUS_SMB_HST_NTFY_ONLY: >> - /* fall-through */ >> - case ETP_BUS_PS2_SMB_HST_NTFY: >> - return true; >> - default: >> - psmouse_dbg(psmouse, >> - "Ignoring SMBus bus provider %d.\n", >> - info->bus); >> - } >> - >> - return false; >> -} >> - >> int elantech_init_smbus(struct psmouse *psmouse) { >> struct elantech_device_info info; >> -- >> 2.17.1