]> Git Repo - J-linux.git/commitdiff
hwmon: (pmbus) Add Vin unit off handling
authorBrandon Wyman <[email protected]>
Thu, 17 Mar 2022 23:21:23 +0000 (23:21 +0000)
committerGuenter Roeck <[email protected]>
Fri, 18 Mar 2022 05:30:28 +0000 (22:30 -0700)
If there is an input undervoltage fault, reported in STATUS_INPUT
command response, there is quite likely a "Unit Off For Insufficient
Input Voltage" condition as well.

Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit
attributes to include both bits in the mask for clearing faults.

If an input undervoltage fault occurs, causing a unit off for
insufficient input voltage, but the unit is off bit is not cleared, the
STATUS_WORD will not be updated to clear the input fault condition.
Including the unit is off bit (bit 3) allows for the input fault
condition to completely clear.

Signed-off-by: Brandon Wyman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: b4ce237b7f7d3 ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers")
[groeck: Dropped unnecessary ()]
Signed-off-by: Guenter Roeck <[email protected]>
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c

index 38f049d68d3298728c7e0deda3a6cb6a626b7805..e74b6ef070f3eaea16d3e82860cd4e93da323417 100644 (file)
@@ -319,6 +319,7 @@ enum pmbus_fan_mode { percent = 0, rpm };
 /*
  * STATUS_VOUT, STATUS_INPUT
  */
+#define PB_VOLTAGE_VIN_OFF             BIT(3)
 #define PB_VOLTAGE_UV_FAULT            BIT(4)
 #define PB_VOLTAGE_UV_WARNING          BIT(5)
 #define PB_VOLTAGE_OV_WARNING          BIT(6)
index 8eed7968a50efffc6977824981a0a8ff13faed9c..b2618b1d529e2d86836364c66f5801aeefa2d466 100644 (file)
@@ -1373,7 +1373,7 @@ static const struct pmbus_limit_attr vin_limit_attrs[] = {
                .reg = PMBUS_VIN_UV_FAULT_LIMIT,
                .attr = "lcrit",
                .alarm = "lcrit_alarm",
-               .sbit = PB_VOLTAGE_UV_FAULT,
+               .sbit = PB_VOLTAGE_UV_FAULT | PB_VOLTAGE_VIN_OFF,
        }, {
                .reg = PMBUS_VIN_OV_WARN_LIMIT,
                .attr = "max",
This page took 0.060292 seconds and 4 git commands to generate.