From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8CD8C433EF for ; Fri, 1 Apr 2022 12:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343807AbiDAMGo (ORCPT ); Fri, 1 Apr 2022 08:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234186AbiDAMGn (ORCPT ); Fri, 1 Apr 2022 08:06:43 -0400 X-Greylist: delayed 444 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 01 Apr 2022 05:04:53 PDT Received: from zeus.flokli.de (mail.zeus.flokli.de [88.198.15.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00DE4119850; Fri, 1 Apr 2022 05:04:53 -0700 (PDT) Received: from localhost (179.red-79-151-102.dynamicip.rima-tde.net [79.151.102.179]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: flokli@flokli.de) by zeus.flokli.de (Postfix) with ESMTPSA id 1366B12DE808; Fri, 1 Apr 2022 11:57:27 +0000 (UTC) Date: Fri, 1 Apr 2022 13:57:26 +0200 From: Florian Klink To: Benjamin Tissoires Cc: Jiri Kosina , "open list:HID CORE LAYER" , lkml , ValdikSS Subject: Re: [PATCH v4 1/3] HID: lenovo: Add support for ThinkPad TrackPoint Keyboard II Message-ID: <20220401115726.6pp2avtl5ezqkbr2@tp> References: <20220213214924.32407-1-flokli@flokli.de> <20220213214924.32407-2-flokli@flokli.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org >On 22-04-01 12:30:47, Benjamin Tissoires wrote: >>Thanks for the work Florian, and sorry for the delay. >> >>One comment below: >>> @@ -977,11 +1114,14 @@ static int lenovo_probe_cptkbd(struct hid_device *hdev) >>> >>> /* >>> * Tell the keyboard a driver understands it, and turn F7, F9, F11 into >>> - * regular keys >>> + * regular keys (Compact only) >>> */ >>> - ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03); >>> - if (ret) >>> - hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret); >>> + if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD || >>> + hdev->product == USB_DEVICE_ID_LENOVO_CBTKBD) { >> >>Is there a chance that other PIDs included in the files are needing that call? >>I'm just worried about regressions here. >> >>Beside that question, the series is: >>Reviewed-by: Benjamin Tissoires `lenovo_probe_cptkbd` was introduced in f3d4ff0e04cc4450bdc7a4140020913b1280d205 HID: lenovo: Add support for Compact (BT|USB) keyboard) Back then, it was only called for these two "Compact (BT|USB) keyboard)" devices (see switch case in `lenovo_probe`). The new code now calls `lenovo_probe_cptkbd` also for `USB_DEVICE_ID_LENOVO_TPII{BT,USB}KBD`: > case USB_DEVICE_ID_LENOVO_CUSBKBD: > case USB_DEVICE_ID_LENOVO_CBTKBD: > case USB_DEVICE_ID_LENOVO_TPIIUSBKBD: > case USB_DEVICE_ID_LENOVO_TPIIBTKBD: > ret = lenovo_probe_cptkbd(hdev); … and the F7/9/11 thing is only done for the compact variants. Other keyboards still use other `lenovo_probe_tpkbd` and `lenovo_probe_tp10ubkbd` functions. I agree the `lenovo_probe_*` names became a bit less self-explaining over time, but the switch case in `lenovo_probe` itself should be pretty authoritative about which hardware causes which function to be called. Regards, Florian