From patchwork Mon Dec 9 19:23:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason A. Donenfeld" X-Patchwork-Id: 181088 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4785009ile; Mon, 9 Dec 2019 11:30:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyJJAJ1puIM1MvOlbh4LgzVuCi0yfT8PN3J8NLwS53QYXD9rhN1lInPJDWglffzGCpEEM9R X-Received: by 2002:a05:6808:b38:: with SMTP id t24mr685565oij.110.1575919854597; Mon, 09 Dec 2019 11:30:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575919854; cv=none; d=google.com; s=arc-20160816; b=cjoCqHJsUuIIJgO8wl5VLQgfR987rEGwL7ZdGltm88Az6rSeP7ZOKIJLwhcXmIphV3 AOl5zA/Lzb6lfqTP0IgRUotxk2g4jBdukbBEfuo942WrJEhfqMwlBWldUZieBBKNBLN/ YYivy41WuSnyBrR2AO+AhKGBlkJv760UtZ1iKTLebTt40rdTQ2Y1NmVaMtPmSF7yQpLs 08J/0i5SMDnKx1TqYILx0rjXMixA4qbKJtTyOcQcwPrN6xBabVLNOmcATboJQPBRMUYs JAl0tel3/hHVMt8BAv85ISEntEyPdtRbCvXXUrOgO0wYJNEY4frccm8WyFerqCxLZgAe FQCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=Di2USTmixaQThF2xwfCAAyXiHhoVGQnnZbZIXXcp/jQ=; b=xlUlNg80t15ksO82Snnek7TE3LG9S9uptXYwmRDIcWkSHQwcwg+7U4vTUwUPMBmLNs eqZPDoVPQ0RX5QX9xe9XJ8W7xUiY3B2Cc+mMmKwdGwPQSjd9Lt1Xd9vZAci3Jlzxgna0 od/RX7dwVDk6ORS7C+GGB5nqLGIEckrD0j4IShtuQKBA8psWZXfwPiGFNIQaauZrohMZ oz705Wcs2v9OHyMRQmzIFpqkQ0iM43klnK1QVdcXWoRolepVTCkjJQaOn6Kxz8gI9LTh ZIM5CMApGEKtyClfwG7kzRnAOMFzdZ4mpyrepMuOyP6OUuSjBt6ogBA2Pg+mLRJCqI4j NM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=onl4eZ6d; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si513586oic.86.2019.12.09.11.30.53 for ; Mon, 09 Dec 2019 11:30:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=onl4eZ6d; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbfLITax (ORCPT ); Mon, 9 Dec 2019 14:30:53 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:52293 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbfLITaw (ORCPT ); Mon, 9 Dec 2019 14:30:52 -0500 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Mon, 09 Dec 2019 14:30:52 EST Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 3f7c4703 for ; Mon, 9 Dec 2019 18:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :from:date:message-id:subject:to:cc:content-type; s=mail; bh=211 g6BPOlMn2VL7a75A4ur0B78o=; b=onl4eZ6deTC6TBpEea536jU3o1S4yvFvfoM s1c/a07loIETZxrCpaSj4JN9DaRnaijMykRJ8HQ0cjgL2uRLbHFbB4pwdJ5rkH4/ RBJWEJE+y78fx76Rx+IkmRbrtk6SMgEkMIi6rI9wevo4FGy/4K0qQp1NOQeTZx3I F/OplpdH9J3ogfAg9YcoUBAM/c9dkPm2hmmKL9lWaa49qEWW/bWHe5ovkaeE29da IKvkSyVXMOWZJd5wlzF7HhLavUozOW4yusw+ANoaVWR3ojXGgeFR17A03T+zJR4k 2UtHtmdD4yZkfI0DBouA3I9JvK4dpqn0hhSmArEPTpT/eZg1qtg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id bde08968 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 9 Dec 2019 18:28:44 +0000 (UTC) Received: by mail-ot1-f47.google.com with SMTP id i15so13247588oto.7 for ; Mon, 09 Dec 2019 11:24:11 -0800 (PST) X-Gm-Message-State: APjAAAX0em50XEgYF3DoJnd/soEMVMxodEbe8VvliYH3W3c9GxXCnGM3 zd9T7teWzd3PwfDcU7Kpr68hECiBdXuQkd7EhvQ= X-Received: by 2002:a05:6830:1141:: with SMTP id x1mr23222250otq.120.1575919450582; Mon, 09 Dec 2019 11:24:10 -0800 (PST) MIME-Version: 1.0 From: "Jason A. Donenfeld" Date: Mon, 9 Dec 2019 20:23:59 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: RMI4 for Thinkpad X1 Extreme Gen 2 / P1 Gen 2 To: lyude@redhat.com Cc: linux-input@vger.kernel.org, Dmitry Torokhov Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Hey Lyude, I see that you almost enabled RMI4 on the X1E Gen 2 recently, but reverted after seeing the touchpad mouse buttons didn't work. I was wondering if you had any more insight as to what's going on. I briefly looked, and saw that the version the bootloader is returning is an 8 instead of a 7. I tried the below hack, to see if things would work with the existing v7 driver, but no luck. Do you usually implement these by reverse engineering the Windows driver, or does Synaptics release specs, or something else? Currently, not having access to the Trackpoint speed parameters in serio3 is quite a pain for me, so I'm interested in fixing this. Thanks, Jason diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 1ae6f8bba9ae..b611cd8384a1 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -178,6 +178,7 @@ static const char * const smbus_pnp_ids[] = { "LEN0096", /* X280 */ "LEN0097", /* X280 -> ALPS trackpoint */ "LEN009b", /* T580 */ + "LEN0402", /* X1 Extreme 2nd Generation */ "LEN200f", /* T450s */ "LEN2054", /* E480 */ "LEN2055", /* E580 */ diff --git a/drivers/input/rmi4/rmi_f34.c b/drivers/input/rmi4/rmi_f34.c index e5dca9868f87..4f258909cc1d 100644 --- a/drivers/input/rmi4/rmi_f34.c +++ b/drivers/input/rmi4/rmi_f34.c @@ -370,7 +370,7 @@ static int rmi_firmware_update(struct rmi_driver_data *data, f34 = dev_get_drvdata(&data->f34_container->dev); - if (f34->bl_version == 7) { + if (f34->bl_version == 7 || f34->bl_version == 8) { if (data->pdt_props & HAS_BSR) { dev_err(dev, "%s: LTS not supported\n", __func__); return -ENODEV; @@ -382,7 +382,7 @@ static int rmi_firmware_update(struct rmi_driver_data *data, } /* Enter flash mode */ - if (f34->bl_version == 7) + if (f34->bl_version == 7 || f34->bl_version == 8) ret = rmi_f34v7_start_reflash(f34, fw); else ret = rmi_f34_enable_flash(f34); @@ -413,7 +413,7 @@ static int rmi_firmware_update(struct rmi_driver_data *data, f34 = dev_get_drvdata(&data->f34_container->dev); /* Perform firmware update */ - if (f34->bl_version == 7) + if (f34->bl_version == 7 || f34->bl_version == 8) ret = rmi_f34v7_do_reflash(f34, fw); else ret = rmi_f34_update_firmware(f34, fw); diff --git a/drivers/input/rmi4/rmi_f34v7.c b/drivers/input/rmi4/rmi_f34v7.c index 74f7c6f214ff..13b59fb9200e 100644 --- a/drivers/input/rmi4/rmi_f34v7.c +++ b/drivers/input/rmi4/rmi_f34v7.c @@ -1364,6 +1364,8 @@ int rmi_f34v7_probe(struct f34_data *f34) f34->bl_version = 6; } else if (f34->bootloader_id[1] == 7) { f34->bl_version = 7; + } else if (f34->bootloader_id[1] == 8) { + f34->bl_version = 8; } else { dev_err(&f34->fn->dev, "%s: Unrecognized bootloader version\n", __func__);