aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-07-13hwmon: (aquacomputer_d5next) Move device-specific data into struct aqc_dataAleksa Savic1-152/+92
As preparation for adding support for more devices in upcoming patches, move device-specific data, such as number of fans, temperature sensors, register offsets etc. to struct aqc_data. This is made possible by the fact that the supported Aquacomputer devices share the same layouts of sensor substructures. This allows aqc_raw_event() and others to stay general and not be cluttered with similar loops for each device. Signed-off-by: Jack Doan <[email protected]> Signed-off-by: Aleksa Savic <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (drivetemp) Add module aliasLinus Walleij1-0/+1
Adding a MODULE_ALIAS() to drivetemp will make the driver easier for modprobe to autoprobe. Signed-off-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: 5b46903d8bf3 ("hwmon: Driver for disk and solid state drives with temperature sensors") Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (asus_wmi_sensors) Save a few bytes of memoryChristophe JAILLET1-7/+5
The first 'for' loop of asus_wmi_configure_sensor_setup() only computes the number and type of sensors that exist in the system. Here, the 'temp_sensor' structure is only used to store the data collected by asus_wmi_sensor_info(). There is no point in using a devm_ variant for this allocation. This wastes some memory for no good reason. Use the stack instead. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/e23cea6c489fabb109a61e8a33d146a6b74c0529.1656741926.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Use worker for alarm notificationsGuenter Roeck1-5/+13
Reporting alarms using hwmon_notify_event() may result in a callback from the thermal subsystem. This means that such notifications must not hold the update lock to avoid a deadlock. To avoid this situation, use a worker to handle notifications. Reported-by: Dmitry Osipenko <[email protected]> Tested-by: Dmitry Osipenko <[email protected]> Fixes: f6d0775119fb ("hwmon: (lm90) Rework alarm/status handling") Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (asus-ec-sensors) add support for Maximus XI HeroMichael Carns2-0/+38
Add definitions for ROG MAXIMUS XI HERO and ROG MAXIMUS XI HERO (WI-FI) boards. Signed-off-by: Michael Carns <[email protected]> Signed-off-by: Eugene Shalygin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (dell-smm) Improve assembly codeArmin Wolf1-60/+18
The new assembly code works on both 32 bit and 64 bit cpus and allows for more compiler optimisations. Since clang runs out of registers on 32 bit x86 when using CC_OUT, we need to execute "setc" ourself. Also modify the debug message so we can still see the result (eax) when the carry flag was set. Tested with 32 bit and 64 bit kernels on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Rebased to v5.19-rc3] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus/ltc2978) Set voltage resolutionMårten Lindahl2-6/+46
The LTC2977 regulator does not set the regulator_desc .n_voltages value which is needed in order to let the regulator core list the regulator voltage range. This patch defines a regulator_desc with a voltage range, and uses it for defining voltage resolution for regulators LTC2972/LTC2974/LTC2975/ LTC2977/LTC2978/LTC2979/LTC2980/LTM2987 based on that they all have a 16 bit ADC with the same stepwise 122.07uV resolution. It also scales the resolution to a 1mV resolution which is easier to handle. Signed-off-by: Mårten Lindahl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) Add list_voltage to pmbus opsMårten Lindahl1-0/+30
When checking if a regulator supports a voltage range, the regulator needs to have a list_voltage callback set to the regulator_ops or else -EINVAL will be returned. This support does not exist for the pmbus regulators, so this patch adds pmbus_regulator_list_voltage to the pmbus_regulator_ops. Signed-off-by: Mårten Lindahl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) Introduce and use cached vout marginsMårten Lindahl1-17/+61
When setting a new voltage the voltage boundaries are read every time to check that the new voltage is within the proper range. Checking these voltage boundaries consists of reading one of PMBUS_MFR_VOUT_MIN/ PMBUS_VOUT_MARGIN_LOW registers and then PMBUS_MFR_VOUT_MAX/ PMBUS_VOUT_MARGIN_HIGH together with writing the PMBUS_CLEAR_FAULTS register. Since these boundaries are never being changed, it can be cached and thus saving unnecessary smbus transmissions. Signed-off-by: Mårten Lindahl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (gsc-hwmon) Add missing of_node_put()Liang He1-0/+3
In gsc_hwmon_get_devtree_pdata(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (dell-smm) Add Dell G5 5590 to DMI tableArmin Wolf1-0/+7
According to Bug 215983 at bugzilla.kernel.org, the Dell G5 5590 supports the SMM interface and can thus be loaded with ignore_dmi being set. Add the model the DMI table to allow for automatic loadig on this model. Compile-tested only. Signed-off-by: Armin Wolf <[email protected]> Acked-by: Pali Rohár <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (dell-smm) Add Dell XPS 13 7390 to fan control whitelistArmin Wolf1-0/+8
A user reported that the program dell-bios-fan-control worked on his Dell XPS 13 7390 to switch off automatic fan control. Since it uses the same mechanism as the dell_smm_hwmon module, add this model to the fan control whitelist. Compile-tested only. Signed-off-by: Armin Wolf <[email protected]> Acked-by: Pali Rohár <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (nct6775) Drop duplicate NULL check in ->init() and ->exit()Andy Shevchenko1-8/+4
Since platform_device_unregister() is NULL-aware, we don't need to duplicate this check. Remove it and fold the rest of the code. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Zev Weiss <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) fix build error unused-functionRen Zhijie1-2/+2
If CONFIG_PMBUS is y and CONFIG_DEBUG_FS is not set. make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-, will be failed, like this: drivers/hwmon/pmbus/pmbus_core.c:593:13: error: ‘pmbus_check_block_register’ defined but not used [-Werror=unused-function] static bool pmbus_check_block_register(struct i2c_client *client, int page, ^~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[3]: *** [drivers/hwmon/pmbus/pmbus_core.o] Error 1 make[2]: *** [drivers/hwmon/pmbus] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [drivers/hwmon] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [drivers] Error 2 To fix building warning, use __maybe_unused to attach this func. Reported-by: Hulk Robot <[email protected]> Fixes: c3ffc3a1ff83("hwmon: (pmbus) add a function to check the presence of a block register") Signed-off-by: Ren Zhijie <[email protected]> Link: https://lore.kernel.org/r/[email protected] [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Read the channel's temperature offset from device-treeSlawomir Stepien1-0/+16
Try to read the channel's temperature offset from device-tree. Having offset in device-tree node is not mandatory. The offset can only be set for remote channels. Signed-off-by: Slawomir Stepien <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for 2nd remote channel's offset registerSlawomir Stepien1-9/+49
The ADT7481 have LM90_HAVE_TEMP3 and LM90_HAVE_OFFSET flags, but the support of second remote channel's offset is missing. Add that implementation. Signed-off-by: Slawomir Stepien <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (occ) Delete unnecessary NULL checkZiyang Xuan1-4/+2
kvfree(NULL) is safe. NULL check before kvfree() is not needed. Delete them to simplify the code. Generated by coccinelle script: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: Ziyang Xuan <[email protected]> Reviewed-by: Eddie James <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Read the channel's label from device-treeSlawomir Stepien1-0/+72
Try to read the channel's label from device-tree. Having label in device-tree node is not mandatory. Signed-off-by: Slawomir Stepien <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Define maximum number of channels that are supportedSlawomir Stepien1-12/+15
Use this define in all the places where literal '3' was used in this context. Signed-off-by: Slawomir Stepien <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add compatible entry for adt7481Slawomir Stepien1-0/+4
This will allow binding the driver with the device from the device tree. Signed-off-by: Slawomir Stepien <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13dt-bindings: hwmon: Allow specifying channels for lm90Slawomir Stepien1-0/+129
Add binding description for temperature channels. Currently, support for label and temperature-offset-millicelsius is implemented. Signed-off-by: Slawomir Stepien <[email protected]> Reviewed-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13dt-bindings: hwmon: Add compatible string for ADT7481 in lm90Slawomir Stepien1-0/+2
This will allow binding the driver with the device from the device tree. This device can work in extended temperature measurement mode, so add it also to the list of devices that support 'ti,extended-range-enable'. Signed-off-by: Slawomir Stepien <[email protected]> Acked-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: Allow to compile ASB100 and FSCHMD on !X86Uwe Kleine-König1-2/+2
The two drivers compile just fine on ARCH=arm. Allow to select these drivers if COMPILE_TEST is enabled. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) add MFR_* registers to debugfsAdam Wujek1-2/+97
Add registers to debugfs: PMBUS_MFR_ID PMBUS_MFR_MODEL PMBUS_MFR_REVISION PMBUS_MFR_LOCATION PMBUS_MFR_DATE PMBUS_MFR_SERIAL To reduce the number of debugfs entries, only values from page 0 are reported. It is assumed that values of these registers are the same for all pages. Please note that the PMBUS standard allows added registers to be page-specific. Signed-off-by: Adam Wujek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) add a function to check the presence of a block registerAdam Wujek1-0/+28
Other functions (like pmbus_check_byte_register) cannot be used to check the presence of a block register, because it will generate error when PEC is used. Signed-off-by: Adam Wujek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (asus-ec-sensors) add support for Strix Z690-a D4Shady Nawara2-0/+19
adds T_Sensor and VRM Temp sensors for the Asus Strix z690-a D4 motherboard Signed-off-by: Shady Nawara <[email protected]> Signed-off-by: Eugene Shalygin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (sch56xx-common) Add DMI override tableArmin Wolf1-10/+34
Some devices like the Fujitsu Celsius W380 do contain a working sch56xx hardware monitoring device, but do not contain the necessary DMI onboard device. Do not check for the presence of an suitable onboard device on these machines. The list of affected machines was created using data collected by the Linux Hardware Project. Tested on a Fujitsu Esprimo P720, but sadly not on a affected machine. Fixes: 393935baa45e (hwmon: (sch56xx-common) Add automatic module loading on supported devices) Signed-off-by: Armin Wolf <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm75) Replace kernel.h with the necessary inclusionsChristophe JAILLET1-1/+2
When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/4e07ed43274ad912d4efcfc04f673f25e8f89fdc.1654289489.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (f71882fg) Add support for F71858AD (0x0903)Aleksander Mazur1-0/+2
Treat F71858AD like F71858FG. Tested on Igel D220. Signed-off-by: Aleksander Mazur <[email protected]> Link: https://lore.kernel.org/r/20220605012114.3d85a75a@mocarz Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) Add support for Analog Devices LT7182SGuenter Roeck5-0/+298
Add support for Analog Devices LT7182S Dual Channel 6A, 20V PolyPhase Step-Down Silent Switcher with Digital Power System Management. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13dt-bindings: trivial-devices: Add lt7182sGuenter Roeck1-0/+2
Add Analog Devices LT7182S Dual Channel Step-Down Switcher. Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (pmbus) Add IEEE 754 half precision support to PMBus coreGuenter Roeck2-5/+139
Add support for the IEEE 754 half precision data format as specified in PMBus v1.3.1. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Support temp_samples attributeGuenter Roeck1-14/+91
Several of the chips supported by this driver support configuring the number of samples (or the fault queue depth) necessary before a fault or alarm is reported. This is done either with a bit in the configuration register or with a separate "consecutive alert" register. Support this functionality with the temp_samples attribute. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add table with supported Analog/ONSEMI devicesGuenter Roeck1-0/+36
Add table with device names and known register values for supported devices from Analog / ON Semiconductor. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support and detection of Philips/NXP NE1618Guenter Roeck3-14/+42
NE1618 is similar to NE1617 but supports manufacturer and chip ID registers as well as 11 bit external temperature resolution. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add explicit support for ADM1020Guenter Roeck3-4/+20
ADM1020 is compatible with ADM1021 but has a separate chip revision and a limited I2C address range. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Only disable alerts if not already disabledGuenter Roeck1-2/+4
It was observed that the alert handler may be called from the i2c core even after alerts have already been disabled. Only disable alerts if they have not already been disabled. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for ADT7421Guenter Roeck1-1/+9
ADT7421 is similar to ADT7461A but supports configurable Beta Compensation. Packet Error Checking (PEC) is supported but undocumented. A devicetree node is not added for the added chip since it is quite unlikely that such an old chip will ever be used in a devicetree based system. It can be added later if needed. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for ON Semiconductor NCT218Guenter Roeck3-3/+40
NCT218 is compatible to NCT72 and NCT214. It also supports PEC (packet error checking). Similar to NCT72 and NCT214, PEC support is undocumented. Unlike NCT214 and NCT72, NCT218 does not support the undocumented secondary chip and manufacturer ID registers at 0x3e and 0x3f and returns 0x00 when reading those registers. The value for the chip revision register is not documented but was observed to be 0xca. Use that information to improve chip detection accuracy. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for ON Semiconductor NCT214 and NCT72Guenter Roeck3-2/+56
NCT214 and NCT72 are compatible to ADT7461/ADT7461A but have full PEC (packet error checking) support. PEC support is undocumented. Both chips support the undocumented secondary chip and manufacturer ID registers at 0x3e and 0x3f, and return 0x61 as chip ID. Use this information to improve the accuracy of chip detection code. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add explicit support for NCT210Guenter Roeck3-3/+31
Unlike ADM1023 and compatible chips, NCT210 does not support a temperature offset register. A real chip was found to have a chip revision of 0x3f. Use it to detect NCT210 explicitly. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Combine lm86 and lm90 configurationGuenter Roeck1-12/+5
LM86 and LM90 support exactly the same features, so there is no need to keep their configuration options separate. Combine to reduce data size. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add remaining chips supported by adm1021 driverGuenter Roeck3-1/+60
All chips supported by the ADM1021 driver are also supported by the LM90 driver. Make that support official. After this change, the adm1021 driver is only needed if the lm90 driver is disabled. Also, the adm1021 driver misdetects a variety of chips as MAX1617A, which is unwanted if any of those chips is in the system. For this reason. make the adm1021 driver dependent on !SENSORS_LM90 to show that it is not needed if the lm90 driver is enabled, and to avoid misdetection if a chip supported by the lm90 driver is in the system. Devicetree nodes are not added for the added chips since it is quite unlikely that such old chips will ever be used in a devicetree based system. They can be added later if needed. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for ADM1021, ADM1021A, and ADM1023Guenter Roeck3-8/+66
Both chips are quite similar to other chips of this series, so add support for them to the lm90 driver. Also mention ON Semiconductor NCT210, which is pin and register compatible to ADM1021A. None of the chips support the secondary manufacturer and chip ID registers at 0x3e and 0x3f, but return 0 when reading from those registers. Use that information to improve the accuracy of chip detection code. Devicetree nodes are not added for the added chips since it is quite unlikely that such old chips will ever be used in a devicetree based system. They can be added later if needed. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Support MAX1617 and LM84Guenter Roeck3-43/+275
MAX1617 and LM84 are stripped-down versions of LM90, so they can easily be supported by the LM90 driver. The most difficult part is chip detection, since those old chips do not support manufacturer ID or chip ID registers. The "alarms" attribute is enabled for both chips to match the functionality of the adm1021 driver. Chip detection was improved and is less prone to misdetection than the chip detection in the adm1021 driver. Devicetree nodes are not added for the added chips since it is quite unlikely that such old chips will ever be used in a devicetree based system. They can be added later if needed. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Introduce 16-bit register write functionGuenter Roeck1-14/+19
Introduce 16-bit register write function to simplify the code in some places. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Let lm90_read16() handle 8-bit read operationsGuenter Roeck1-30/+17
Simplify the code a bit by handling single-register read operations in lm90_read16(). All we need to do is to skip the low-byte read operation if the register address is 0. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add support for MAX6642Guenter Roeck3-16/+83
MAX6642 is a reduced version of LM90 with no low limits and no conversion rate register. Its alert functionality is broken, similar to many other chips supported by the lm90 driver. After this change, the stand-alone max6642 driver is only needed if the lm90 driver is disabled. Make it dependent on SENSORS_LM90=n to show that it is not needed if the lm90 driver is enabled. A devicetree node is not added for this chip since it is quite unlikely that such an old chip will ever be used in a devicetree based system. It can be added later if needed. Signed-off-by: Guenter Roeck <[email protected]>
2022-07-13hwmon: (lm90) Add flag to indicate conversion rate supportGuenter Roeck1-27/+39
A flag indicating support for setting the conversion rate doesn't cost much and will enable us to add support for MAX6642 to the lm90 driver. Signed-off-by: Guenter Roeck <[email protected]>