summaryrefslogtreecommitdiff
path: root/drivers/hwmon/asus-ec-sensors.c
AgeCommit message (Collapse)AuthorFilesLines
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>