Commit Graph

2 Commits

Author SHA1 Message Date
Guenter Roeck
0b3c04c818 hwmon: (pmbus) Do not set regulators_node for single-channel chips
Single-channel regulators do not need and should not have a "regulators"
node. We can not entirely remove it due to existing bindings. To solve the
problem for new drivers, provide additional macros PMBUS_REGULATOR_ONE_NODE
and PMBUS_REGULATOR_STEP_ONE_NODE and convert existing drivers to use those
macros. The exception is the ir38064 driver because its devicetree files
and its description do not require or use the nested regulators node.

Modify PMBUS_REGULATOR_STEP_ONE and PMBUS_REGULATOR_ONE to set the
regulators_node pointer to NULL.

Cc: Cedricjustine.Encarnacion@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250322142602.560042-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-04-23 07:18:27 -07:00
Jerome Brunet
339bca4ffd hwmon: (pmbus/tps25990) Add initial support
Add initial support for the Texas Instruments TPS25990 eFuse.
This adds the basic PMBUS telemetry support for the device.

From Karol Przybylski:
  The tps25990_read_word_data function contains a block of unreachable code
  caused by the syntactic structure in the PMBUS_VIRT_READ_IIN_MAX case.

  Specifically, the return TPS25990_READ_IIN_PEAK; statement immediately
  exits the function, making the next lines unreachable.

  This patch removes the return statement, leaving the expected handling.
  Discovered in coverity: CID 1602227

Tested-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
[groeck: Adjust to MODULE_IMPORT_NS API change]
[karprzy7@gmail.com: Fix unreachable code in tps25990_read_word_data]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2024-12-14 08:00:44 -08:00