From patchwork Tue Oct 18 09:53:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manyi Li X-Patchwork-Id: 4063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1869374wrs; Tue, 18 Oct 2022 03:03:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM67Mduo1G8oqwGk/ioq7plU5Z29zgkz5+BYuv+cBiNb7+pPtQT4g9G9j5UFuYqAEsAlo/Ax X-Received: by 2002:aa7:88d6:0:b0:563:9fe9:5da8 with SMTP id k22-20020aa788d6000000b005639fe95da8mr2410515pff.74.1666087424689; Tue, 18 Oct 2022 03:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666087424; cv=none; d=google.com; s=arc-20160816; b=hVwWLBbawfxFAapF4cNO+PYMiRQ3fKiEw1sd62GiknPO1d+GaYM52ulPhcOFIqNu/7 I0Uya90LA0BLz/SC/gou1KMYqv0QgpHh8b+gfSr3UrpMxD9ktUq7lPb8zFJJspwa2NH1 lJy/3hcatP6ZwbZMP3qFmRKqNpZKJIfAwCcKQgP0McVuTWiVhymCvjV00oqMbaljEMMY V36TwcgScEFeWTuZvrRAeZF4jeDu3tuANAowHzQ8fwWzVVS3Tmlf//kvB1bIxXKN+HU7 7gFsIMH6ViTNg87wfOZRPB0WT3P/t1taZw6Q1frxBPo4o+a7tPVnXOSRmy38F4/et73C UsOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=EDOdao6sIEtZhteiv06W8rgL5ccygExR+XdtKYQV6sw=; b=pJk4JY0FNr4dN7S56avNv7KCJgywjOhGMawKP3kusXVZ7rKitZ0RUaDSO+aoGTXkHG BZ0zUt+ANywJNcXD+klYZuLPH6Z4jLB2GKSmesZHuWPmv3/+ayu7Edoo1cUb0XLSfnvG ypAFIihbDRx5gU2XV8I1fqn7m9/MO+BkeL0jfPEuDj3H3IXpynlIAMtw1K8JWJwcb8pl b4BzWRDtqF7Cu5sSjqrqmUHWuMhOll1FpoJvtUKr5DQPqxg93MznLmugMU//BcZYawx/ PaIAsINoKqL+o05S2IQNZjI87kZzbgualjID+fsHruGxvyaJQ5P3v/rn4gIXzLqRtjMk MZqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il4-20020a17090b164400b002007cc304f3si20564324pjb.60.2022.10.18.03.03.31; Tue, 18 Oct 2022 03:03:44 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbiJRJ4b (ORCPT + 99 others); Tue, 18 Oct 2022 05:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiJRJ4R (ORCPT ); Tue, 18 Oct 2022 05:56:17 -0400 X-Greylist: delayed 13237 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 18 Oct 2022 02:56:12 PDT Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0E9DA2A85; Tue, 18 Oct 2022 02:56:12 -0700 (PDT) X-QQ-mid: bizesmtp73t1666086939tfc7fd05 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 18 Oct 2022 17:55:33 +0800 (CST) X-QQ-SSF: 01400000000000C0K000000A0000000 X-QQ-FEAT: bQsUcYFpAAYBiBHsWQunkLgscl2cKPYwrjfuIFuXB3Pw4YAWydLHFD4pq8yv0 zIRhg0mXP01fi/51RsWMDou+7Owr+a6it+uOQrgIl18ujr9zJOMJLdQvyLM2U7rjvk/G5Dy LqDck9PlY82qvKp5A+cOakwn0HgxryTKmGxR/PlzBaXtuPZ1X1jfErf07zrqbLq0ncmV79Z UTV7qOSZ7+G7DMnEelIc0cA7NLRzow894pbHbGNbWXXlPJWY7ENgYm5RZWyaoWH7/3lcU+K Ypx+xwizF0w3mzwsML0/tV9ddY0vmW71Pt6H8pM3XAgVyIXN4RVSBWV6/Jt54VIadcGvPU8 iB9W3w6aH93s5ApGKmIKDWgzhzTiz74my/Am+xGKAuDr9KSEuPfQmExXJyt/F1PcmUc9TFT W5HOny0lpG8= X-QQ-GoodBg: 1 From: Manyi Li To: hdegoede@redhat.com Cc: ike.pan@canonical.com, limanyi@uniontech.com, linux-kernel@vger.kernel.org, markgross@kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v2] platform/x86: ideapad-laptop: Disable touchpad_switch Date: Tue, 18 Oct 2022 17:53:23 +0800 Message-Id: <20221018095323.14591-1-limanyi@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvr:qybglogicsvr4 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747005558540946538?= X-GMAIL-MSGID: =?utf-8?q?1747019287424096537?= Ideapads for "Lenovo Yoga 3 Pro 1370" and "ZhaoYang K4e-IML" do not use EC to switch touchpad. Reading VPCCMD_R_TOUCHPAD will return zero thus touchpad may be blocked unexpectedly. Signed-off-by: Manyi Li --- drivers/platform/x86/ideapad-laptop.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index abd0c81d62c4..33b3dfdd1b08 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -1533,6 +1533,24 @@ static const struct dmi_system_id hw_rfkill_list[] = { {} }; +static const struct dmi_system_id no_touchpad_switch_list[] = { + { + .ident = "Lenovo Yoga 3 Pro 1370", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo YOGA 3"), + }, + }, + { + .ident = "ZhaoYang K4e-IML", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ZhaoYang K4e-IML"), + }, + }, + {} +}; + static void ideapad_check_features(struct ideapad_private *priv) { acpi_handle handle = priv->adev->handle; @@ -1541,7 +1559,12 @@ static void ideapad_check_features(struct ideapad_private *priv) priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list); /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ - priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1); + if (acpi_dev_present("ELAN0634", NULL, -1)) + priv->features.touchpad_ctrl_via_ec = 0; + else if (dmi_check_system(no_touchpad_switch_list)) + priv->features.touchpad_ctrl_via_ec = 0; + else + priv->features.touchpad_ctrl_via_ec = 1; if (!read_ec_data(handle, VPCCMD_R_FAN, &val)) priv->features.fan_mode = true;