summaryrefslogtreecommitdiff
path: root/drivers/hwmon/asus-ec-sensors.c
AgeCommit message (Collapse)AuthorFilesLines
2023-10-28hwmon: (asus-ec-sensors) add ROG Crosshair X670E Gene.Ellie Hermaszewska1-0/+12
Only the temp sensors that I can verify are present. T_Sensor is the temperature reading of a 10kΩ β=3435K NTC thermistor optionally connected to the T_SENSOR header. The other sensors are as found on the X670E Hero. Signed-off-by: Ellie Hermaszewska <kernel@monoid.al> Link: https://lore.kernel.org/r/20231026104332.906357-1-kernel@monoid.al Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-08-21hwmon: (asus-ec-sensosrs) fix mutex path for X670E HeroEugene Shalygin1-1/+1
A user reported that they observe race condition warning [1] and after looking once again into the DSDT source it was found that wrong mutex was used. [1] https://github.com/zeule/asus-ec-sensors/issues/43 Fixes: 790dec13c012 ("hwmon: (asus-ec-sensors) add ROG Crosshair X670E Hero.") Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230821115418.25733-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-06-08hwmon: (asus-ec-sensors) add ROG Crosshair X670E Hero.Michael Carns1-0/+30
Only the temp sensors that I can verify are present. HWINFO in Windows shows other accumulated data and statistics (time since installed, total power used, etc) that I have not attempted to find. Signed-off-by: Michael Carns <mike@carns.com> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230426200345.65765-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-19hwmon: (asus-ec-sensors) add ROG STRIX Z390-F GAMINGEugene Shalygin1-0/+10
The definition comes from a LHM PR [1], and the mutex path from the ACPI dump, kindly provided by the PR author [2] [1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/1031 [2] https://github.com/zeule/asus-ec-sensors/issues/36 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230405224339.358675-3-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-04-19hwmon: (asus-ec-sensors) add ProArt B550-Creatorfireflame900511-0/+10
Add support for the ASUS ProArt B550-Creator board, was tested with the hardware [1]. [1] https://github.com/zeule/asus-ec-sensors/issues/35 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Signed-off-by: fireflame90051 <cacoukoulis@gmail.com> Link: https://lore.kernel.org/r/20230405224339.358675-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03hwmon: (asus-ec-sensors) add zenith ii extreme alphaEric Nguyen1-0/+2
The ROG ZENITH II EXTREME ALPHA provides the same set of sensors as the no-ALPHA version. Tested with the hardware [1]. [1] https://github.com/zeule/asus-ec-sensors/issues/31 Signed-off-by: Eric Nguyen <linux@drogman.ch> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230128102135.5199-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2023-02-03hwmon: (asus-ec-sensors) add missing mutex pathEugene Shalygin1-0/+1
Add missing mutex path for ProArt X570-CREATOR WIFI. Fixes: de8fbac5e59e (hwmon: (asus-ec-sensors) implement locking via the ACPI global lock) Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20230121111728.168514-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-12-01hwmon: (asus-ec-sensors) Add checks for devm_kcallocYuan Can1-0/+2
As the devm_kcalloc may return NULL, the return value needs to be checked to avoid NULL poineter dereference. Fixes: d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC") Signed-off-by: Yuan Can <yuancan@huawei.com> Link: https://lore.kernel.org/r/20221125014329.121560-1-yuancan@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-09-09hwmon: (asus-ec-sensors) autoload module via DMI dataEugene Shalygin1-186/+222
Replace autoloading data based on the ACPI EC device with the DMI records for motherboards models. The ACPI method created a bug that when this driver returns error from the probe function because of the unsupported motherboard model, the ACPI subsystem concludes that the EC device does not work properly. Fixes: 5cd29012028d ("hwmon: (asus-ec-sensors) introduce ec_board_info struct for board data") Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216412 Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2121844 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220909155654.123398-2-eugene.shalygin@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-07-13hwmon: (asus-ec-sensors) add definitions for ROG ZENITH II EXTREMEUrs Schroffenegger1-0/+47
Add definitions for ROG ZENITH II EXTREME and some unknown yet temperature sensors in the second EC bank. Details are available at [1, 2]. [1] https://github.com/zeule/asus-ec-sensors/pull/26 [2] https://github.com/zeule/asus-ec-sensors/issues/16 Signed-off-by: Urs Schroffenegger <nabajour@lampshade.ch> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220710202639.1812058-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-07-13hwmon: (asus-ec-sensors) add missing sensors for X570-I GAMINGEugene Shalygin1-3/+4
VRM and chipset temperature for ROG STRIX X570-I GAMING were missing according to a user contribution to the LHM project [1]. [1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/767 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220710085539.1682869-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-07-13hwmon: (asus-ec-sensors) add support for Maximus XI HeroMichael Carns1-0/+36
Add definitions for ROG MAXIMUS XI HERO and ROG MAXIMUS XI HERO (WI-FI) boards. Signed-off-by: Michael Carns <mike@carns.com> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220627225437.87462-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-07-13hwmon: (asus-ec-sensors) add support for Strix Z690-a D4Shady Nawara1-0/+18
adds T_Sensor and VRM Temp sensors for the Asus Strix z690-a D4 motherboard Signed-off-by: Shady Nawara <shady.nawara@outlook.com> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220603122758.1561064-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-06-15hwmon: (asus-ec-sensors) add missing comma in board name list.Michael Carns1-1/+1
This fixes a regression where coma lead to concatenating board names and broke module loading for C8H. Fixes: 5b4285c57b6f ("hwmon: (asus-ec-sensors) fix Formula VIII definition") Signed-off-by: Michael Carns <mike@carns.com> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220615122544.140340-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-22hwmon: (asus-ec-sensors) fix Formula VIII definitionEugene Shalygin1-10/+2
The ROG CROSSHAIR VIII FORMULA board has the same sensors as the CROSSHAIR VIII HERO [1] thus let's join their definitions which adds missing sensors for Formula. [1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/740 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220517080508.1910953-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-22hwmon: (asus-ec-sensors) add ROG STRIX X570-E GAMING WIFI IIDebabrata Banerjee1-0/+8
Adds support for the ROG STRIX X570-E GAMING WIFI II board and simplifies formatting for the list of supported models. Signed-off-by: Debabrata Banerjee <dbavatar@gmail.com> Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220505073351.123753-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-20hwmon: (asus-ec-sensors) add PRIME X470-PRO boardEugene Shalygin1-0/+43
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 <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220427143001.1443605-5-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-20hwmon: (asus-ec-sensors) add support for board familiesEugene Shalygin1-5/+35
DSDT code for AMD 400-series chipset shows that sensor addresses differ for this generation from those for the AMD 500-series boards. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220427143001.1443605-4-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-20hwmon: (asus-ec-sensors) implement locking via the ACPI global lockEugene Shalygin1-26/+99
For some board models ASUS uses the global ACPI lock to guard access to the hardware, so do we. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220427143001.1443605-3-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-20hwmon: (asus-ec-sensors) introduce ec_board_info struct for board dataEugene Shalygin1-89/+123
We need to keep some more information about the current board than just the sensors set, and with more boards to add the dmi id array grows quickly. Our probe code is always the same so let's switch to a custom test code and a custom board info array. That allows us to omit board vendor string (ASUS uses two strings that differ in case) in the board info and use case-insensitive comparison, and also do not duplicate sensor definitions for such board variants as " (WI-FI)" when sensors are identical to the base variant. Also saves a quarter of the module size by replacing big dmi_system_id structs with smaller ones. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220427143001.1443605-2-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-17hwmon: (asus-ec-sensors) add ProArt X570 Creator WIFI boardEugene Shalygin1-0/+5
Basing on information and testing provided by users [1] add support for another board, ASUS ProArt X570 Creator WiFi. [1] https://github.com/zeule/asus-ec-sensors/issues/17 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220422111737.1352610-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-05-17hwmon: (asus-ec-sensors) Add T_Sensor for ASUS WS X570-ACEWei Shuyu1-1/+2
WS X570-ACE has a T_Sensor header on board according to manual[1]. I'm using a 10kΩ B=3435K thermsistor attached to the header of WS X570-ACE. EC byte at 0x3d matches readings from BIOS sensor page and environment temperature. [1]https://www.asus.com/Motherboards-Components/Motherboards/All-series/Pro-WS-X570-ACE/HelpDesk_Manual/ Signed-off-by: Wei Shuyu <wsy@dogben.com> Link: https://lore.kernel.org/r/E1nY43Q-000rAm-9a@dogben.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) do not print from .probe()Eugene Shalygin1-11/+5
Remove the call to dev_info() from the board detection function, which is called from probe(), not only to be in line with hwmon driver rules, but also because the message duplicates the error code returned from probe() for that case (ENODEV). Changes in: - v2: add missing newline (style). Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220217194318.2960472-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) merge setup functionsEugene Shalygin1-25/+16
Merge configure_sensor_setup() into probe(). Changes: - v2: add local struct device *dev = &pdev->dev; - v3: initialize dev at declaration - v4: fix checkpatch warning - v5: fix formatting - v6: code style fixes Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) deduce sensor signedness from its typeEugene Shalygin1-9/+31
Reading DSDT code for ASUS X470-based boards (the ones served by the asus_wmi_Sensors driver), where ASUS put hardware monitoring functions into the WMI code, reveals that fan and current sensors data is unsigned. For the current sensor that was confirmed by a user who showed high enough current value for overflow. Thus let's assume that the signedness of the sensors is determined by its type and that only temperature ones provide signed numbers. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220211164855.265698-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) add CPU core voltageEugene Shalygin1-10/+19
A user discovered [1] the CPU Core voltage sensor, which spans 2 registers and provides output in mV. Althroug the discovery was made with a X470 chipset, the sensor is present in X570 (tested with C8H). For now simply add it to each board with the CPU current sensor present. [1] https://github.com/zeule/asus-ec-sensors/issues/12 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Tested-by: Denis Pauk <pauk.denis@gmail.com> Link: https://lore.kernel.org/r/20220208094244.1106312-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) read sensors as signed intsEugene Shalygin1-8/+8
Temperature sensor readings are signed, which is hinted by their blank value (oxd8, 216 as unsigned and -40 as signed). T_Sensor, Crosshair VIII Hero, and a freezer were used to confirm that. Here we read fan sensors as signed too, because with their typical values and 2-byte width, I can't tell a difference between signed and unsigned, as I don't have a high speed chipset fan. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220204163045.576903-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) fix a typo in asus_ec_probe()Dan Carpenter1-1/+1
There is no such struct as "asus_ec_sensors", it was supposed to be "ec_sensors_data". This typo does not affect either build or runtime. Fixes: c4b1687d6897 ("hwmon: (asus-ec-sensors) add driver for ASUS EC") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20220205092015.GA612@kili Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) Add Crosshair VIII Hero WiFiEugene Shalygin1-0/+6
The Wi-Fi variant of Crosshair VIII Hero provides the same sensors, which was tested by a Libre Hardware Monitor user [1]. [1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/453#issuecomment-1028398487 Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220203203052.441712-1-eugene.shalygin@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2022-02-28hwmon: (asus-ec-sensors) add driver for ASUS ECEugene Shalygin1-0/+694
This driver provides the same data as the asus_wmi_ec_sensors driver (and gets it from the same source) but does not use WMI, polling the ACPI EC directly. That provides two enhancements: sensor reading became quicker (on some systems or kernel configuration it took almost a full second to read all the sensors, that transfers less than 15 bytes of data), the driver became more flexible. The driver now relies on ACPI mutex to lock access to the EC in the same way as the WMI code does. Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com> Link: https://lore.kernel.org/r/20220124015658.687309-2-eugene.shalygin@gmail.com Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Tested-by: Denis Pauk <pauk.denis@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>