Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Brandon Wyman | 8d19577 | 2020-01-27 15:03:51 -0600 | [diff] [blame] | 3 | #include "pmbus.hpp" |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 4 | #include "types.hpp" |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 5 | #include "util.hpp" |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 6 | #include "utility.hpp" |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 7 | |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 8 | #include <gpiod.hpp> |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 9 | #include <sdbusplus/bus/match.hpp> |
| 10 | |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 11 | #include <filesystem> |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 12 | #include <stdexcept> |
| 13 | |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 14 | namespace phosphor::power::psu |
| 15 | { |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 16 | |
Chanh Nguyen | c12c53b | 2021-04-06 17:24:47 +0700 | [diff] [blame] | 17 | #if IBM_VPD |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 18 | // PMBus device driver "file name" to read for CCIN value. |
| 19 | constexpr auto CCIN = "ccin"; |
| 20 | constexpr auto PART_NUMBER = "part_number"; |
| 21 | constexpr auto FRU_NUMBER = "fru"; |
| 22 | constexpr auto SERIAL_HEADER = "header"; |
| 23 | constexpr auto SERIAL_NUMBER = "serial_number"; |
| 24 | constexpr auto FW_VERSION = "fw_version"; |
| 25 | |
| 26 | // The D-Bus property name to update with the CCIN value. |
| 27 | constexpr auto MODEL_PROP = "Model"; |
| 28 | constexpr auto PN_PROP = "PartNumber"; |
Brandon Wyman | a169b0f | 2021-12-07 20:18:06 +0000 | [diff] [blame] | 29 | constexpr auto SPARE_PN_PROP = "SparePartNumber"; |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 30 | constexpr auto SN_PROP = "SerialNumber"; |
| 31 | constexpr auto VERSION_PROP = "Version"; |
| 32 | |
| 33 | // ipzVPD Keyword sizes |
| 34 | static constexpr auto FL_KW_SIZE = 20; |
| 35 | #endif |
| 36 | |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 37 | constexpr auto LOG_LIMIT = 3; |
Brandon Wyman | 06ca459 | 2021-12-06 22:52:23 +0000 | [diff] [blame] | 38 | constexpr auto DEGLITCH_LIMIT = 3; |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 39 | |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 40 | /** |
| 41 | * @class PowerSupply |
| 42 | * Represents a PMBus power supply device. |
| 43 | */ |
| 44 | class PowerSupply |
| 45 | { |
| 46 | public: |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 47 | PowerSupply() = delete; |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 48 | PowerSupply(const PowerSupply&) = delete; |
| 49 | PowerSupply(PowerSupply&&) = delete; |
| 50 | PowerSupply& operator=(const PowerSupply&) = delete; |
| 51 | PowerSupply& operator=(PowerSupply&&) = delete; |
| 52 | ~PowerSupply() = default; |
| 53 | |
| 54 | /** |
Brandon Wyman | c63941c | 2020-01-27 16:49:33 -0600 | [diff] [blame] | 55 | * @param[in] invpath - String for inventory path to use |
| 56 | * @param[in] i2cbus - The bus number this power supply is on |
| 57 | * @param[in] i2caddr - The 16-bit I2C address of the power supply |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 58 | * @param[in] gpioLineName - The gpio-line-name to read for presence. See |
| 59 | * https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 60 | */ |
Brandon Wyman | c63941c | 2020-01-27 16:49:33 -0600 | [diff] [blame] | 61 | PowerSupply(sdbusplus::bus::bus& bus, const std::string& invpath, |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 62 | std::uint8_t i2cbus, const std::uint16_t i2caddr, |
| 63 | const std::string& gpioLineName); |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 64 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 65 | phosphor::pmbus::PMBusBase& getPMBus() |
| 66 | { |
| 67 | return *pmbusIntf; |
| 68 | } |
| 69 | |
Adriana Kobylak | 3ca062a | 2021-10-20 15:27:23 +0000 | [diff] [blame] | 70 | GPIOInterfaceBase* getPresenceGPIO() |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 71 | { |
| 72 | return presenceGPIO.get(); |
| 73 | } |
| 74 | |
B. J. Wyman | d8b8cb1 | 2021-07-15 22:03:34 +0000 | [diff] [blame] | 75 | std::string getPresenceGPIOName() const |
| 76 | { |
| 77 | if (presenceGPIO != nullptr) |
| 78 | { |
| 79 | return presenceGPIO->getName(); |
| 80 | } |
| 81 | else |
| 82 | { |
| 83 | return std::string(); |
| 84 | } |
| 85 | } |
| 86 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 87 | /** |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 88 | * Power supply specific function to analyze for faults/errors. |
| 89 | * |
| 90 | * Various PMBus status bits will be checked for fault conditions. |
| 91 | * If a certain fault bits are on, the appropriate error will be |
| 92 | * committed. |
| 93 | */ |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 94 | void analyze(); |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 95 | |
| 96 | /** |
Brandon Wyman | 59a3579 | 2020-06-04 12:37:40 -0500 | [diff] [blame] | 97 | * Write PMBus ON_OFF_CONFIG |
| 98 | * |
| 99 | * This function will be called to cause the PMBus device driver to send the |
| 100 | * ON_OFF_CONFIG command. Takes one byte of data. |
| 101 | * |
| 102 | * @param[in] data - The ON_OFF_CONFIG data byte mask. |
| 103 | */ |
| 104 | void onOffConfig(uint8_t data); |
| 105 | |
| 106 | /** |
Brandon Wyman | e3f7ad2 | 2021-12-21 20:27:45 +0000 | [diff] [blame] | 107 | * Clears all the member variables that indicate if a fault bit was seen as |
| 108 | * on in the STATUS_WORD or STATUS_MFR_SPECIFIC response. |
| 109 | */ |
| 110 | void clearFaultFlags() |
| 111 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 112 | inputFault = 0; |
| 113 | mfrFault = 0; |
Brandon Wyman | e3f7ad2 | 2021-12-21 20:27:45 +0000 | [diff] [blame] | 114 | statusMFR = 0; |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 115 | vinUVFault = 0; |
| 116 | cmlFault = 0; |
| 117 | voutOVFault = 0; |
| 118 | ioutOCFault = 0; |
| 119 | voutUVFault = 0; |
| 120 | fanFault = 0; |
| 121 | tempFault = 0; |
Brandon Wyman | e3f7ad2 | 2021-12-21 20:27:45 +0000 | [diff] [blame] | 122 | pgoodFault = 0; |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 123 | psKillFault = 0; |
| 124 | ps12VcsFault = 0; |
| 125 | psCS12VFault = 0; |
Brandon Wyman | e3f7ad2 | 2021-12-21 20:27:45 +0000 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | /** |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 129 | * Write PMBus CLEAR_FAULTS |
| 130 | * |
| 131 | * This function will be called in various situations in order to clear |
| 132 | * any fault status bits that may have been set, in order to start over |
| 133 | * with a clean state. Presence changes and power state changes will |
| 134 | * want to clear any faults logged. |
| 135 | */ |
Brandon Wyman | 3c20846 | 2020-05-13 16:25:58 -0500 | [diff] [blame] | 136 | void clearFaults(); |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 137 | |
| 138 | /** |
| 139 | * @brief Adds properties to the inventory. |
| 140 | * |
| 141 | * Reads the values from the device and writes them to the |
| 142 | * associated power supply D-Bus inventory object. |
| 143 | * |
| 144 | * This needs to be done on startup, and each time the presence |
| 145 | * state changes. |
| 146 | * |
| 147 | * Properties added: |
| 148 | * - Serial Number |
| 149 | * - Part Number |
| 150 | * - CCIN (Customer Card Identification Number) - added as the Model |
| 151 | * - Firmware version |
| 152 | */ |
Brandon Wyman | 1d7a7df | 2020-03-26 10:14:05 -0500 | [diff] [blame] | 153 | void updateInventory(); |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 154 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 155 | /** |
| 156 | * @brief Accessor function to indicate present status |
| 157 | */ |
| 158 | bool isPresent() const |
| 159 | { |
| 160 | return present; |
| 161 | } |
| 162 | |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 163 | /** |
Brandon Wyman | fed0ba2 | 2020-09-26 20:02:51 -0500 | [diff] [blame] | 164 | * @brief Returns the last read value from STATUS_WORD. |
| 165 | */ |
| 166 | uint64_t getStatusWord() const |
| 167 | { |
| 168 | return statusWord; |
| 169 | } |
| 170 | |
| 171 | /** |
Brandon Wyman | f07bc79 | 2021-10-12 19:00:35 +0000 | [diff] [blame] | 172 | * @brief Returns the last read value from STATUS_INPUT. |
| 173 | */ |
| 174 | uint64_t getStatusInput() const |
| 175 | { |
| 176 | return statusInput; |
| 177 | } |
| 178 | |
| 179 | /** |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 180 | * @brief Returns the last read value from STATUS_MFR. |
| 181 | */ |
| 182 | uint64_t getMFRFault() const |
| 183 | { |
| 184 | return statusMFR; |
| 185 | } |
| 186 | |
| 187 | /** |
Brandon Wyman | 85c7bf4 | 2021-10-19 22:28:48 +0000 | [diff] [blame] | 188 | * @brief Returns the last read value from STATUS_CML. |
| 189 | */ |
| 190 | uint64_t getStatusCML() const |
| 191 | { |
| 192 | return statusCML; |
| 193 | } |
| 194 | |
| 195 | /** |
Brandon Wyman | 6710ba2 | 2021-10-27 17:39:31 +0000 | [diff] [blame] | 196 | * @brief Returns the last read value from STATUS_VOUT. |
| 197 | */ |
| 198 | uint64_t getStatusVout() const |
| 199 | { |
| 200 | return statusVout; |
| 201 | } |
| 202 | |
| 203 | /** |
Brandon Wyman | b10b3be | 2021-11-09 22:12:15 +0000 | [diff] [blame] | 204 | * @brief Returns the last value read from STATUS_IOUT. |
| 205 | */ |
| 206 | uint64_t getStatusIout() const |
| 207 | { |
| 208 | return statusIout; |
| 209 | } |
| 210 | |
| 211 | /** |
Brandon Wyman | 7ee4d7e | 2021-11-19 20:48:23 +0000 | [diff] [blame] | 212 | * @brief Returns the last value read from STATUS_FANS_1_2. |
| 213 | */ |
| 214 | uint64_t getStatusFans12() const |
| 215 | { |
| 216 | return statusFans12; |
| 217 | } |
| 218 | |
| 219 | /** |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 220 | * @brief Returns the last value read from STATUS_TEMPERATURE. |
| 221 | */ |
| 222 | uint64_t getStatusTemperature() const |
| 223 | { |
| 224 | return statusTemperature; |
| 225 | } |
| 226 | |
| 227 | /** |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 228 | * @brief Returns true if a fault was found. |
| 229 | */ |
| 230 | bool isFaulted() const |
| 231 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 232 | return (hasCommFault() || (vinUVFault >= DEGLITCH_LIMIT) || |
| 233 | (inputFault >= DEGLITCH_LIMIT) || |
| 234 | (voutOVFault >= DEGLITCH_LIMIT) || |
| 235 | (ioutOCFault >= DEGLITCH_LIMIT) || |
| 236 | (voutUVFault >= DEGLITCH_LIMIT) || |
| 237 | (fanFault >= DEGLITCH_LIMIT) || (tempFault >= DEGLITCH_LIMIT) || |
| 238 | (pgoodFault >= DEGLITCH_LIMIT) || (mfrFault >= DEGLITCH_LIMIT)); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | /** |
Brandon Wyman | b76ab24 | 2020-09-16 18:06:06 -0500 | [diff] [blame] | 242 | * @brief Return whether a fault has been logged for this power supply |
| 243 | */ |
| 244 | bool isFaultLogged() const |
| 245 | { |
| 246 | return faultLogged; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * @brief Called when a fault for this power supply has been logged. |
| 251 | */ |
| 252 | void setFaultLogged() |
| 253 | { |
| 254 | faultLogged = true; |
| 255 | } |
| 256 | |
| 257 | /** |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 258 | * @brief Returns true if INPUT fault occurred. |
| 259 | */ |
| 260 | bool hasInputFault() const |
| 261 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 262 | return (inputFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | /** |
| 266 | * @brief Returns true if MFRSPECIFIC occurred. |
| 267 | */ |
| 268 | bool hasMFRFault() const |
| 269 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 270 | return (mfrFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | /** |
| 274 | * @brief Returns true if VIN_UV_FAULT occurred. |
| 275 | */ |
| 276 | bool hasVINUVFault() const |
| 277 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 278 | return (vinUVFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 279 | } |
| 280 | |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 281 | /** |
Brandon Wyman | 6710ba2 | 2021-10-27 17:39:31 +0000 | [diff] [blame] | 282 | * @brief Returns true if VOUT_OV_FAULT occurred. |
| 283 | */ |
| 284 | bool hasVoutOVFault() const |
| 285 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 286 | return (voutOVFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 6710ba2 | 2021-10-27 17:39:31 +0000 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | /** |
Brandon Wyman | b10b3be | 2021-11-09 22:12:15 +0000 | [diff] [blame] | 290 | * @brief Returns true if IOUT_OC fault occurred (bit 4 STATUS_BYTE). |
| 291 | */ |
| 292 | bool hasIoutOCFault() const |
| 293 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 294 | return (ioutOCFault >= DEGLITCH_LIMIT); |
Brandon Wyman | b10b3be | 2021-11-09 22:12:15 +0000 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | /** |
Brandon Wyman | 2cf4694 | 2021-10-28 19:09:16 +0000 | [diff] [blame] | 298 | * @brief Returns true if VOUT_UV_FAULT occurred. |
| 299 | */ |
| 300 | bool hasVoutUVFault() const |
| 301 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 302 | return (voutUVFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 2cf4694 | 2021-10-28 19:09:16 +0000 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | /** |
Brandon Wyman | 7ee4d7e | 2021-11-19 20:48:23 +0000 | [diff] [blame] | 306 | *@brief Returns true if fan fault occurred. |
| 307 | */ |
| 308 | bool hasFanFault() const |
| 309 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 310 | return (fanFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 7ee4d7e | 2021-11-19 20:48:23 +0000 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | /** |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 314 | * @brief Returns true if TEMPERATURE fault occurred. |
| 315 | */ |
| 316 | bool hasTempFault() const |
| 317 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 318 | return (tempFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | /** |
Brandon Wyman | 2916ea5 | 2021-11-06 03:31:18 +0000 | [diff] [blame] | 322 | * @brief Returns true if there is a PGood fault (PGOOD# inactive, or OFF |
| 323 | * bit on). |
| 324 | */ |
| 325 | bool hasPgoodFault() const |
| 326 | { |
Brandon Wyman | 06ca459 | 2021-12-06 22:52:23 +0000 | [diff] [blame] | 327 | return (pgoodFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 2916ea5 | 2021-11-06 03:31:18 +0000 | [diff] [blame] | 328 | } |
| 329 | |
| 330 | /** |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 331 | * @brief Return true if there is a PS_Kill fault. |
| 332 | */ |
| 333 | bool hasPSKillFault() const |
| 334 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 335 | return (psKillFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | /** |
| 339 | * @brief Returns true if there is a 12Vcs (standy power) fault. |
| 340 | */ |
| 341 | bool hasPS12VcsFault() const |
| 342 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 343 | return (ps12VcsFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | /** |
| 347 | * @brief Returns true if there is a 12V current-share fault. |
| 348 | */ |
| 349 | bool hasPSCS12VFault() const |
| 350 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 351 | return (psCS12VFault >= DEGLITCH_LIMIT); |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 352 | } |
| 353 | |
| 354 | /** |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 355 | * @brief Returns the device path |
| 356 | * |
| 357 | * This can be used for error call outs. |
| 358 | * Example: /sys/bus/i2c/devices/3-0068 |
| 359 | */ |
Brandon Wyman | 4176d6b | 2020-10-07 17:41:06 -0500 | [diff] [blame] | 360 | const std::string getDevicePath() const |
| 361 | { |
| 362 | return pmbusIntf->path(); |
| 363 | } |
| 364 | |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 365 | /** |
| 366 | * @brief Returns this power supplies inventory path. |
| 367 | * |
| 368 | * This can be used for error call outs. |
| 369 | * Example: |
| 370 | * /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 |
| 371 | */ |
Brandon Wyman | 7e49527 | 2020-09-26 19:57:46 -0500 | [diff] [blame] | 372 | const std::string& getInventoryPath() const |
| 373 | { |
| 374 | return inventoryPath; |
| 375 | } |
| 376 | |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 377 | /** |
| 378 | * @brief Returns the firmware revision version read from the power supply |
| 379 | */ |
| 380 | const std::string& getFWVersion() const |
| 381 | { |
| 382 | return fwVersion; |
| 383 | } |
| 384 | |
Adriana Kobylak | 572a905 | 2021-03-30 15:58:07 +0000 | [diff] [blame] | 385 | /** |
| 386 | * @brief Returns the model name of the power supply |
| 387 | */ |
| 388 | const std::string& getModelName() const |
| 389 | { |
| 390 | return modelName; |
| 391 | } |
| 392 | |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 393 | /** @brief Returns true if the number of failed reads exceeds limit |
| 394 | * TODO: or CML bit on. |
| 395 | */ |
| 396 | bool hasCommFault() const |
| 397 | { |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 398 | return ((readFail >= LOG_LIMIT) || (cmlFault >= DEGLITCH_LIMIT)); |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 399 | } |
| 400 | |
Adriana Kobylak | 4175ffb | 2021-08-02 14:51:05 +0000 | [diff] [blame] | 401 | /** |
| 402 | * @brief Reads the pmbus input voltage and returns that actual voltage |
| 403 | * reading and the calculated input voltage based on thresholds. |
| 404 | * @param[out] actualInputVoltage - The actual voltage reading, in Volts. |
| 405 | * @param[out] inputVoltage - A rounded up/down value of the actual input |
| 406 | * voltage based on thresholds, in Volts. |
| 407 | */ |
| 408 | void getInputVoltage(double& actualInputVoltage, int& inputVoltage) const; |
| 409 | |
Matt Spinler | 0975eaf | 2022-02-14 15:38:30 -0600 | [diff] [blame^] | 410 | /** |
| 411 | * @brief Check if the PS is considered to be available or not |
| 412 | * |
| 413 | * It is unavailable if any of: |
| 414 | * - not present |
| 415 | * - input fault active |
| 416 | * - Vin UV fault active |
| 417 | * - PS KILL fault active |
| 418 | * - Iout OC fault active |
| 419 | * |
| 420 | * Other faults will, through creating error logs with callouts, already |
| 421 | * be setting the Functional property to false. |
| 422 | * |
| 423 | * On changes, the Available property is updated in the inventory. |
| 424 | */ |
| 425 | void checkAvailability(); |
| 426 | |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 427 | private: |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 428 | /** @brief systemd bus member */ |
| 429 | sdbusplus::bus::bus& bus; |
| 430 | |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 431 | /** @brief Will be updated to the latest/lastvalue read from STATUS_WORD.*/ |
Brandon Wyman | fed0ba2 | 2020-09-26 20:02:51 -0500 | [diff] [blame] | 432 | uint64_t statusWord = 0; |
| 433 | |
Brandon Wyman | f07bc79 | 2021-10-12 19:00:35 +0000 | [diff] [blame] | 434 | /** @brief Will be updated to the latest/lastvalue read from STATUS_INPUT.*/ |
| 435 | uint64_t statusInput = 0; |
| 436 | |
Jay Meyer | 10d9405 | 2020-11-30 14:41:21 -0600 | [diff] [blame] | 437 | /** @brief Will be updated to the latest/lastvalue read from STATUS_MFR.*/ |
| 438 | uint64_t statusMFR = 0; |
| 439 | |
Brandon Wyman | 85c7bf4 | 2021-10-19 22:28:48 +0000 | [diff] [blame] | 440 | /** @brief Will be updated to the latest/last value read from STATUS_CML.*/ |
| 441 | uint64_t statusCML = 0; |
| 442 | |
Brandon Wyman | 6710ba2 | 2021-10-27 17:39:31 +0000 | [diff] [blame] | 443 | /** @brief Will be updated to the latest/last value read from STATUS_VOUT.*/ |
| 444 | uint64_t statusVout = 0; |
| 445 | |
Brandon Wyman | b10b3be | 2021-11-09 22:12:15 +0000 | [diff] [blame] | 446 | /** @brief Will be updated to the latest/last value read from STATUS_IOUT.*/ |
| 447 | uint64_t statusIout = 0; |
| 448 | |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 449 | /** @brief Will be updated to the latest/last value read from |
Brandon Wyman | 7ee4d7e | 2021-11-19 20:48:23 +0000 | [diff] [blame] | 450 | * STATUS_FANS_1_2. */ |
| 451 | uint64_t statusFans12 = 0; |
| 452 | |
| 453 | /** @brief Will be updated to the latest/last value read from |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 454 | * STATUS_TEMPERATURE.*/ |
| 455 | uint64_t statusTemperature = 0; |
| 456 | |
Brandon Wyman | 82affd9 | 2021-11-24 19:12:49 +0000 | [diff] [blame] | 457 | /** @brief Will be updated with latest converted value read from READ_VIN */ |
| 458 | int inputVoltage = phosphor::pmbus::in_input::VIN_VOLTAGE_0; |
| 459 | |
Brandon Wyman | b76ab24 | 2020-09-16 18:06:06 -0500 | [diff] [blame] | 460 | /** @brief True if an error for a fault has already been logged. */ |
| 461 | bool faultLogged = false; |
| 462 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 463 | /** @brief Incremented if bit 1 of STATUS_WORD low byte is on. |
| 464 | * |
| 465 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 466 | */ |
| 467 | size_t cmlFault = 0; |
Brandon Wyman | 85c7bf4 | 2021-10-19 22:28:48 +0000 | [diff] [blame] | 468 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 469 | /** @brief Incremented if bit 5 of STATUS_WORD high byte is on. |
| 470 | * |
| 471 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 472 | */ |
| 473 | size_t inputFault = 0; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 474 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 475 | /** @brief Incremented if bit 4 of STATUS_WORD high byte is on. |
| 476 | * |
| 477 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 478 | */ |
| 479 | size_t mfrFault = 0; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 480 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 481 | /** @brief Incremented if bit 3 of STATUS_WORD low byte is on. |
| 482 | * |
| 483 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 484 | */ |
| 485 | size_t vinUVFault = 0; |
Brandon Wyman | 3f1242f | 2020-01-28 13:11:25 -0600 | [diff] [blame] | 486 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 487 | /** @brief Incremented if bit 5 of STATUS_WORD low byte is on. |
| 488 | * |
| 489 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 490 | */ |
| 491 | size_t voutOVFault = 0; |
Brandon Wyman | 6710ba2 | 2021-10-27 17:39:31 +0000 | [diff] [blame] | 492 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 493 | /** @brief Incremented if bit 4 of STATUS_WORD low byte is on. |
| 494 | * |
| 495 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 496 | */ |
| 497 | size_t ioutOCFault = 0; |
Brandon Wyman | b10b3be | 2021-11-09 22:12:15 +0000 | [diff] [blame] | 498 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 499 | /** @brief Incremented if bit 7 of STATUS_WORD high byte is on and bit 5 |
| 500 | * (VOUT_OV) of low byte is off. |
| 501 | * |
| 502 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 503 | */ |
| 504 | size_t voutUVFault = 0; |
Brandon Wyman | 2cf4694 | 2021-10-28 19:09:16 +0000 | [diff] [blame] | 505 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 506 | /** @brief Incremented if FANS fault/warn bit on in STATUS_WORD. |
| 507 | * |
| 508 | * Considered faulted if reaches DEGLITCH_LIMIT. |
| 509 | */ |
| 510 | size_t fanFault = 0; |
Brandon Wyman | 7ee4d7e | 2021-11-19 20:48:23 +0000 | [diff] [blame] | 511 | |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 512 | /** @brief Incremented if bit 2 of STATUS_WORD low byte is on. |
| 513 | * |
| 514 | * Considered faulted if reaches DEGLITCH_LIMIT. */ |
| 515 | size_t tempFault = 0; |
Brandon Wyman | 96893a4 | 2021-11-05 19:56:57 +0000 | [diff] [blame] | 516 | |
Brandon Wyman | 2cf4694 | 2021-10-28 19:09:16 +0000 | [diff] [blame] | 517 | /** |
Brandon Wyman | 06ca459 | 2021-12-06 22:52:23 +0000 | [diff] [blame] | 518 | * @brief Incremented if bit 11 or 6 of STATUS_WORD is on. PGOOD# is |
| 519 | * inactive, or the unit is off. |
| 520 | * |
| 521 | * Considered faulted if reaches DEGLITCH_LIMIT. |
Brandon Wyman | 2916ea5 | 2021-11-06 03:31:18 +0000 | [diff] [blame] | 522 | */ |
Brandon Wyman | 925c026 | 2021-12-21 20:15:36 +0000 | [diff] [blame] | 523 | size_t pgoodFault = 0; |
Brandon Wyman | 2916ea5 | 2021-11-06 03:31:18 +0000 | [diff] [blame] | 524 | |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 525 | /** |
| 526 | * @brief Power Supply Kill fault. |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 527 | * |
| 528 | * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use |
| 529 | * bit 4 to indicate this fault. Considered faulted if it reaches |
| 530 | * DEGLITCH_LIMIT. |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 531 | */ |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 532 | size_t psKillFault = 0; |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 533 | |
| 534 | /** |
| 535 | * @brief Power Supply 12Vcs fault (standby power). |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 536 | * |
| 537 | * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use |
| 538 | * bit 6 to indicate this fault. Considered faulted if it reaches |
| 539 | * DEGLITCH_LIMIT. |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 540 | */ |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 541 | size_t ps12VcsFault = 0; |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 542 | |
| 543 | /** |
| 544 | * @brief Power Supply Current-Share fault in 12V domain. |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 545 | * |
| 546 | * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use |
| 547 | * bit 7 to indicate this fault. Considered faulted if it reaches |
| 548 | * DEGLITCH_LIMIT. |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 549 | */ |
Brandon Wyman | c2906f4 | 2021-12-21 20:14:56 +0000 | [diff] [blame] | 550 | size_t psCS12VFault = 0; |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 551 | |
Brandon Wyman | f65c406 | 2020-08-19 13:15:53 -0500 | [diff] [blame] | 552 | /** @brief Count of the number of read failures. */ |
| 553 | size_t readFail = 0; |
| 554 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 555 | /** |
Brandon Wyman | c220343 | 2021-12-21 23:09:48 +0000 | [diff] [blame] | 556 | * @brief Examine STATUS_WORD for CML (communication, memory, logic fault). |
| 557 | */ |
| 558 | void analyzeCMLFault(); |
| 559 | |
| 560 | /** |
Brandon Wyman | e3b0bb0 | 2021-12-21 23:16:48 +0000 | [diff] [blame] | 561 | * @brief Examine STATUS_WORD for INPUT bit on. |
| 562 | * |
| 563 | * "An input voltage, input current, or input power fault or warning has |
| 564 | * occurred." |
| 565 | */ |
| 566 | void analyzeInputFault(); |
| 567 | |
| 568 | /** |
Brandon Wyman | c2c8713 | 2021-12-21 23:22:18 +0000 | [diff] [blame] | 569 | * @brief Examine STATUS_WORD for VOUT being set. |
| 570 | * |
| 571 | * If VOUT is on, "An output voltage fault or warning has occurred.", and |
| 572 | * VOUT_OV_FAULT is on, there is an output over-voltage fault. |
| 573 | */ |
| 574 | void analyzeVoutOVFault(); |
| 575 | |
Brandon Wyman | a00e730 | 2021-12-21 23:28:29 +0000 | [diff] [blame] | 576 | /* |
| 577 | * @brief Examine STATUS_WORD value read for IOUT_OC_FAULT. |
| 578 | * |
| 579 | * "An output overcurrent fault has occurred." If it is on, and fault not |
| 580 | * set, trace STATUS_WORD, STATUS_MFR_SPECIFIC, and STATUS_IOUT values. |
| 581 | */ |
| 582 | void analyzeIoutOCFault(); |
| 583 | |
Brandon Wyman | c2c8713 | 2021-12-21 23:22:18 +0000 | [diff] [blame] | 584 | /** |
Brandon Wyman | 0837878 | 2021-12-21 23:48:15 +0000 | [diff] [blame] | 585 | * @brief Examines STATUS_WORD value read to see if there is a UV fault. |
| 586 | * |
| 587 | * Checks if the VOUT bit is on, indicating "An output voltage fault or |
| 588 | * warning has occurred", if it is on, but VOUT_OV_FAULT is off, it is |
| 589 | * determined to be an indication of an output under-voltage fault. |
| 590 | */ |
| 591 | void analyzeVoutUVFault(); |
| 592 | |
| 593 | /** |
Brandon Wyman | d5d9a22 | 2021-12-21 23:59:05 +0000 | [diff] [blame] | 594 | * @brief Examine STATUS_WORD for the fan fault/warning bit. |
| 595 | * |
| 596 | * If fanFault is not on, trace that the bit now came on, include |
| 597 | * STATUS_WORD, STATUS_MFR_SPECIFIC, and STATUS_FANS_1_2 values as well, to |
| 598 | * help with understanding what may have caused it to be set. |
| 599 | */ |
| 600 | void analyzeFanFault(); |
| 601 | |
| 602 | /** |
Brandon Wyman | 52cb3f2 | 2021-12-21 23:02:47 +0000 | [diff] [blame] | 603 | * @brief Examine STATUS_WORD for temperature fault. |
| 604 | */ |
| 605 | void analyzeTemperatureFault(); |
| 606 | |
| 607 | /** |
Brandon Wyman | 993b554 | 2021-12-21 22:55:16 +0000 | [diff] [blame] | 608 | * @brief Examine STATUS_WORD for pgood or unit off faults. |
| 609 | */ |
| 610 | void analyzePgoodFault(); |
| 611 | |
| 612 | /** |
Brandon Wyman | 39ea02b | 2021-11-23 23:22:23 +0000 | [diff] [blame] | 613 | * @brief Determine possible manufacturer-specific faults from bits in |
| 614 | * STATUS_MFR. |
| 615 | * |
| 616 | * The bits in the STATUS_MFR_SPECIFIC command response have "Manufacturer |
| 617 | * Defined" meanings. Determine which faults, if any, are present based on |
| 618 | * the power supply (device driver) type. |
| 619 | */ |
| 620 | void determineMFRFault(); |
| 621 | |
| 622 | /** |
Brandon Wyman | 6c2ac39 | 2021-12-21 22:23:06 +0000 | [diff] [blame] | 623 | * @brief Examine STATUS_WORD value read for MFRSPECIFIC bit on. |
| 624 | * |
| 625 | * "A manufacturer specific fault or warning has occurred." |
| 626 | * |
| 627 | * If it is on, call the determineMFRFault() helper function to examine the |
| 628 | * value read from STATUS_MFR_SPECIFIC. |
| 629 | */ |
| 630 | void analyzeMFRFault(); |
| 631 | |
| 632 | /** |
Brandon Wyman | f087f47 | 2021-12-22 00:04:27 +0000 | [diff] [blame] | 633 | * @brief Analyzes the STATUS_WORD for a VIN_UV_FAULT indicator. |
| 634 | */ |
| 635 | void analyzeVinUVFault(); |
| 636 | |
| 637 | /** |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 638 | * @brief D-Bus path to use for this power supply's inventory status. |
| 639 | **/ |
| 640 | std::string inventoryPath; |
| 641 | |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 642 | /** |
| 643 | * @brief The libgpiod object for monitoring PSU presence |
| 644 | */ |
Adriana Kobylak | 3ca062a | 2021-10-20 15:27:23 +0000 | [diff] [blame] | 645 | std::unique_ptr<GPIOInterfaceBase> presenceGPIO = nullptr; |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 646 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 647 | /** @brief True if the power supply is present. */ |
| 648 | bool present = false; |
| 649 | |
Adriana Kobylak | 572a905 | 2021-03-30 15:58:07 +0000 | [diff] [blame] | 650 | /** @brief Power supply model name. */ |
| 651 | std::string modelName; |
| 652 | |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 653 | /** @brief D-Bus match variable used to subscribe to Present property |
| 654 | * changes. |
| 655 | **/ |
| 656 | std::unique_ptr<sdbusplus::bus::match_t> presentMatch; |
| 657 | |
| 658 | /** @brief D-Bus match variable used to subscribe for Present property |
| 659 | * interface added. |
| 660 | */ |
| 661 | std::unique_ptr<sdbusplus::bus::match_t> presentAddedMatch; |
| 662 | |
| 663 | /** |
Brandon Wyman | 8d19577 | 2020-01-27 15:03:51 -0600 | [diff] [blame] | 664 | * @brief Pointer to the PMBus interface |
| 665 | * |
| 666 | * Used to read or write to/from PMBus power supply devices. |
| 667 | */ |
Brandon Wyman | 9564e94 | 2020-11-10 14:01:42 -0600 | [diff] [blame] | 668 | std::unique_ptr<phosphor::pmbus::PMBusBase> pmbusIntf = nullptr; |
Brandon Wyman | 8d19577 | 2020-01-27 15:03:51 -0600 | [diff] [blame] | 669 | |
Brandon Wyman | c9efe41 | 2020-10-09 15:42:50 -0500 | [diff] [blame] | 670 | /** @brief Stored copy of the firmware version/revision string */ |
| 671 | std::string fwVersion; |
| 672 | |
Brandon Wyman | 8d19577 | 2020-01-27 15:03:51 -0600 | [diff] [blame] | 673 | /** |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 674 | * @brief The file system path used for binding the device driver. |
| 675 | */ |
| 676 | const std::filesystem::path bindPath; |
| 677 | |
| 678 | /* @brief The string to pass in for binding the device driver. */ |
| 679 | std::string bindDevice; |
| 680 | |
| 681 | /** |
Matt Spinler | 0975eaf | 2022-02-14 15:38:30 -0600 | [diff] [blame^] | 682 | * @brief The result of the most recent availability check |
| 683 | * |
| 684 | * Saved on the object so changes can be detected. |
| 685 | */ |
| 686 | bool available = false; |
| 687 | |
| 688 | /** |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 689 | * @brief Binds or unbinds the power supply device driver |
| 690 | * |
| 691 | * Called when a presence change is detected to either bind the device |
| 692 | * driver for the power supply when it is installed, or unbind the device |
| 693 | * driver when the power supply is removed. |
| 694 | * |
| 695 | * Writes <device> to <path>/bind (or unbind) |
| 696 | * |
| 697 | * @param present - when true, will bind the device driver |
| 698 | * when false, will unbind the device driver |
| 699 | */ |
| 700 | void bindOrUnbindDriver(bool present); |
| 701 | |
| 702 | /** |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 703 | * @brief Updates the presence status by querying D-Bus |
| 704 | * |
| 705 | * The D-Bus inventory properties for this power supply will be read to |
| 706 | * determine if the power supply is present or not and update this |
| 707 | * object's present member variable to reflect current status. |
| 708 | **/ |
| 709 | void updatePresence(); |
| 710 | |
| 711 | /** |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 712 | * @brief Updates the power supply presence by reading the GPIO line. |
| 713 | */ |
| 714 | void updatePresenceGPIO(); |
| 715 | |
| 716 | /** |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 717 | * @brief Callback for inventory property changes |
| 718 | * |
| 719 | * Process change of Present property for power supply. |
| 720 | * |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 721 | * This is used if we are watching the D-Bus properties instead of reading |
| 722 | * the GPIO presence line ourselves. |
| 723 | * |
Brandon Wyman | aed1f75 | 2019-11-25 18:10:52 -0600 | [diff] [blame] | 724 | * @param[in] msg - Data associated with Present change signal |
| 725 | **/ |
| 726 | void inventoryChanged(sdbusplus::message::message& msg); |
Brandon Wyman | 9a507db | 2021-02-25 16:15:22 -0600 | [diff] [blame] | 727 | |
| 728 | /** |
| 729 | * @brief Callback for inventory property added. |
| 730 | * |
| 731 | * Process add of the interface with the Present property for power supply. |
| 732 | * |
B. J. Wyman | 681b2a3 | 2021-04-20 22:31:22 +0000 | [diff] [blame] | 733 | * This is used if we are watching the D-Bus properties instead of reading |
| 734 | * the GPIO presence line ourselves. |
| 735 | * |
Brandon Wyman | 9a507db | 2021-02-25 16:15:22 -0600 | [diff] [blame] | 736 | * @param[in] msg - Data associated with Present add signal |
| 737 | **/ |
| 738 | void inventoryAdded(sdbusplus::message::message& msg); |
Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 739 | }; |
| 740 | |
| 741 | } // namespace phosphor::power::psu |