Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4635034ioa; Wed, 27 Apr 2022 07:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQ6WwMu2KRI/6GAiIbBbqgkR0l6YtOsQIpPCtOA56AgRMTicdpHyDlueFOp4skc1Wi8nmK X-Received: by 2002:a17:903:410b:b0:15c:fd57:aa34 with SMTP id r11-20020a170903410b00b0015cfd57aa34mr18772801pld.82.1651071505513; Wed, 27 Apr 2022 07:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651071505; cv=none; d=google.com; s=arc-20160816; b=qbWFh8kfkbW2bkJZYBhrL98Vadl/EL50LLdABtL0YbYzRHLfnrw3PbpTx4vKCb9F+k l+EnppS5GAt9h2/s9Hxgzlt9X2pjM7iDjb9KHm1KXkQrcb1F/+3/rdmTEM7Ql1Hu5bsl re+8mM0F72hP+StF86do+GfuXY2gWXmmzr3iLWdSifMdl6RPZpQe8l9dXIeq/GNDhFTH 2IayV1+pk6SCO/SjPLgmjpGQ/X+WFrLiN7jbSzwpN7Y7sI33SPIAfqcFhfSfBoK9gQWP DsELQd0BI27cqCuKHhbhxuRXqbaHYUL7SC/SDVAm0Ym4DFYqgKx3OTmVfi47gnOSKurV +uVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=svV9IgBLsOwIZmPj9x7hu2PTvXDW3pGjVejTuhnh/mI=; b=KHr/j5MIpTvEC36yTEg/hhz6QIB/uoOPo7WIkr7WA+rPw34yCEIT4MNRIsewVrzhts XVvfoiikEitqa4iqiOtw2na3DMLWGHnNxhr/VQURSh0W7u+3Wft0bmAxfcEy9oUHmxNz 3tvC5QJS1Gd/hfa9lf3egjjpGcnh2anJjatb3aTTevFkEDqQhdj5W7kuQKyQEN8za9Th VphZbiX0A/ZeO26U2mbgUYdbh2aRZ69vRQQri4/RKpI5vK5/lyMjVd78MZSchvGuaESu fdTl+aHq0+nMjx1rImQ903jfq8MpGtgJFaIyuBUSu7KkQL6WHEbAXPCmf4HfsmmByfF3 HLhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=MDnnrjiW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ju10-20020a17090b20ca00b001d285255f40si5657388pjb.32.2022.04.27.07.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=MDnnrjiW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2856B186C3; Wed, 27 Apr 2022 07:31:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238083AbiD0Odv (ORCPT + 99 others); Wed, 27 Apr 2022 10:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237948AbiD0Oda (ORCPT ); Wed, 27 Apr 2022 10:33:30 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DB3F2630; Wed, 27 Apr 2022 07:30:16 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id w4so2743311wrg.12; Wed, 27 Apr 2022 07:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=svV9IgBLsOwIZmPj9x7hu2PTvXDW3pGjVejTuhnh/mI=; b=MDnnrjiWGOwxINe0CR2NtRtg3tFohitnFemsC7KPWxPgakmlwCBapdJpZ1PQv10tIt NNFVT+oJi3BBncAEcqp1VzW+9ubQbT9W2S5/Po8pwj7jQPF8ru9RFwtAzzObjk+x54GL RfOIboxHsC5p7JABnxayDVk91IK7vmXe3kqB+c0BpECFyW1qGiSvtdhOQyUpBhlHwoxU SZobtnVNXBX5maDtcE8SJTBAMo0ujMvEgUc1rsoHcwcpPk3rO6PuRpL44KAmOMKEfAiL v9Ez/NsHpvzaJK5jQ1zLTJKYpZnJ2ta/ZZPbp1gJ9FULmCE5GauIetkO+BarSbB26f4I PUxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=svV9IgBLsOwIZmPj9x7hu2PTvXDW3pGjVejTuhnh/mI=; b=vCdOMnAM8C13yvy9DkndPI8j3tHSr35W/SlBpd4So/oSt2LuXK33CxYo1BqZazXxFu 8FRBWf6sx3R+atZK0lhk9jhIIVFPNFJt/nHm6PLRZtZE6iK1eh42AcLRaNPBc3FK8MCQ ZACTnL0Q6alVcwbOqwamwian9Hd/hPUsXsb38EqUDL8LS9tl0k1OrjpPU2ILmxX+/Okg jZ44H31l5asbm0tJtgB5O5oTMm7SQFvekp+cduYHRdHsZ1wD4/7AXmoXiFYWxq0VMRsj HoRHNOZiyUjpHuNuenPf3jlzyqIDUATyZlNa0hmp5esLKaaFz87IeywwayorA1b+yeeE SV6Q== X-Gm-Message-State: AOAM531mUTWGo+e6Z+omqe70uzB4pHuj9TpY9jZ9oM8iMjHbOS0Hkey2 VOsyXXT7VVh4ClE30FKovUc= X-Received: by 2002:adf:eb07:0:b0:207:8534:2ef6 with SMTP id s7-20020adfeb07000000b0020785342ef6mr22294174wrn.62.1651069815015; Wed, 27 Apr 2022 07:30:15 -0700 (PDT) Received: from tiger.museclub.art (p200300cf9f393100d379c1e4199524ea.dip0.t-ipconnect.de. [2003:cf:9f39:3100:d379:c1e4:1995:24ea]) by smtp.googlemail.com with ESMTPSA id i14-20020a1c540e000000b00393dc91e9c9sm1721625wmb.17.2022.04.27.07.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 07:30:14 -0700 (PDT) From: Eugene Shalygin Cc: Eugene Shalygin , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] hwmon: (asus-ec-sensors) add PRIME X470-PRO board Date: Wed, 27 Apr 2022 16:30:01 +0200 Message-Id: <20220427143001.1443605-5-eugene.shalygin@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427143001.1443605-1-eugene.shalygin@gmail.com> References: <20220427143001.1443605-1-eugene.shalygin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,SPOOFED_FREEMAIL_NO_RDNS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This board is supposed to be handled by the asus-wmi-sensors driver, but due to a buggy WMI implementation the driver and the official ASUS software make the BIOS hang together with fan controls [1, 2]. This driver complements values provided by the SIO chip and does not freeze the BIOS, as tested by a user [2]. [1] https://github.com/electrified/asus-wmi-sensors/blob/master/README.md [2] https://github.com/zeule/asus-ec-sensors/issues/12 Signed-off-by: Eugene Shalygin --- drivers/hwmon/asus-ec-sensors.c | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c index 109c3920d77c..998d49d6b799 100644 --- a/drivers/hwmon/asus-ec-sensors.c +++ b/drivers/hwmon/asus-ec-sensors.c @@ -137,10 +137,41 @@ enum ec_sensors { enum board_family { family_unknown, + family_amd_400_series, family_amd_500_series, }; /* All the known sensors for ASUS EC controllers */ +static const struct ec_sensor_info sensors_family_amd_400[] = { + [ec_sensor_temp_chipset] = + EC_SENSOR("Chipset", hwmon_temp, 1, 0x00, 0x3a), + [ec_sensor_temp_cpu] = + EC_SENSOR("CPU", hwmon_temp, 1, 0x00, 0x3b), + [ec_sensor_temp_mb] = + EC_SENSOR("Motherboard", hwmon_temp, 1, 0x00, 0x3c), + [ec_sensor_temp_t_sensor] = + EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d), + [ec_sensor_temp_vrm] = + EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x3e), + [ec_sensor_in_cpu_core] = + EC_SENSOR("CPU Core", hwmon_in, 2, 0x00, 0xa2), + [ec_sensor_fan_cpu_opt] = + EC_SENSOR("CPU_Opt", hwmon_fan, 2, 0x00, 0xbc), + [ec_sensor_fan_vrm_hs] = + EC_SENSOR("VRM HS", hwmon_fan, 2, 0x00, 0xb2), + [ec_sensor_fan_chipset] = + /* no chipset fans in this generation */ + EC_SENSOR("Chipset", hwmon_fan, 0, 0x00, 0x00), + [ec_sensor_fan_water_flow] = + EC_SENSOR("Water_Flow", hwmon_fan, 2, 0x00, 0xb4), + [ec_sensor_curr_cpu] = + EC_SENSOR("CPU", hwmon_curr, 1, 0x00, 0xf4), + [ec_sensor_temp_water_in] = + EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x0d), + [ec_sensor_temp_water_out] = + EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x0b), +}; + static const struct ec_sensor_info sensors_family_amd_500[] = { [ec_sensor_temp_chipset] = EC_SENSOR("Chipset", hwmon_temp, 1, 0x00, 0x3a), @@ -186,6 +217,15 @@ struct ec_board_info { }; static const struct ec_board_info board_info[] = { + { + .board_names = {"PRIME X470-PRO"}, + .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | + SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM | + SENSOR_FAN_CPU_OPT | + SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE, + .mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH, + .family = family_amd_400_series, + }, { .board_names = {"PRIME X570-PRO"}, .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM | @@ -753,6 +793,9 @@ static int __init asus_ec_probe(struct platform_device *pdev) ec_data->board_info = pboard_info; switch (ec_data->board_info->family) { + case family_amd_400_series: + ec_data->sensors_info = sensors_family_amd_400; + break; case family_amd_500_series: ec_data->sensors_info = sensors_family_amd_500; break; -- 2.35.1