Commit Graph

1464968 Commits

Author SHA1 Message Date
Nick Hawkins
152de279c1 dt-bindings: hwmon: hpe,gxp-fan-ctrl: remove fn2 and pl registers
Reduce the hpe,gxp-fan-ctrl register references from 3 to 1. The
function2 (fn2) and programmable logic (pl) references are removed.
The purpose of removal being their functionality will be consumed by a
new GPIO driver.

Signed-off-by: Nick Hawkins <nick.hawkins@hpe.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230705194544.100370-4-nick.hawkins@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:42 -07:00
Pan Chuang
ff496cdace hwmon: (pmbus) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-8-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:42 -07:00
Pan Chuang
b8ffbb950d hwmon: (sht15) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs detailed
error messages on failure. Remove the now-redundant driver-specific
dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-7-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:42 -07:00
Pan Chuang
45c6696215 hwmon: (pwm-fan) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs detailed
error messages on failure. Remove the now-redundant driver-specific
dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-6-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:42 -07:00
Pan Chuang
87dc289532 hwmon: (npcm750-pwm-fan) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs detailed
error messages on failure. Remove the now-redundant driver-specific
dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-5-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:42 -07:00
Pan Chuang
6dda9ad314 hwmon: (lm90) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-4-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Pan Chuang
ff72fc130f hwmon: (da9055) Remove redundant dev_err()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() call.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-3-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Pan Chuang
93238564c0 hwmon: (axi-fan-control) Remove redundant dev_err_probe()
Since commit 55b48e23f5 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
Link: https://lore.kernel.org/r/20260720063745.309331-2-panchuang@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Shih-Yuan Lee
94f5081d35 hwmon: (applesmc) Convert to hwmon_device_register_with_info
The legacy hwmon_device_register() function is deprecated and triggers
warnings in dmesg. Convert the driver to the modern
hwmon_device_register_with_info() API.

This conversion does the following:
- Dynamically allocates standard HWMON temp, fan, and pwm channels.
- Configures HWMON ops callbacks (.is_visible, .read, .read_string, .write).
- Standardizes attribute naming to match the HWMON ABI:
  - fanX_output -> fanX_target (HWMON_F_TARGET)
  - fanX_manual -> pwmX_enable (HWMON_PWM_ENABLE)
- Dynamically registers non-standard fanX_safe attributes under the HWMON
  class directory via extra_groups.
- Cleans up legacy sysfs nodes, groups, and unused show/store static functions
  to avoid unused symbol compiler warnings.
- Avoids recursive mutex deadlocks when writing to pwmX_enable by locklessly
  resolving the entry and invoking the underlying raw SMC read/write calls.
- Avoids UAF race condition on module exit by using unmanaged registration and
  explicitly calling hwmon_device_unregister() as the first step of applesmc_exit(),
  guaranteeing that HWMON nodes are destroyed before static structures are freed.

Signed-off-by: Shih-Yuan Lee <fourdollars@debian.org>
Link: https://lore.kernel.org/r/20260711093323.14529-4-fourdollars@debian.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Shih-Yuan Lee
5a151274c1 hwmon: (applesmc) Fix lockless cache validation data race
In applesmc_get_entry_by_index(), the cache->valid flag is checked
locklessly, but setting it to true lacks memory barriers. This can lead to
a data race (TOCTOU) where another thread sees cache->valid as true
before the actual cache contents (cache->key, cache->len, cache->type, etc.)
are fully committed and visible to that CPU, potentially causing it to read
uninitialized data and send incorrect keys to the Apple SMC hardware.

Introduce memory barriers (smp_load_acquire and smp_store_release) with
explanatory comments to ensure cache synchronization is thread-safe and
fully visible across all CPUs.

Signed-off-by: Shih-Yuan Lee <fourdollars@debian.org>
Link: https://lore.kernel.org/r/20260711093323.14529-3-fourdollars@debian.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Shih-Yuan Lee
d33baed3fe hwmon: (applesmc) Cache fan positions during register initialization
To support the read_string callback for fan labels in the modern HWMON
API, load and cache the fan position names in smcreg.fan_positions
during register initialization.

Pre-pad fallback labels with four spaces to match the "+ 4" pointer
arithmetic offset used by all fan labels in the read_string callback.

Signed-off-by: Shih-Yuan Lee <fourdollars@debian.org>
Link: https://lore.kernel.org/r/20260711093323.14529-2-fourdollars@debian.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Thomas Weißschuh
26db273640 hwmon: (cros_ec) Synchronize EC access from the thermal device callbacks
To guarantee consistency for the read-modify-write access in
cros_ec_hwmon_cooling_set_cur_state(), locking is necessary.

Use the existing hwmon device lock to do so.

Fixes: 5798b62867 ("hwmon: (cros_ec) register fans into thermal framework cooling devices")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20260711-cros_ec-hwmon-locking-v1-3-cb6d0fdbb2d3@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Thomas Weißschuh
434baf3aea hwmon: (cros_ec) Store the hwmon device in cros_ec_hwmon_priv
The upcoming locking scheme for thermal devices will require access
to the hwmon device.

Add it do the priv struct.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20260711-cros_ec-hwmon-locking-v1-2-cb6d0fdbb2d3@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Thomas Weißschuh
9f1012119f hwmon: (cros_ec) Register the thermal devices after the hwmon ones
To guarantee consistency for the read-modify-write access in
cros_ec_hwmon_cooling_set_cur_state(), locking is necessary.
The locking will use standard hwmon device locks, which requires
the hwmon device to be ready before the fan devices are set up.

Reorder the initialization so this works.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20260711-cros_ec-hwmon-locking-v1-1-cb6d0fdbb2d3@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Pengpeng Hou
2ed6f97e56 hwmon: (acbel-fsg032) Add missing MODULE_DEVICE_TABLE()
The driver has a match table for the i2c bus wired into its driver
structure, but the table is not exported with MODULE_DEVICE_TABLE().

Add the missing MODULE_DEVICE_TABLE() entry so module alias information
is generated for automatic module loading.

This is a source-level fix.  It does not claim dynamic hardware
reproduction; the evidence is the driver-owned match table, its use by
the driver registration structure, and the missing module alias
publication.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260704151543.35069-1-pengpeng@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Wensheng Wang
ff71049f36 hwmon: (pmbus) Add MPQ82D00 driver
Add support for MPS mpq82d00 controller. This driver exposes
telemetry and limit value readings and writtings.

Signed-off-by: Wensheng Wang <wenswang@yeah.net>
Link: https://lore.kernel.org/r/20260704081952.1701914-2-wenswang@yeah.net
[groeck: Fixed "WARNING: Title underline too short"]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Wensheng Wang
3997143f2f dt-bindings: hwmon: Add MPS mpq82d00
Add support for MPS mpq82d00 controller.

Signed-off-by: Wensheng Wang <wenswang@yeah.net>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260704081952.1701914-1-wenswang@yeah.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Babanpreet Singh
3b87c46d0d hwmon: (peci) Fix kernel-doc parameter names in common.h
scripts/kernel-doc -Wall -none reports:

  Warning: drivers/hwmon/peci/common.h:39 function parameter 'state' not
  described in 'peci_sensor_need_update'
  Warning: drivers/hwmon/peci/common.h:39 Excess function parameter
  'sensor' description in 'peci_sensor_need_update'
  Warning: drivers/hwmon/peci/common.h:49 function parameter 'state' not
  described in 'peci_sensor_mark_updated'
  Warning: drivers/hwmon/peci/common.h:49 Excess function parameter
  'sensor' description in 'peci_sensor_mark_updated'

Both peci_sensor_need_update() and peci_sensor_mark_updated() take a
pointer to struct peci_sensor_state named 'state', but their kernel-doc
comments document a parameter named 'sensor' and describe it as a
pointer to the sensor data struct. The comments have been out of sync
with the code since the file was added by commit bf3608f338 ("hwmon:
peci: Add cputemp driver").

Update the kernel-doc comments to document the 'state' parameter.

No functional change.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
Link: https://lore.kernel.org/r/20260712081258.7-1-bbnpreetsingh@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Zaixiang Xu
622a2dbdc0 hwmon: (sht3x) Document support for GXCAS GXHT30
The GXCAS GXHT30 is a humidity and temperature sensor that is a
drop-in replacement for and fully software compatible with the
Sensirion SHT30.

It is handled by the "sensirion,sht30" fallback compatible without
any driver changes; manual instantiation works with the existing
sht3x device name. Document the chip as supported.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
Link: https://lore.kernel.org/r/20260713074559.12196-5-zaixiang.xu.dev@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Zaixiang Xu
75186ab25c hwmon: (sht3x) Add devicetree support
Add an of_device_id table to support devicetree based instantiation
of the supported sensors.

The devicetree binding models all higher accuracy parts with a
fallback to the base part of their group, so only the two base
compatibles need to be listed. The match data distinguishes the
humidity and temperature parts (SHT3x) from the temperature-only
parts (STS3x), which require different configuration.

Start enum sht3x_chips at 1: with sht3x equal to 0, the OF match
data for the SHT devices would be NULL, causing i2c_get_match_data()
to fall back to i2c_device_id name matching, which fails for
devicetree names. The devices would then only work because the
resulting chip id 0 happens to equal sht3x. Non-zero match data
avoids relying on that coincidence.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
Link: https://lore.kernel.org/r/20260713074559.12196-4-zaixiang.xu.dev@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Zaixiang Xu
71b99f4242 dt-bindings: hwmon: Add Sensirion SHT30 series
Add a YAML devicetree binding for the Sensirion SHT3x/STS3x sensor
family and the compatible GXCAS GXHT30, with the ALERT interrupt,
nRESET GPIO and VDD supply as optional properties.

The SHT30, SHT31, SHT35 and SHT85 measure humidity and temperature
and differ only in accuracy and packaging, while the STS30, STS31,
STS32 and STS35 are temperature-only parts. Within each group the
parts share the same software interface, so model them with a
fallback to the base part of their group: "sensirion,sht30" for the
SHT parts and "sensirion,sts30" for the STS parts.

The GXCAS GXHT30 is a drop-in replacement for the SHT30 and uses it
as fallback as well.

Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260713074559.12196-3-zaixiang.xu.dev@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Zaixiang Xu
20b95cf6a6 dt-bindings: vendor-prefixes: Add GXCAS Technology
Add vendor prefix for Beijing Galaxy-CAS Technology Co., Ltd. (GXCAS).
The prefix was confirmed from the manufacturer's website:
https://www.gxcas.com/en/index.html

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Zaixiang Xu <zaixiang.xu.dev@gmail.com>
Link: https://lore.kernel.org/r/20260713074559.12196-2-zaixiang.xu.dev@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Eugene Shalygin
71a6c1950f hwmon: (asus-ec-sensors) detect unconnected physical sensors
When there is no physical sensor connected to the motherboard
socket,reading EC register returns one of the special values
(-62, -60, -40). Test for them  and return -ENODATA to hwmon.

Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260711122937.594989-2-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Vishaal Saraiya
90639003c0 hwmon: (asus-ec-sensors) add T_Sensor for ROG STRIX X870E-E GAMING WIFI
Enable T_Sensor for ROG STRIX X870E-E GAMING WIFI.

Board specs list the sensor, reading at the standard for this family
address without the thermistor connected to the motherboard, returns
-62, which is one of the known blank values (the other one in -40)
readings for temperature sensors in the ASUS EC when there is no
thermistor connected to the motherboard socket. With that evidence we
conclude that the T_Sensor can be enabled in the driver for this board.

Signed-off-by: Vishaal Saraiya <vishaal.saraiya@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260711073319.553163-2-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Vincent Jardin
a3b61ba255 hwmon: (tmp401) register with thermal subsystem
tmp401 is missing HWMON_C_REGISTER_TZ. So a devicetree thermal
zone referencing a such sensor ('thermal-sensors = <&tmp411 N>')
fails to register it. Then its cooling-maps is not set, which means
that the fans are not managed.

Same as lm90 or jc42, set HWMON_C_REGISTER_TZ.
Boards without the property into the DT keep the same behavior.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
Link: https://lore.kernel.org/r/20260713-for-upstream-hwmon-tmp401-register-tz-v1-1-47315d8617bc@free.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Maurice Mehlhaff
6b80b95e71 hwmon: (asus_ec_sensors) add ProArt Z690-CREATOR WIFI
Add support for the ProArt Z690-CREATOR WIFI board

Signed-off-by: Maurice Mehlhaff <maurice.mehlhaff@gmx.de>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260708195638.1324168-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Sarbajit Sarkar
440da016ce hwmon: (yogafan) Add support for Lenovo LOQ 15IAX9
Add the Lenovo LOQ 15IAX9 product family to the yogafan dmi_system_id
table. Unlike the Legion series, ACPI table extraction reveals this LOQ
utilizes an 8-bit EC architecture with a 100x multiplier, but maintains
a dual-fan setup via the \_SB.PC00.LPCB.EC0.FA1S and FA2S paths.

A new loq_15iax9_8bit_dual_cfg structure was added to properly map these
hardware registers and calculate RPMs correctly while avoiding path
conflicts with AMD-based LOQ variants.

Signed-off-by: Sarbajit Sarkar <sarbajitsarkar16108@gmail.com>
Link: https://lore.kernel.org/r/20260709183500.13761-1-sarbajitsarkar16108@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Vishaal Saraiya
3b7434feaa hwmon: (asus-ec-sensors) add ROG STRIX X870E-E GAMING WIFI7 R2
The board sensors is a copy of ROG STRIX X870E-E GAMING WIFI7, thus we
simply reuse its board_info struct.

Signed-off-by: Vishaal Saraiya <vishaal.saraiya@gmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260709204037.1998433-3-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Miska Hämäläinen
57e374e174 hwmon: (asus-ec-sensors) add ROG CROSSHAIR X870E HERO
Add support for ROG CROSSHAIR X870E HERO

Signed-off-by: Miska Hämäläinen <miska.hamalainen@hotmail.com>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260705113246.812500-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:41 -07:00
Florian Schut
8012fd4927 hwmon: (asus-ec-sensors) add ROG Maximus Z790 Hero
Add support for ROG Maximus Z790 Hero.

Signed-off-by: Florian Schut <mail@florianschut.nl>
Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
Link: https://lore.kernel.org/r/20260705113125.812045-1-eugene.shalygin@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Rafael J. Wysocki
2d2f6ce9f8 hwmon: (acpi_power_meter) Stop setting acpi_device_name/class()
The driver populates acpi_device_name() and acpi_device_class() that are
never read afterward, so make it stop doing that and drop the symbols
defined for this purpose.

Since ACPI_POWER_METER_CLASS is also used for generating ACPI netlink
events, use the "pwr_meter_resource" string literal directly instead of
it for that.

No intentional functional impact.

This will facilitate the removal of device_name and device_class from
struct acpi_device_pnp in the future.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/2297496.irdbgypaU6@rafael.j.wysocki
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Huan He
a24f4ea5f3 hwmon: Add Eswin EIC7700 PVT sensor driver
Add support for ESWIN EIC7700 Voltage and Temperature sensor. The driver
supports temperature and voltage monitoring with polynomial conversion,
and provides sysfs interface for sensor data access.

The PVT IP contains one temperature sensor and one voltage sensor.

Signed-off-by: Yulin Lu <luyulin@eswincomputing.com>
Signed-off-by: Huan He <hehuan1@eswincomputing.com>
Signed-off-by: Xuyang Dong <dongxuyang@eswincomputing.com>
Link: https://lore.kernel.org/r/20260630091220.1608-1-dongxuyang@eswincomputing.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Huan He
9a91663638 dt-bindings: hwmon: Add Eswin EIC7700 PVT sensor
Add device tree binding documentation for ESWIN EIC7700 Voltage and
Temperature sensor.

The EIC7700 SoC integrates two PVT instances for monitoring SoC and DDR
power domains respectively.

Signed-off-by: Yulin Lu <luyulin@eswincomputing.com>
Signed-off-by: Huan He <hehuan1@eswincomputing.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Xuyang Dong <dongxuyang@eswincomputing.com>
Link: https://lore.kernel.org/r/20260630091122.1462-1-dongxuyang@eswincomputing.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Thomas Weißschuh
de0181c95b hwmon: (cros_ec) Implement custom kelvin to celsius conversions
The ChromeOS EC APIs use integers representing degrees kelvin for
temperatures. The default conversions from linux/units.h will then
always convert these integer degrees celsius with a 150 millidegree
offset. This is a bit confusing, as it also differs from other CrOS EC
tooling. Internally the EC uses a kelvin to celsius offset of a round
273, so the current conversion is also not entirely accurate.

Implement a custom conversion which preserves round values.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20260630-cros_ec-hwmon-overflow-v1-1-3d2ecd3eb0f2@weissschuh.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Lars Randers
ecc0eb5e95 hwmon: Driver for the temp/voltage sensor on PolarFire SoC
Add a driver for the temperature and voltage sensors on PolarFire SoC.
The temperature reports how hot the die is, and the voltages are the
SoC's 1.05, 1.8 and 2.5 volt rails respectively.

The hardware supports alarms in theory, but there is an erratum that
prevents clearing them once triggered, so no support is added for them.

The hardware measures voltage with 16 bits, of which 1 is a sign bit and
the remainder holds the voltage as a fixed point integer value. It's
improbable that the hardware will work if the voltages are negative, so
the driver ignores the sign bits.

There's no dt support etc here because this is the child of a simple-mfd
syscon.

Signed-off-by: Lars Randers <lranders@mail.dk>
Co-developed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260629-wriggle-headscarf-c85a4070dddb@spud
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Sudeep Holla
92ead3c1f1 hwmon: (xgene) Stop writing PCC shared memory signature
ACPI specification defines the generic PCC shared memory signature as
the PCC base signature ORed with the subspace ID.

ACPI 6.6 added clarification that the signature is populated by the
platform and verified by OSPM.

The PCC mailbox controller now validates the signature when the channel
is requested. Stop rewriting the signature before each command and
leave the platform-populated value intact.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Link: https://lore.kernel.org/r/20260627-acpi_pcc_signature-v1-2-c1b7268d4fdc@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
73a76fa6e8 hwmon: (pmbus/adm1275) Support ROHM BD12790
Add support for ROHM BD12790 hot-swap controller which is largely
similar to Analog Devices adm1272.

The BD12790 uses the same selectable 60V/100V voltage ranges and
15mV/30mV current-sense ranges as the ADM1272, and the same VRANGE
(bit 5) and IRANGE (bit 0) layout in PMON_CONFIG. It therefore uses
a dedicated coefficient table that mirrors adm1272_coefficients, with
the following differences derived from BD12790 datasheet Table 1 (p.18):
- power 60V/30mV: m=17560 (vs. 17561)
- power 100V/30mV: m=10536 (vs. 10535)
- temperature: b=31880 (vs. 31871, reflecting T[11:0] = 4.2*T + 3188)

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Link: https://lore.kernel.org/r/b209c1b47712b69f17b52cfd7a7a38ed76024ca7.1782458224.git.mazziesaccount@gmail.com
[groeck: Fixed comment describing BD12790 coefficients]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
b66f500d62 dt-bindings: adm1275: ROHM BD12790 hot-swap controller
Support ROHM BD12790 hot-swap controller which is largely compatible
with the Analog Devices adm1272.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/753a6ded3e1aff1aaba7d932f0a883f789d9dfaa.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
1170dfa0c3 doc: adm1275: Add ROHM BD12790
Add the ROHM BD12790 to the list of the ICs supported by the adm1275
driver.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/9bafcfe37190b5a3925e8dcfa3b59f8d240234ba.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
5a419373bc hwmon: (pmbus/adm1275) Support ROHM BD12780
ROHM BD12780 and BD12780A are hot-swap controllers. They are largely
similar to Analog Devices ADM1278. Besides the ID registers and some
added functionality, the BD12780 and BD12780A mark PMON_CONFIG bits
[15:14] as reserved. Hence TSFILT setting must be omitted on these ICs.

The BD12780 has 3 pins usable for configuring the I2C address. The
BD12780A lists the ADDR3-pin as "not connect".

Support ROHM BD12780 and BD12780A controllers.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/e1e6e6218c08b562311356ef9c57378d32c26b08.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
3f48a6ffe1 doc: hwmon: Add ROHM BD12780 and BD12780A
Add the ROHM BD12780 and the BD12780A to the list of the ICs supported by
the adm1275 driver.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/5ff4a4a7a939cd642522fde407b5c9fa123a7089.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
d475fcefbb hwmon: (pmbus/adm1275) Support module auto-loading
Populating the i2c_device_id -table is not enough to make the
driver module automatically load when device-tree node for the
power-monitor is parsed at boot.

Adding the of_device_id tables causes the driver module to be
automatically load at boot. Testing has been done with rather old Debian
system.

When inspecting the generated module-aliases with the insmod, following
entries seem to be the difference:

alias:          of:N*T*Cadi,adm1075C*
alias:          of:N*T*Cadi,adm1075

I suspect these are required for the module loading to work.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/9eca6831f9fe2d781bb88337397c39b10e36f5c6.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Matti Vaittinen
b0374b52b4 dt-bindings: adm1275: ROHM BD12780 hot-swap controller
Support ROHM BD12780 and BD12780A hot-swap controllers, which are largely
compatible with the Analog Devices adm1278. Main difference between
the BD12780 and the BD12780A is, that the BD12780 has one I2C address
configuration pin more (ADDR3) than the BD12780A.

Introduce own compatibles for both variants but require the BD12780A to
always have the BD12780 as a fall-back.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/2b7d5bb8cba773d0bba1d6779f0e6daa6a40eed4.1782458224.git.mazziesaccount@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Flaviu Nistor
5a260163e1 hwmon: (chipcap2) Add support for label
Add support for label sysfs attribute similar to other hwmon devices.
This is particularly useful for systems with multiple sensors on the
same board, where identifying individual sensors is much easier since
labels can be defined via device tree.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20260625160423.17882-2-flaviu.nistor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Flaviu Nistor
aa28a6c3a2 dt-bindings: hwmon: chipcap2: Add label property
Add support for an optional label property similar to other hwmon devices.
This allows, in case of boards with multiple CHIPCAP2 sensors, to assign
distinct names to each instance.

Signed-off-by: Flaviu Nistor <flaviu.nistor@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260625160423.17882-1-flaviu.nistor@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Abdurrahman Hussain
bee42c6311 hwmon: (pmbus/xdpe1a2g7b) Add regulator support
Register both dual-loop output channels with the regulator framework by
populating regulator_desc[] and num_regulators in pmbus_driver_info.
This exposes the standard PMBus OPERATION-based on/off control and
status reporting to consumer drivers.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Link: https://lore.kernel.org/r/20260619-xdpe1a2g7b-v1-1-428c3847be0d@nexthop.ai
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Ximing Zhang
6a9ad0ac9b hwmon: (coretemp) Clarify attr_size comment
The attr_size field stores the number of sysfs attributes created for a
temperature data group. Clarify the comment to describe the field directly.

No functional change intended.

Signed-off-by: Ximing Zhang <xzhangjr@gmail.com>
Link: https://lore.kernel.org/r/20260616125631.35537-1-xzhangjr@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Ximing Zhang
bf74d14fba hwmon: coretemp: Fix documentation wording
Fix two minor wording issues in the coretemp documentation.

Signed-off-by: Ximing Zhang <xzhangjr@gmail.com>
Link: https://lore.kernel.org/r/20260616121549.29484-1-xzhangjr@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Potin Lai
a86e9ca4ed hwmon: (pmbus/lm25066) add current limit configuration support
Add support for the 'ti,current-range' devicetree property to configure
the current limit via the DEVICE_SETUP (0xD9) register, overriding the
physical CL pin setting.

This configuration is supported on all chips in this driver (LM25066,
LM5064, LM5066, LM5066i) except LM25056.

The property values "low" and "high" map to:
- LM25066: low = 25 mV, high = 46 mV
- LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV

The Bit 4 mapping to High/Low current limit is handled dynamically on
probe because it is swapped for LM25066 compared to the other supported
chips.

Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
Link: https://lore.kernel.org/r/20260615-lm25066-cl-config-v3-2-decb4f5b0b77@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00
Potin Lai
47afef9f4c dt-bindings: hwmon: pmbus: ti,lm25066: add current limit properties
Add a 'ti,current-range' string property to configure the device's Current
Limit (CL) behavior to "high" or "low" via the register, overriding the
physical CL pin setting.

This configuration is supported on LM25066, LM5064, LM5066, and LM5066i.
LM25056 is excluded because it does not support configuring the current
limit via the DEVICE_SETUP register (bit 2 of DEVICE_SETUP is reserved).

The values "low" and "high" map to the respective low/high threshold
voltages of the chips:
- LM25066: low = 25 mV, high = 46 mV
- LM5064, LM5066, LM5066i: low = 26 mV, high = 50 mV

Signed-off-by: Potin Lai <potin.lai.pt@gmail.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20260615-lm25066-cl-config-v3-1-decb4f5b0b77@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2026-08-10 08:59:40 -07:00