Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5502800pxb; Mon, 7 Feb 2022 03:35:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfHK5bzATIKKQkZyEuZlnOaM7xJSuVCyNdHP2aGxz4JY47Y8sWg66LkhdJeFmKiaBN4j+y X-Received: by 2002:a17:903:2449:: with SMTP id l9mr15771178pls.116.1644233740299; Mon, 07 Feb 2022 03:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644233740; cv=none; d=google.com; s=arc-20160816; b=kH5p9syXdXnGFJYjkGdgpTV04U9Y43zIXO3VrikolOy6aDN4ttpCBC3hAIalgQ63Tv gVd/KoqPtshqBL9VSX0GZWcUk2EMoJ+xUqgdIRJ2cI32mKMdAyYvqpfnK4jAv5dpN1T8 XzEwc/yCzVwA8A/i5Wqb6zNDFiEQrl6uWO0m/QhrM44SaB/W0Ma7ot0rtOq7M7gvpDK1 ixfZgzj0jcP1DdgIkf4K9vk6k1DIr2w/IO0bikXS7NeyWmK5GyR1a28MeNG79Fv6HHLK YmfzrtYel15Wjndn07DgPvHy1LpP+SPsnI+bIFHfu4Q8IXrwEeka3HJhpyKY83kNi4j1 5mFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:subject:cc:to:from :message-id:date:dkim-signature:dkim-signature; bh=r+n2BzjZMe4yiKM8UnN2vZKd6/dHpNsv/LrkEagLy+4=; b=04tV8bF9mDaexrajkViqCIEYMwC4A1KLf8AL0csRxZPqrHvd1P0/S54YHQB05ECmx1 xocTY2trMD4eL47T99aYB9phczlBikWsONosq5trimI0kZUm25nNpzLmb/1GNDQ7afLB ajGHk2X21zkOliB4R7XmBFE7i5p4rnhfYtkSCx5TB1tNua2BOTxlM0FsYobhpp/lkz8w /jTEqbd9uy5E7W927l93QK9sxdIISUJcz8w1HT9IeYIFsLmQl4hekcEMMUUOK2X6Z9wg SPQW8kIGL+SBTKzD8t7064c8HyKG1PT1mEtSywA12Pw2B/+5gY/fkc4UROUiGvtMQ9I8 kJzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QG44PRx1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=maJjJNye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7si36702pfp.337.2022.02.07.03.35.29; Mon, 07 Feb 2022 03:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=QG44PRx1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=maJjJNye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376696AbiBDQ5Q (ORCPT + 99 others); Fri, 4 Feb 2022 11:57:16 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:36828 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376686AbiBDQ5P (ORCPT ); Fri, 4 Feb 2022 11:57:15 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 87DE7210F6; Fri, 4 Feb 2022 16:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643993834; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=r+n2BzjZMe4yiKM8UnN2vZKd6/dHpNsv/LrkEagLy+4=; b=QG44PRx1ZRF++uxRI5LpbRMe3VdzZjWTJMubYNohZMvHjiWjnJqOo/+qy5U5pXegcf9TKy fxEdHnzxZohTXobVIyiF4zC2lI7UFUzFWqnTBZNwd5YRFUyfFk4k1bd25kj0vSpc/OepGM OPx3xz8xnEiUEVltzhnBtHa6X620WUs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643993834; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=r+n2BzjZMe4yiKM8UnN2vZKd6/dHpNsv/LrkEagLy+4=; b=maJjJNyekt8rAkNjEwmOgwVvvsxku+eRvW/uKml7PgRbSUykoplypEjePlRer4rAAsQR+l gWo3ncU2fkiT7TBA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 8196BA3B89; Fri, 4 Feb 2022 16:57:14 +0000 (UTC) Date: Fri, 04 Feb 2022 17:57:14 +0100 Message-ID: From: Takashi Iwai To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: Wrongly bound Elantech touchpad on Lenovo Yoga Slim 7 User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, we've got a bug report on openSUSE Bugzilla about the broken touchpad on Lenovo Yoga Slim 7: https://bugzilla.opensuse.org/show_bug.cgi?id=1193064 The touchpad is an Elantech one, connected over i2c, and there are two drivers supporting it. Unfortunately, the default one the system binds, elan-i2c input driver, doesn't seem working properly, while i2c-hid driver works. I'm not sure what's the best fix for this, but below a quick workaround using a deny list with DMI matching. If this is OK, I can resubmit the patch for merging. Any comments appreciated. thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] Input: elan_i2c: Add deny list for Lenovo Yoga Slim 7 The touchpad on Lenovo Yoga Slim 7 doesn't work well with elan-i2c but rather better with i2c-hid. Add a deny list for avoiding to bind with elan-i2c. BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1193064 Signed-off-by: Takashi Iwai --- drivers/input/mouse/elan_i2c_core.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 47af62c12267..fd08481f7aea 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1222,6 +1223,20 @@ static void elan_disable_regulator(void *_data) regulator_disable(data->vcc); } +static const struct dmi_system_id elan_i2c_denylist[] __initconst = { +#if IS_ENABLED(CONFIG_I2C_HID_ACPI) + { + /* Lenovo Yoga Slim 7 is better supported by i2c-hid */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82A3"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Yoga Slim 7 14ITL05"), + }, + }, +#endif + { } +}; + static int elan_probe(struct i2c_client *client, const struct i2c_device_id *dev_id) { @@ -1233,6 +1248,10 @@ static int elan_probe(struct i2c_client *client, if (IS_ENABLED(CONFIG_MOUSE_ELAN_I2C_I2C) && i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { + if (dmi_check_system(elan_i2c_denylist)) { + dev_info(dev, "Hits deny list, skipping\n"); + return -ENODEV; + } transport_ops = &elan_i2c_ops; } else if (IS_ENABLED(CONFIG_MOUSE_ELAN_I2C_SMBUS) && i2c_check_functionality(client->adapter, -- 2.31.1