summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)AuthorFilesLines
2025-04-05treewide: Switch/rename to timer_delete[_sync]()Thomas Gleixner1-1/+1
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree over and remove the historical wrapper inlines. Conversion was done with coccinelle plus manual fixups where necessary. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-03-26Merge tag 'platform-drivers-x86-v6.15-1' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform drivers updates from Ilpo Järvinen: - alienware-wmi: - Refactor and split WMAX/legacy drivers - dell-ddv: - Correct +0.1 offset in temperature - Use the power supply extension mechanism for battery temperatures - intel/pmc: - Refactor init to mostly use a common init function - Add support for Arrow Lake U/H - Add support for Panther Lake - intel/sst: - Improve multi die handling - Prefix header search path with sysroot (fixes cross-compiling) - lenovo-wmi-hotkey-utilities: - Support for mic & audio mute LEDs - samsung-galaxybook: - Add driver for Samsung Galaxy Book series - wmi: - Rework WCxx/WExx ACPI method handling - Enable data block collection when the data block is set - platform/arm: - Add Huawei Matebook E Go EC driver - platform/mellanox: - Relocate to drivers/platform/mellanox/ - mlxbf-bootctl: - RTC battery status sysfs support - Miscellaneous cleanups / refactoring / improvements * tag 'platform-drivers-x86-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (75 commits) platform/x86: x86-android-tablets: Add select POWER_SUPPLY to Kconfig platform/x86/amd/pmf: convert timeouts to secs_to_jiffies() platform/x86: thinkpad_acpi: convert timeouts to secs_to_jiffies() irqdomain: platform/x86: Switch to irq_domain_create_linear() platform/x86/amd/pmc: fix leak in probe() tools/power/x86/intel-speed-select: v1.22 release tools/power/x86/intel-speed-select: Prefix header search path with sysroot tools/power/x86/intel-speed-select: Die ID for IO dies tools/power/x86/intel-speed-select: Fix the condition to check multi die system tools/power/x86/intel-speed-select: Prevent increasing MAX_DIE_PER_PACKAGE platform/x86/amd/pmc: Use managed APIs for mutex platform/x86/amd/pmc: Remove unnecessary line breaks platform/x86/amd/pmc: Move macros and structures to the PMC header file platform/x86/amd/pmc: Notify user when platform does not support s0ix transition platform/x86: dell-ddv: Use the power supply extension mechanism platform/x86: dell-ddv: Use devm_battery_hook_register platform/x86: dell-ddv: Fix temperature calculation platform/x86: thinkpad_acpi: check the return value of devm_mutex_init() platform/x86: samsung-galaxybook: Fix block_recording not supported logic platform/x86: dell-uart-backlight: Make dell_uart_bl_serdev_driver static ...
2025-03-26Merge tag 'hwmon-for-v6.15' of ↵Linus Torvalds28-952/+1693
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for HTU31 - Congatec Board Controller monitoring driver - Driver for TI INA233 Current and Power Monitor Support for additional chips or boards in existing drivers: - pmbus/ltc2978: Add support for LT717x and LTM4673 - asus-ec-sensors: Add PRIME X670E-PRO WIFI - k10temp: Add support for cyan skillfish - nct6683: Add customer ID for AMD BC-250 - lm90: Add support for NCT7716, NCT7717 and NCT7718 Other notable improvements in existing drivers: - emc2305: Add devicetree support, and use devm_thermal_of_cooling_device_register - acpi_power_meter: Convert to with_info API - dell-smm: Increase the number of fans - pmbus/core: Optimize debugfs support and use i2c_client debugfs directory - hwmon core: Fix the missing of 'average' word in hwmon_power_attr_templates - Various drivers: Use per-client debugfs entry provided by I2C subsystem" * tag 'hwmon-for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits) hwmon: emc2305: Use devm_thermal_of_cooling_device_register hwmon: emc2305: Add OF support dt-bindings: hwmon: Add Microchip emc2305 support dt-bindings: hwmon: Drop stray blank line in the header hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_register hwmon: add driver for HTU31 dt-bindings: hwmon: Add description for sensor HTU31 hwmon: Add driver for TI INA233 Current and Power Monitor dt-bindings: hwmon: ti,ina2xx: Add INA233 device hwmon: Add Congatec Board Controller monitoring driver hwmon: (pmbus/ltc2978) add support for lt717x dt-bindings: hwmon: ltc2978: add support for LT717x hwmon: (pmbus/ltc2978) Add support for LT717x - docs hwmon: (dell-smm) Increment the number of fans hwmon: (ntc_thermistor) return error instead of clipping on OOB hwmon: (pt5161l) Use per-client debugfs entry hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates hwmon: (acpi_power_meter) Fix the fake power alarm reporting hwmon: (gpio-fan) Add missing mutex locks dt-bindings: hwmon: gpio-fan: Add optional regulator support ...
2025-03-22hwmon: emc2305: Use devm_thermal_of_cooling_device_registerFlorin Leotescu1-29/+4
Prepare the emc2305 driver to use configuration from Device Tree nodes. Switch to devm_thermal_of_cooling_device_register to simplify the cleanup procedure, allowing the removal of emc2305_unset_tz and emc2305_remove, which are no longer needed. Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20250321143308.4008623-4-florin.leotescu@oss.nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-22hwmon: emc2305: Add OF supportFlorin Leotescu1-0/+7
Introduce OF support for Microchip emc2305 pwm fan controller. Signed-off-by: Florin Leotescu <florin.leotescu@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20250321143308.4008623-3-florin.leotescu@oss.nxp.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-21hwmon: (acpi_power_meter) Replace the deprecated hwmon_device_registerHuisong Li1-435/+425
When load this mode, we can see the following log: "power_meter ACPI000D:00: hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info()." So replace hwmon_device_register with hwmon_device_register_with_info. These attributes, 'power_accuracy', 'power_cap_hyst', 'power_average_min' and 'power_average_max', should have been placed in hwmon_chip_info as power data type. But these attributes are displayed as string format on the following case: a) power1_accuracy --> display like '90.0%' b) power1_cap_hyst --> display 'unknown' when its value is 0xFFFFFFFF c) power1_average_min/max --> display 'unknown' when its value is negative. To avoid any changes in the display of these sysfs interfaces, we can't modifiy the type of these attributes in hwmon core and have to put them to extra_groups. Please note that the path of these sysfs interfaces are modified accordingly if use hwmon_device_register_with_info(): old: all sysfs interfaces are under acpi device, namely, /sys/class/hwmon/hwmonX/device/ now: all sysfs interfaces are under hwmon device, namely, /sys/class/hwmon/hwmonX/ The new ABI does not guarantee that the underlying path remains the same. But we have to accept this change so as to replace the deprecated API. Fortunately, some userspace application, like libsensors, would scan the two path and handles this automatically. So we can accept this change so as to drop the deprecated message. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://lore.kernel.org/r/20250319020638.59925-1-lihuisong@huawei.com [groeck: Fixed some multi-line alignment issues; reverted to 32-bit arithmetic in power1_accuracy_show() fixed bad return code from power_meter_is_visible()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-18hwmon: add driver for HTU31Andrei Lalaev3-0/+362
Add base support for HTU31 temperature and humidity sensor. Besides temperature and humidity values, the driver also exports a 24-bit heater control to sysfs and serial number to debugfs. Signed-off-by: Andrei Lalaev <andrey.lalaev@gmail.com> Link: https://lore.kernel.org/r/20250217051110.46827-2-andrey.lalaev@gmail.com [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-18hwmon: Add driver for TI INA233 Current and Power MonitorLeo Yang3-0/+201
Driver for Texas Instruments INA233 Current and Power Monitor With I2C-, SMBus-, and PMBus-Compatible Interface Signed-off-by: Leo Yang <leo.yang.sy0@gmail.com> Link: https://lore.kernel.org/r/20250116085939.1235598-3-leo.yang.sy0@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17hwmon: Add Congatec Board Controller monitoring driverThomas Richard3-0/+315
Add support for the Congatec Board Controller. This controller exposes temperature, voltage, current and fan sensors. The available sensors list cannot be predicted. Some sensors can be present or not, depending the system. The driver has an internal list of all possible sensors, for all Congatec boards. The Board Controller gives to the driver its sensors list, and their status (active or not). Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://lore.kernel.org/r/20250203-congatec-board-controller-hwmon-v4-1-ff6c76a4662c@bootlin.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17hwmon: (pmbus/ltc2978) add support for lt717xKim Seer Paller2-6/+44
Add support for LT7170 and LT7171. The LT7170 and LT7171 are 20 A, 16 V, Single- or Dual-Phase, Silent Switcher Step-Down Regulators with Digital Power System Management. The relevant registers in the LT7170 and LT7171 are similar to those in the LTC3887, but with fewer channels. This adds the chip ID and identification of ASCII to differentiate between the LT7170 and LT7171. These devices support polling for status updates and clearing peak values. The data format for voltage, current, and temperature is set to IEEE754 for precision and compatibility. Co-developed-by: Cherrence Sarip <cherrence.sarip@analog.com> Signed-off-by: Cherrence Sarip <cherrence.sarip@analog.com> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com> Link: https://lore.kernel.org/r/20250317-hwmon-next-v1-3-da0218c38197@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-17hwmon: (nct6775-core) Fix out of bounds access for NCT679{8,9}Tasos Sahanidis1-2/+2
pwm_num is set to 7 for these chips, but NCT6776_REG_PWM_MODE and NCT6776_PWM_MODE_MASK only contain 6 values. Fix this by adding another 0 to the end of each array. Signed-off-by: Tasos Sahanidis <tasos@tasossah.com> Link: https://lore.kernel.org/r/20250312030832.106475-1-tasos@tasossah.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-11hwmon: (dell-smm) Increment the number of fansKurt Borja1-1/+4
Some Alienware laptops that support the SMM interface, may have up to 4 fans. Tested on an Alienware x15 r1. Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250304055249.51940-2-kuurtb@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-07hwmon: (ntc_thermistor) return error instead of clipping on OOBMaud Spierings1-8/+7
When the ntc is reading Out Of Bounds instead of clipping to the nearest limit (min/max) return -ENODATA. This prevents malfunctioning sensors from sending a device into a shutdown loop due to a critical trip. This implementation will only work for ntc type thermistors if a ptc type is to be implemented the min/max ohm calculation must be adjusted to take that into account. Signed-off-by: Maud Spierings <maudspierings@gocontroll.com> Link: https://lore.kernel.org/r/20250307-ntc_oob-v2-1-bba2d32b1a8e@gocontroll.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-06hwmon: (pt5161l) Use per-client debugfs entryWolfram Sang1-37/+9
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250305123149.16990-2-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-04hwmon: Fix the missing of 'average' word in hwmon_power_attr_templatesHuisong Li1-2/+2
The string "power%d_interval_max" and "power%d_interval_min" in the hwmon_power_attr_templates[] are corresponding to the sysfs interface name of hwmon_power_average_interval_max and hwmon_power_average_interval_min. But the 'average' word is missing in two strings. Fortunately, there is no driver to use it yet. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://lore.kernel.org/r/20250304074640.2770353-1-lihuisong@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-03hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe()Xinghuo Chen1-1/+1
The devm_memremap() function returns error pointers on error, it doesn't return NULL. Fixes: c7cefce03e69 ("hwmon: (xgene) access mailbox as RAM") Signed-off-by: Xinghuo Chen <xinghuo.chen@foxmail.com> Link: https://lore.kernel.org/r/tencent_9AD8E7683EC29CAC97496B44F3F865BA070A@qq.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (acpi_power_meter) Fix the fake power alarm reportingHuisong Li1-2/+6
We encountered a problem that a fake power alarm is reported to user on the platform unsupported notifications at the second step below: 1> Query 'power1_alarm' attribute when the power capping occurs. 2> Query 'power1_alarm' attribute when the power capping is over and the current average power is less then power cap value. The root cause is that the resource->power_alarm is set to true at the first step. And power meter use this old value to show the power alarm state instead of the current the comparison value. Signed-off-by: Huisong Li <lihuisong@huawei.com> Link: https://lore.kernel.org/r/20250220030832.2976-1-lihuisong@huawei.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (gpio-fan) Add missing mutex locksAlexander Stein1-1/+15
set_fan_speed() is expected to be called with fan_data->lock being locked. Add locking for proper synchronization. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20250210145934.761280-3-alexander.stein@ew.tq-group.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Report content of CAPABILITY register in debugfsGuenter Roeck1-2/+11
Report the value of the CAPABILITY register in debugfs if supported. Only check if the register is supported if PMBUS_NO_CAPABILITY is not set. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Optimize debugfs status attribute initializationGuenter Roeck1-96/+36
Define debugfs attributes used to access status registers in a data structure and loop through it instead of creating debugfs files one by one. This reduces code size and simplifies adding additional attributes if needed. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Optimize debugfs block data attribute initializationGuenter Roeck1-59/+34
Define debugfs attributes which need block data access in a data structure and loop through it instead of creating debugfs files one by one. This reduces code size and simplifies adding additional attributes if needed. While this is currently only used for manufacturer specific attributes, the access code is generic and also works for other block attributes, so rename operation functions from _mfg to _block. While at it, rename the "revison" file to "pmbus_revision" to make its meaning more obvious and to create a clear distinction against the "mfg_revision" file. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Declare regulator notification function as voidGuenter Roeck1-10/+8
The regulator notification function never returns an error. Declare it as void. While at it, fix its indentation. No functional change. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Make debugfs code unconditionalGuenter Roeck1-18/+7
Drop contitionals around debugfs code to compile it unconditionally. In practice it will be optimized away by the compiler if CONFIG_DEBUG_FS is not enabled, so the code size is not affected by this change. Also silently ignore errors if debugfs initialization fails. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Use the new i2c_client debugfs directoryGuenter Roeck1-22/+41
The I2C core now manages a debugfs directory per I2C client. PMBus has its own debugfs hierarchy. Link the two, so a user will be pointed to the I2C domain from the PMBus domain. Suggested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Use local debugfs variable in debugfs initializationGuenter Roeck1-24/+25
In preparation for the next patch in the series, use a local debugfs variable during debugfs initialization. No functional change intended. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Fix various coding style issuesGuenter Roeck1-24/+17
Checkpatch reports bad multi-line comments, bad multi-line alignments, missing blank lines after variable declarations, unnecessary empty lines, unnecessary spaces, and unnecessary braces. Fix most of the reported problems except for some multi-line alignment problems. Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (ad7314) Validate leading zero bits and return errorErik Schumacher1-0/+10
Leading zero bits are sent on the bus before the temperature value is transmitted. If any of these bits are high, the connection might be unstable or there could be no AD7314 / ADT730x (or compatible) at all. Return -EIO in that case. Signed-off-by: Erik Schumacher <erik.schumacher@iris-sensing.com> Fixes: 4f3a659581cab ("hwmon: AD7314 driver (ported from IIO)") Link: https://lore.kernel.org/r/24a50c2981a318580aca8f50d23be7987b69ea00.camel@iris-sensing.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (asus-ec-sensors) add PRIME X670E-PRO WIFIShengyu Qu1-0/+10
Add support for PRIME X670E-PRO WIFI. Signed-off-by: Shengyu Qu <wiagn233@outlook.com> Link: https://lore.kernel.org/r/TYCPR01MB84377BEADF97E8E7554EF0CF98C32@TYCPR01MB8437.jpnprd01.prod.outlook.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (ntc_thermistor) Fix module name in the KconfigMaud Spierings1-1/+1
The module name is incorrectly stated with a hyphen while it is an underscore. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Maud Spierings <maudspierings@gocontroll.com> Link: https://lore.kernel.org/r/20250227-ntc_thermistor_fixes-v1-1-70fa73200b52@gocontroll.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor tableMaud Spierings1-33/+33
I could not find a single table that has the values currently present in the table, change it to the actual values that can be found in [1]/[2] and [3] (page 15 column 2) [1]: https://www.murata.com/products/productdetail?partno=NCP15XH103F03RC [2]: https://www.murata.com/products/productdata/8796836626462/NTHCG83.txt?1437969843000 [3]: https://nl.mouser.com/datasheet/2/281/r44e-522712.pdf Fixes: 54ce3a0d8011 ("hwmon: (ntc_thermistor) Add support for ncpXXxh103") Signed-off-by: Maud Spierings <maudspierings@gocontroll.com> Link: https://lore.kernel.org/r/20250227-ntc_thermistor_fixes-v1-3-70fa73200b52@gocontroll.com Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus/core) Replace deprecated strncpy() with strscpy()Thorsten Blum1-2/+1
strncpy() is deprecated for NUL-terminated destination buffers; use strscpy() instead. Compile-tested only. Note(groeck): strscpy() uses sizeof() to determine the length of the destination buffer if it is not provided as argument. Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250227173936.7746-2-thorsten.blum@linux.dev Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (pmbus) Initialise page count in pmbus_identify()Titus Rwantare1-0/+2
The `pmbus_identify()` function fails to correctly determine the number of supported pages on PMBus devices. This occurs because `info->pages` is implicitly zero-initialised, and `pmbus_set_page()` does not perform writes to the page register if `info->pages` is not yet initialised. Without this patch, `info->pages` is always set to the maximum after scanning. This patch initialises `info->pages` to `PMBUS_PAGES` before the probing loop, enabling `pmbus_set_page()` writes to make it out onto the bus correctly identifying the number of pages. `PMBUS_PAGES` seemed like a reasonable non-zero number because that's the current result of the identification process. Testing was done with a PMBus device in QEMU. Signed-off-by: Titus Rwantare <titusr@google.com> Fixes: 442aba78728e7 ("hwmon: PMBus device driver") Link: https://lore.kernel.org/r/20250227222455.2583468-1-titusr@google.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (k10temp) add support for cyan skillfishMikhail Paulyshka1-0/+2
Add support for Cyan Skillfish (AMD Family 17h Model 47h), which appear to be Zen 2 based APU. The patch was tested with an AMD BC-250 board. Signed-off-by: Mikhail Paulyshka <me@mixaill.net> Link: https://lore.kernel.org/r/20250302155009.49951-1-me@mixaill.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-03-02hwmon: (nct6683) Add customer ID for AMD BC-250Mikhail Paulyshka1-0/+3
This value was found on an AMD BC-250 board with an NCT6686D chip. Signed-off-by: Mikhail Paulyshka <me@mixaill.net> Link: https://lore.kernel.org/r/20250302155053.50096-1-me@mixaill.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-25hwmon: (peci/dimmtemp) Do not provide fake thresholds dataPaul Fertser1-6/+4
When an Icelake or Sapphire Rapids CPU isn't providing the maximum and critical thresholds for particular DIMM the driver should return an error to the userspace instead of giving it stale (best case) or wrong (the structure contains all zeros after kzalloc() call) data. The issue can be reproduced by binding the peci driver while the host is fully booted and idle, this makes PECI interaction unreliable enough. Fixes: 73bc1b885dae ("hwmon: peci: Add dimmtemp driver") Fixes: 621995b6d795 ("hwmon: (peci/dimmtemp) Add Sapphire Rapids support") Cc: stable@vger.kernel.org Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Link: https://lore.kernel.org/r/20250123122003.6010-1-fercerpav@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-24hwmon: (hp-wmi-sensors) Use the WMI bus API when accessing sensorsArmin Wolf1-2/+2
Since the driver already binds to HP_WMI_NUMERIC_SENSOR_GUID, using wmidev_block_query() allows for faster sensor access. Acked-by: Guenter Roeck <linux@roeck-us.net> Tested-by: James Seo <james@equiv.tech> Reviewed-by: James Seo <james@equiv.tech> Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20250216193251.866125-2-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-02-07hwmon: (xgene-hwmon) use appropriate type for the latency valueAndrey Vatoropin1-1/+1
The expression PCC_NUM_RETRIES * pcc_chan->latency is currently being evaluated using 32-bit arithmetic. Since a value of type 'u64' is used to store the eventual result, and this result is later sent to the function usecs_to_jiffies with input parameter unsigned int, the current data type is too wide to store the value of ctx->usecs_lat. Change the data type of "usecs_lat" to a more suitable (narrower) type. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru> Link: https://lore.kernel.org/r/20250204095400.95013-1-a.vatoropin@crpt.ru Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-07hwmon: (sg2042) Add back module description/author tagsArnd Bergmann1-0/+2
A previous code reorganization inadvertently dropped the two tags, which leads to a "make W=1" warning: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/hwmon/sg2042-mcu.o Add these back. Fixes: cd4db38c4368 ("hwmon: (sg2042) Use per-client debugfs entry") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Inochi Amaoto <inochiama@gmail.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250205121419.373464-1-arnd@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (sht3x) Use per-client debugfs entryWolfram Sang1-56/+11
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250131095148.11973-2-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (tps23861) Use per-client debugfs entryWolfram Sang1-29/+2
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250125123941.36729-14-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (sg2042) Use per-client debugfs entryWolfram Sang1-37/+7
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250125123941.36729-12-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (ltc4282) Use per-client debugfs entryWolfram Sang1-36/+8
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250125123941.36729-10-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (ina3221) Use per-client debugfs entryWolfram Sang1-8/+1
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20250125123941.36729-9-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (isl28022) Use per-client debugfs entryWolfram Sang1-42/+2
The I2C core now offers a debugfs-directory per client. Use it and remove the custom handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20250123160347.44635-1-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (lm90): Add support for NCT7716, NCT7717 and NCT7718Ming Yu2-3/+81
NCT7716 is similar to NCT7717 but has one more address support, both of them only have a 8 bit resolution local thermal sensor. NCT7718 has 11 bit resoulution remote thermal sensor. Signed-off-by: Ming Yu <a0282524688@gmail.com> Link: https://lore.kernel.org/r/20250117100744.1571385-2-a0282524688@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (pmbus/ltc2978) add support for ltm4673Cedric Encarnacion2-4/+25
Add support for LTM4673. The LTM4673 is a quad output, dual 12A and dual 5A, switching mode DC/DC step-down μModule regulator integrated with 4-channel power system manager. This adds only the chip id, the checks for the manufacturer special id, and the relevant attributes for the device's pmbus_driver_info. The device does not support clear peaks. Signed-off-by: Cedric Encarnacion <cedricjustine.encarnacion@analog.com> Link: https://lore.kernel.org/r/20250124-ltm4673-v1-2-a2c6aa37c903@analog.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-02-03hwmon: (gsc) drop unneeded assignment for cache_typeAndy Shevchenko1-1/+0
REGCACHE_NONE is the default type of the cache when not provided. Drop unneeded explicit assignment to it. Note, it's defined to 0, and if ever be redefined, it will break literally a lot of the drivers, so it very unlikely to happen. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250129152036.1797725-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-01-28Merge tag 'driver-core-6.14-rc1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core and debugfs updates from Greg KH: "Here is the big set of driver core and debugfs updates for 6.14-rc1. Included in here is a bunch of driver core, PCI, OF, and platform rust bindings (all acked by the different subsystem maintainers), hence the merge conflict with the rust tree, and some driver core api updates to mark things as const, which will also require some fixups due to new stuff coming in through other trees in this merge window. There are also a bunch of debugfs updates from Al, and there is at least one user that does have a regression with these, but Al is working on tracking down the fix for it. In my use (and everyone else's linux-next use), it does not seem like a big issue at the moment. Here's a short list of the things in here: - driver core rust bindings for PCI, platform, OF, and some i/o functions. We are almost at the "write a real driver in rust" stage now, depending on what you want to do. - misc device rust bindings and a sample driver to show how to use them - debugfs cleanups in the fs as well as the users of the fs api for places where drivers got it wrong or were unnecessarily doing things in complex ways. - driver core const work, making more of the api take const * for different parameters to make the rust bindings easier overall. - other small fixes and updates All of these have been in linux-next with all of the aforementioned merge conflicts, and the one debugfs issue, which looks to be resolved "soon"" * tag 'driver-core-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (95 commits) rust: device: Use as_char_ptr() to avoid explicit cast rust: device: Replace CString with CStr in property_present() devcoredump: Constify 'struct bin_attribute' devcoredump: Define 'struct bin_attribute' through macro rust: device: Add property_present() saner replacement for debugfs_rename() orangefs-debugfs: don't mess with ->d_name octeontx2: don't mess with ->d_parent or ->d_parent->d_name arm_scmi: don't mess with ->d_parent->d_name slub: don't mess with ->d_name sof-client-ipc-flood-test: don't mess with ->d_name qat: don't mess with ->d_name xhci: don't mess with ->d_iname mtu3: don't mess wiht ->d_iname greybus/camera - stop messing with ->d_iname mediatek: stop messing with ->d_iname netdevsim: don't embed file_operations into your structs b43legacy: make use of debugfs_get_aux() b43: stop embedding struct file_operations into their objects carl9170: stop embedding file_operations into their objects ...
2025-01-25Merge tag 'i3c/for-6.14' of ↵Linus Torvalds1-7/+1
git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: "The main change is the addition of PCI bus support for mipi-i3c-hci. I'm also carrying an hwmon patch as it makes use of the bitops addition that is then mainly used by i3c drivers. Core: - Improve initialization of numbered I2C adapters Drivers: - use parity8 helper - dw: fix possible use-after-free - mipi-i3c-hci: add support for PCI bus host - svc: many fixes for IBI and hotjoin" * tag 'i3c/for-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: Improve initialization of numbered I2C adapters i3c: master: Fix missing 'ret' assignment in set_speed() i3c: cdns: use parity8 helper instead of open coding it i3c: mipi-i3c-hci: use parity8 helper instead of open coding it i3c: dw: use parity8 helper instead of open coding it hwmon: (spd5118) Use generic parity calculation bitops: add generic parity calculation for u8 i3c: mipi-i3c-hci: Add support for MIPI I3C HCI on PCI bus i3c: mipi-i3c-hci: Add Intel specific quirk to ring resuming i3c: fix kdoc parameter description for module_i3c_i2c_driver() i3c: dw: Fix use-after-free in dw_i3c_master driver due to race condition
2025-01-22Merge tag 'hwmon-for-v6.14-rc1' of ↵Linus Torvalds24-241/+1015
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - PMBus client driver for Intel CRPS185 power supply - PMBus client driver for Texas Instruments TPS25990 Chip support added to existing drivers: - pmbus/max15301: Add support for MAX15303 - pmbus/adm1275: Add adm1273 support - lm75: Add NXP P3T1755 support; with it, add I3C support to the driver - asus-ec-sensors: Add TUF GAMING X670E PLUS Other notable changes: - nct6683: Add customer IDs for several MSI and ASRock boards - tmp108: Add regulator support - Improve write protect support in PMBus core - pmbus/dps920ab: Add ability to instantiate through i2c - The hwmon core now accepts NULL as device name parameter to [devm_]hwmon_device_register_with_info ans uses the parent device name as fallback in that case - The PMBus core now provides the PMBUs revision in a debugfs file - asus-ec-sensors: Support for optional CPU fan on AMD 600 motherboards - raspberrypi: Add PM suspend/resume support - dell-smm: Enable manual fan control support on Dell XPS 9370 - pwm-fan: Default to maximum cooling level if provided And various other minor fixes and improvements" * tag 'hwmon-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (44 commits) hwmon: pmbus: dps920ab: Add ability to instantiate through i2c hwmon: (pwm-fan) Default to the Maximum cooling level if provided hwmon: (asus_atk0110) Use str_enabled_disabled() and str_enable_disable() helpers hwmon: Fix help text for aspeed-g6-pwm-tach hwmon: (dell-smm) Add Dell XPS 9370 to fan control whitelist hwmon: (acpi_power_meter) Fix update the power trip points on failure hwmon: (acpi_power_meter) Fix uninitialized variables hwmon: (core) Use device name as a fallback in devm_hwmon_device_register_with_info hwmon: (pmbus/max15301) Add support for MAX15303 hwmon: (pmbus/adm1275) add adm1273 support dt-bindings: hwmon: adm1275: add adm1273 hwmon: (nct6683) Add another customer ID for MSI hwmon: (pwm-fan): Make use of device properties everywhere hwmon: (lm75) add I3C support for P3T1755 hwmon: (lm75) separate probe into common and I2C parts hwmon: (lm75) Remove superfluous 'client' member from private struct hwmon: (lm75) simplify regulator handling hwmon: (lm75) simplify lm75_write_config() hwmon: (lm75) Hide register size differences in regmap access functions hwmon: (pmbus/crps) Add Intel CRPS185 power supply ...