From patchwork Wed Dec 21 17:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13079015 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 C39E6C4332F for ; Wed, 21 Dec 2022 18:00:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234296AbiLUSAC (ORCPT ); Wed, 21 Dec 2022 13:00:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbiLUSAB (ORCPT ); Wed, 21 Dec 2022 13:00:01 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C8E24BC2; Wed, 21 Dec 2022 10:00:00 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671645598; bh=6GqkRUcKuJwMJo72qVD9f/Gx/0oC7Cwj+9937ZraC8U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eF8CmCCFfRQRyq96H5YPy2zQhG11HnEGg9Zz+Kkq6PXoPld3lna9OQhzM5XkmDaFq vgg5So5htnyqdBd/0io2IM+6KLg8JZhFtFf+0OZj+wSc1Cf8/dYdplUm41IKXxX40D PXa4T6I+dcSseQCo6xgs+lKrR1OPCIgAgnHQOc5g= Date: Wed, 21 Dec 2022 17:59:49 +0000 Subject: [PATCH 1/3] platform/x86: asus-wmi: Add quirk wmi_ignore_fan MIME-Version: 1.0 Message-Id: <20221221-asus-fan-v1-1-e07f3949725b@weissschuh.net> References: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> In-Reply-To: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> To: Corentin Chary , Hans de Goede , Mark Gross , "Luke D. Jones" Cc: acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671645591; l=1566; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=6GqkRUcKuJwMJo72qVD9f/Gx/0oC7Cwj+9937ZraC8U=; b=2tJc6DdqWrSkjnXYGSw8yaqYHBQu5/Z3B5QJ0VkOvuyF1+Qm8E8EBzmDmgCLGOBQQo/uNfLdaaJQ RaPrQD+8BZPt5OmCmoDeI3lPts7nCNe+oZN9MiwYEqlSIQdXPC5R X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Some laptops have a fan device listed in their ACPI tables but do not actually contain a fan. Introduce a quirk that can be used to override the fan detection logic. This was observed with a ASUS VivoBook E410MA running firmware E410MAB.304. Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/asus-wmi.c | 4 +++- drivers/platform/x86/asus-wmi.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 6f81b2844dcb..4a289ca7e76c 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2243,7 +2243,9 @@ static int asus_wmi_fan_init(struct asus_wmi *asus) asus->fan_type = FAN_TYPE_NONE; asus->agfn_pwm = -1; - if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL)) + if (asus->driver->quirks->wmi_ignore_fan) + asus->fan_type = FAN_TYPE_NONE; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_CPU_FAN_CTRL)) asus->fan_type = FAN_TYPE_SPEC83; else if (asus_wmi_has_agfn_fan(asus)) asus->fan_type = FAN_TYPE_AGFN; diff --git a/drivers/platform/x86/asus-wmi.h b/drivers/platform/x86/asus-wmi.h index 65316998b898..a478ebfd34df 100644 --- a/drivers/platform/x86/asus-wmi.h +++ b/drivers/platform/x86/asus-wmi.h @@ -38,6 +38,7 @@ struct quirk_entry { bool store_backlight_power; bool wmi_backlight_set_devstate; bool wmi_force_als_set; + bool wmi_ignore_fan; enum asus_wmi_tablet_switch_mode tablet_switch_mode; int wapf; /* From patchwork Wed Dec 21 17:59:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13079016 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 BB4C0C10F1B for ; Wed, 21 Dec 2022 18:00:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbiLUSAF (ORCPT ); Wed, 21 Dec 2022 13:00:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiLUSAC (ORCPT ); Wed, 21 Dec 2022 13:00:02 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 546F624BC5; Wed, 21 Dec 2022 10:00:01 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671645598; bh=BKyn4L5rGVDIx0LQ1r4Z4c57jvx4ixuqMWSoYecKAck=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Iqs1b+RIkAYD5w6CkJJkyw5HM+R3zTa0Nwk/7A2kjt8qDlCGnR4XB2Df1ry2/fuk4 jMR+IemR5T5gveJPq3ts40EI/+Be5Vi6tfYatI9Hop/hLi+QXgoXkXWOyGItrxtu1D TRDQE2nMqPpuarOlcFOAL4WCWRMuQGw2Laoqv1bo= Date: Wed, 21 Dec 2022 17:59:50 +0000 Subject: [PATCH 2/3] platform/x86: asus-wmi: Ignore fan on E410MA MIME-Version: 1.0 Message-Id: <20221221-asus-fan-v1-2-e07f3949725b@weissschuh.net> References: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> In-Reply-To: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> To: Corentin Chary , Hans de Goede , Mark Gross , "Luke D. Jones" Cc: acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671645591; l=1274; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=BKyn4L5rGVDIx0LQ1r4Z4c57jvx4ixuqMWSoYecKAck=; b=TPX3qg+3FekqQNnjfwWv+uM4mOthddidtLw5lc+cg3Jcs0H/Je0MNbvnWonrttIzLrzaO9GrQTLF 8ciGd5SqBEKhoGzgy/N+rGq1y3ycecsNPU3Auwhz78rQOh1bv1z/ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org The ASUS VivoBook has a fan device described in its ACPI tables but does not actually contain any physical fan. Use the quirk to inhibit fan handling. Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/asus-nb-wmi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c index c685a705b73d..5b603c686c8a 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c @@ -121,6 +121,10 @@ static struct quirk_entry quirk_asus_tablet_mode = { .tablet_switch_mode = asus_wmi_lid_flip_rog_devid, }; +static struct quirk_entry quirk_asus_ignore_fan = { + .wmi_ignore_fan = true, +}; + static int dmi_matched(const struct dmi_system_id *dmi) { pr_info("Identified laptop model '%s'\n", dmi->ident); @@ -473,6 +477,15 @@ static const struct dmi_system_id asus_quirks[] = { }, .driver_data = &quirk_asus_tablet_mode, }, + { + .callback = dmi_matched, + .ident = "ASUS VivoBook E410MA", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E410MA"), + }, + .driver_data = &quirk_asus_ignore_fan, + }, {}, }; From patchwork Wed Dec 21 17:59:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13079017 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 B634CC10F1D for ; Wed, 21 Dec 2022 18:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229968AbiLUSAH (ORCPT ); Wed, 21 Dec 2022 13:00:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbiLUSAC (ORCPT ); Wed, 21 Dec 2022 13:00:02 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5412724BC3; Wed, 21 Dec 2022 10:00:00 -0800 (PST) From: Thomas =?utf-8?q?Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1671645598; bh=DHzQpmWJLFTqwBAVXLFg5D5O5N+Kl9i3nR9nIThPLww=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dYAO+UHzW5wXut+nOIQHrC2wo6lmHyElQIRI3ngQoD1uu7CGf8qlsuU11Z4T3bNDU alABiGCHrlwhXIGV24XZjLqysz9C7LwQ0mB2zJzSZ9lEzaw/IiNkJ/QGMg8Om7bF5u MzYWEsN+/qotALjcBkMA/v+TsnGD9T4r8+LQ2AtM= Date: Wed, 21 Dec 2022 17:59:51 +0000 Subject: [PATCH 3/3] platform/x86: asus-wmi: Don't load fan curves without fan MIME-Version: 1.0 Message-Id: <20221221-asus-fan-v1-3-e07f3949725b@weissschuh.net> References: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> In-Reply-To: <20221221-asus-fan-v1-0-e07f3949725b@weissschuh.net> To: Corentin Chary , Hans de Goede , Mark Gross , "Luke D. Jones" Cc: acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas =?utf-8?q?Wei=C3=9Fschuh?= X-Mailer: b4 0.11.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1671645591; l=968; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=DHzQpmWJLFTqwBAVXLFg5D5O5N+Kl9i3nR9nIThPLww=; b=0lNvk6oQrIRPYyinJtYvmunAkwZDHlhbE8W8EwaIJNnKGwRrg5brZHoLaHbTFN06zZU2Gr/kS68z hJdfJkugBqlv/GytiG5L3tHo39rJBGxTFp0+6Zwuxe3AG5+AOJog X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org If we do not have a fan it does not make sense to load curves for it. This removes the following warnings from the kernel log: asus_wmi: fan_curve_get_factory_default (0x00110024) failed: -19 asus_wmi: fan_curve_get_factory_default (0x00110025) failed: -19 Fixes: a2bdf10ce96e ("platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32") Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/asus-wmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 4a289ca7e76c..104188d70988 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2438,6 +2438,9 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available, *available = false; + if (asus->fan_type == FAN_TYPE_NONE) + return 0; + err = fan_curve_get_factory_default(asus, fan_dev); if (err) { return 0;