From patchwork Tue Oct 18 06:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manyi Li X-Patchwork-Id: 3961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1802106wrs; Mon, 17 Oct 2022 23:25:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79VNatStpSB/+GPSyrNRoK5NMgK7iSYEcwxktn1ecQaAMc+DqwS1M3yVp7fwoxQmWCvmbt X-Received: by 2002:aa7:979a:0:b0:563:a69:96c7 with SMTP id o26-20020aa7979a000000b005630a6996c7mr1622772pfp.29.1666074331755; Mon, 17 Oct 2022 23:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666074331; cv=none; d=google.com; s=arc-20160816; b=bUTNyywJic2JkMORmZkH1QgIQgZl0Hykm5rHelYqk28IA3mbYrT8XuCj2/t3cbcGBO c3puq9puxwU+iK/M+CJM9V5GoNnQYuYbh/pYj8+gHLEARN6FAG6fhVM0feegN5GOCIR1 6xhXrHrkk2SUsXRIOctHmN4T0yBl2E8c6vIzWkMJ6GTmCZN0k9EZX8408CSbcW6Lyn8G /b98FgIqfI1RjN5E1MOoSJbvpqk7PNXIZVL3r26qZFZJKB1CqK9JMPbFGhLJQ3OCSqTm pED8Id51Db4nT71KkHRMdmR7HXnexBArBOvAt0NQsRBi0ea5MobBv7Duc1dL8ceI3y3A cSzQ== 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:message-id:date:subject:cc:to:from; bh=fd9h2fHDLCsLL4rOSfPqLcOZV1/YqVzFgDfUxoYHKUs=; b=zbbLkSBxgBEu7h48SDZpI29TnNM9UQY04qJ/j5m7AhwodCN/tUhpjZIKG6tafNaQ/b HB50XDO7cuS/6LW7rd279AHqs3Q1CSUQlx065jb0y7JPEQ8ftf6+GHfWkbxaG5urBxXy yfcaHF6v9bwmGm0vpMb9gYthrH5OaNjrLl/RNOtZF4wc2XxshPgSJY0h/O146WDEzwLv j3gDLf7AmLbwxYegsEEB4jpyNpT4Ws2fFuiubqCiLNJxtlSysy4JTyH2XmKGBlVW1t3p dC6QyU94XYcoLtMly9J2BL/Gg8OZH1jyuCq6kZCPhXAhCMQ5z8UkIpC/ZFlIfXaODuIK UMvQ== 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 q3-20020a170902eb8300b00174c5fdc8d2si13271438plg.307.2022.10.17.23.25.18; Mon, 17 Oct 2022 23:25:31 -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 S230034AbiJRGXX (ORCPT + 99 others); Tue, 18 Oct 2022 02:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiJRGXT (ORCPT ); Tue, 18 Oct 2022 02:23:19 -0400 Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E559AFFA; Mon, 17 Oct 2022 23:23:08 -0700 (PDT) X-QQ-mid: bizesmtp80t1666073706t6ngp5r2 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 18 Oct 2022 14:15:01 +0800 (CST) X-QQ-SSF: 01400000000000B0L000000A0000000 X-QQ-FEAT: RrZlkntZBfkO1zuyo6mQi/AMMkM1s35cFr2TFrzSvY2FV1QmOzOfeDuYz27oJ Q1Jkdev5h9or4exEYxbYSDVrqd6y3smAEbUyu7eiZb9tSpWBtu7y1cZW8Nn3yiRWH8cGINu 3ZoNLC2cSgek7HJ1Xc9kAtJe9BstGxsLNpM2NEHEUnLrHL3Copk4C80ymw23QVOaA/p6Pij /2pzQF5pxAewMAUIGpnFlJDmcPgnBXqYmPzKE3CuJA7JH8odfw6ZNd7uG4pjlXvWbnFS4ZS OWjwLlcz80bItVobIk5+1XPrIJTYvYO11VfUnNy2FkBQSXWvuLrd69PZzVcB0Qc3d7YKzvs xYlNHlQ4scoFTmB3J4keTNYk7hTFf+heS8MCAwlwfM9fKXH8Ria3y0nfb8a19kpt0CQngEY X-QQ-GoodBg: 1 From: Manyi Li To: ike.pan@canonical.com, hdegoede@redhat.com, markgross@kernel.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Manyi Li Subject: [PATCH] platform/x86: ideapad-laptop: Disable touchpad_switch Date: Tue, 18 Oct 2022 14:14:57 +0800 Message-Id: <20221018061457.26937-1-limanyi@uniontech.com> X-Mailer: git-send-email 2.20.1 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, 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?1747005558540946538?= 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index abd0c81d62c4..20b8a94934b4 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; @@ -1542,6 +1560,7 @@ static void ideapad_check_features(struct ideapad_private *priv) /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ priv->features.touchpad_ctrl_via_ec = !acpi_dev_present("ELAN0634", NULL, -1); + priv->features.touchpad_ctrl_via_ec = !dmi_check_system(no_touchpad_switch_list); if (!read_ec_data(handle, VPCCMD_R_FAN, &val)) priv->features.fan_mode = true;