blob: ec1290ed433033446fae673b28494f0ec1f6da82 [file] [log] [blame]
Brandon Wymana0f33ce2019-10-17 18:32:29 -05001#pragma once
2
Brandon Wymanc3324422022-03-24 20:30:57 +00003#include "average.hpp"
4#include "maximum.hpp"
Brandon Wyman8d195772020-01-27 15:03:51 -06005#include "pmbus.hpp"
Brandon Wymanc3324422022-03-24 20:30:57 +00006#include "record_manager.hpp"
Brandon Wymanaed1f752019-11-25 18:10:52 -06007#include "types.hpp"
B. J. Wyman681b2a32021-04-20 22:31:22 +00008#include "util.hpp"
Brandon Wyman3f1242f2020-01-28 13:11:25 -06009#include "utility.hpp"
Brandon Wymanaed1f752019-11-25 18:10:52 -060010
B. J. Wyman681b2a32021-04-20 22:31:22 +000011#include <gpiod.hpp>
Brandon Wymanaed1f752019-11-25 18:10:52 -060012#include <sdbusplus/bus/match.hpp>
Matt Spinler592bd272023-08-30 11:00:01 -050013#include <xyz/openbmc_project/Association/Definitions/server.hpp>
Matt Spinlera068f422023-03-10 13:06:49 -060014#include <xyz/openbmc_project/Sensor/Value/server.hpp>
Matt Spinler592bd272023-08-30 11:00:01 -050015#include <xyz/openbmc_project/State/Decorator/Availability/server.hpp>
16#include <xyz/openbmc_project/State/Decorator/OperationalStatus/server.hpp>
Brandon Wymanaed1f752019-11-25 18:10:52 -060017
B. J. Wyman681b2a32021-04-20 22:31:22 +000018#include <filesystem>
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050019#include <stdexcept>
20
Brandon Wymana0f33ce2019-10-17 18:32:29 -050021namespace phosphor::power::psu
22{
Brandon Wyman3f1242f2020-01-28 13:11:25 -060023
Chanh Nguyenc12c53b2021-04-06 17:24:47 +070024#if IBM_VPD
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050025// PMBus device driver "file name" to read for CCIN value.
26constexpr auto CCIN = "ccin";
Matt Spinlerb40f04c2023-03-20 11:07:44 -050027constexpr auto PART_NUMBER = "mfr_revision";
28constexpr auto FRU_NUMBER = "mfr_model";
29constexpr auto SERIAL_HEADER = "mfr_location";
30constexpr auto SERIAL_NUMBER = "mfr_serial";
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050031constexpr auto FW_VERSION = "fw_version";
32
33// The D-Bus property name to update with the CCIN value.
34constexpr auto MODEL_PROP = "Model";
35constexpr auto PN_PROP = "PartNumber";
Brandon Wymana169b0f2021-12-07 20:18:06 +000036constexpr auto SPARE_PN_PROP = "SparePartNumber";
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050037constexpr auto SN_PROP = "SerialNumber";
38constexpr auto VERSION_PROP = "Version";
39
40// ipzVPD Keyword sizes
41static constexpr auto FL_KW_SIZE = 20;
Brandon Wyman8393f462022-06-28 16:06:46 +000042static constexpr auto FN_KW_SIZE = 7;
43static constexpr auto PN_KW_SIZE = 7;
44// For IBM power supplies, the SN is 6-byte header + 6-byte serial.
45static constexpr auto SN_KW_SIZE = 12;
46static constexpr auto CC_KW_SIZE = 4;
Brandon Wyman1d7a7df2020-03-26 10:14:05 -050047#endif
48
Brandon Wymanf65c4062020-08-19 13:15:53 -050049constexpr auto LOG_LIMIT = 3;
Brandon Wyman06ca4592021-12-06 22:52:23 +000050constexpr auto DEGLITCH_LIMIT = 3;
Brandon Wyman6d469fd2022-06-15 16:58:21 +000051constexpr auto PGOOD_DEGLITCH_LIMIT = 5;
Jim Wright4ab86562022-11-18 14:05:46 -060052// Number of polls to remember that an AC fault occured. Should remain greater
53// than PGOOD_DEGLITCH_LIMIT.
54constexpr auto AC_FAULT_LIMIT = 6;
Brandon Wymanf65c4062020-08-19 13:15:53 -050055
Faisal Awadab66ae502023-04-01 18:30:32 -050056constexpr auto IBMCFFPS_DD_NAME = "ibm-cffps";
Faisal Awada9582d9c2023-07-11 09:31:22 -050057constexpr auto ACBEL_FSG032_DD_NAME = "acbel-fsg032";
Faisal Awadab66ae502023-04-01 18:30:32 -050058
Matt Spinler592bd272023-08-30 11:00:01 -050059using AvailabilityInterface =
60 sdbusplus::xyz::openbmc_project::State::Decorator::server::Availability;
61using OperationalStatusInterface = sdbusplus::xyz::openbmc_project::State::
62 Decorator::server::OperationalStatus;
63using AssocDefInterface =
64 sdbusplus::xyz::openbmc_project::Association::server::Definitions;
Matt Spinlera068f422023-03-10 13:06:49 -060065using SensorInterface = sdbusplus::xyz::openbmc_project::Sensor::server::Value;
66using SensorObject = sdbusplus::server::object_t<SensorInterface>;
Matt Spinler592bd272023-08-30 11:00:01 -050067using PowerSensorObject =
68 sdbusplus::server::object_t<SensorInterface, OperationalStatusInterface,
69 AvailabilityInterface, AssocDefInterface>;
70
71using AssociationTuple = std::tuple<std::string, std::string, std::string>;
Matt Spinlera068f422023-03-10 13:06:49 -060072
Brandon Wymana0f33ce2019-10-17 18:32:29 -050073/**
74 * @class PowerSupply
75 * Represents a PMBus power supply device.
76 */
77class PowerSupply
78{
79 public:
Brandon Wymanaed1f752019-11-25 18:10:52 -060080 PowerSupply() = delete;
Brandon Wymana0f33ce2019-10-17 18:32:29 -050081 PowerSupply(const PowerSupply&) = delete;
82 PowerSupply(PowerSupply&&) = delete;
83 PowerSupply& operator=(const PowerSupply&) = delete;
84 PowerSupply& operator=(PowerSupply&&) = delete;
85 ~PowerSupply() = default;
86
87 /**
Brandon Wymanc63941c2020-01-27 16:49:33 -060088 * @param[in] invpath - String for inventory path to use
89 * @param[in] i2cbus - The bus number this power supply is on
90 * @param[in] i2caddr - The 16-bit I2C address of the power supply
Brandon Wymanc3324422022-03-24 20:30:57 +000091 * @param[in] driver - i2c driver name for power supply
B. J. Wyman681b2a32021-04-20 22:31:22 +000092 * @param[in] gpioLineName - The gpio-line-name to read for presence. See
93 * https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md
George Liu9464c422023-02-27 14:30:27 +080094 * @param[in] callback - Get the power on status of the psu manager class
Brandon Wymanaed1f752019-11-25 18:10:52 -060095 */
Patrick Williams7354ce62022-07-22 19:26:56 -050096 PowerSupply(sdbusplus::bus_t& bus, const std::string& invpath,
B. J. Wyman681b2a32021-04-20 22:31:22 +000097 std::uint8_t i2cbus, const std::uint16_t i2caddr,
George Liu9464c422023-02-27 14:30:27 +080098 const std::string& driver, const std::string& gpioLineName,
99 std::function<bool()>&& callback);
Brandon Wymanaed1f752019-11-25 18:10:52 -0600100
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600101 phosphor::pmbus::PMBusBase& getPMBus()
102 {
103 return *pmbusIntf;
104 }
105
Adriana Kobylak3ca062a2021-10-20 15:27:23 +0000106 GPIOInterfaceBase* getPresenceGPIO()
B. J. Wyman681b2a32021-04-20 22:31:22 +0000107 {
108 return presenceGPIO.get();
109 }
110
B. J. Wymand8b8cb12021-07-15 22:03:34 +0000111 std::string getPresenceGPIOName() const
112 {
113 if (presenceGPIO != nullptr)
114 {
115 return presenceGPIO->getName();
116 }
117 else
118 {
119 return std::string();
120 }
121 }
122
Brandon Wymanaed1f752019-11-25 18:10:52 -0600123 /**
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500124 * Power supply specific function to analyze for faults/errors.
125 *
126 * Various PMBus status bits will be checked for fault conditions.
127 * If a certain fault bits are on, the appropriate error will be
128 * committed.
129 */
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600130 void analyze();
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500131
132 /**
Brandon Wyman59a35792020-06-04 12:37:40 -0500133 * Write PMBus ON_OFF_CONFIG
134 *
135 * This function will be called to cause the PMBus device driver to send the
136 * ON_OFF_CONFIG command. Takes one byte of data.
137 *
138 * @param[in] data - The ON_OFF_CONFIG data byte mask.
139 */
140 void onOffConfig(uint8_t data);
141
142 /**
Brandon Wymane3f7ad22021-12-21 20:27:45 +0000143 * Clears all the member variables that indicate if a fault bit was seen as
144 * on in the STATUS_WORD or STATUS_MFR_SPECIFIC response.
145 */
146 void clearFaultFlags()
147 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000148 inputFault = 0;
149 mfrFault = 0;
Brandon Wymane3f7ad22021-12-21 20:27:45 +0000150 statusMFR = 0;
Brandon Wymanc2906f42021-12-21 20:14:56 +0000151 vinUVFault = 0;
152 cmlFault = 0;
153 voutOVFault = 0;
154 ioutOCFault = 0;
155 voutUVFault = 0;
156 fanFault = 0;
157 tempFault = 0;
Brandon Wymane3f7ad22021-12-21 20:27:45 +0000158 pgoodFault = 0;
Brandon Wymanc2906f42021-12-21 20:14:56 +0000159 psKillFault = 0;
160 ps12VcsFault = 0;
161 psCS12VFault = 0;
Brandon Wymanba6d9602022-05-02 18:10:47 +0000162 faultLogged = false;
Brandon Wymane3f7ad22021-12-21 20:27:45 +0000163 }
164
165 /**
Brandon Wyman3225a452022-03-18 18:51:49 +0000166 * @brief Function to specifically clear VIN_UV/OFF fault(s).
167 *
168 * The PMBus HWMON device driver has various alarm "files" to read out of
169 * sysfs. Reading those files will indicate if various alarms are active or
170 * not, and then specifically clear those faults that go with that alarm.
171 *
172 * The VIN_UV fault, indicated in STATUS_INPUT, goes with in1_lcrit_alarm.
173 * When a VIN_UV fault occurs, the "Unit Off For Insufficient Input Voltage"
174 * may also be active. Reading in1_lcrit_alarm should clear both fault bits,
175 * resulting in the corresponding fault bits in STATUS_WORD also clearing.
176 *
177 * See: https://www.kernel.org/doc/html/latest/hwmon/pmbus.html
178 */
179 void clearVinUVFault();
180
181 /**
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500182 * Write PMBus CLEAR_FAULTS
183 *
184 * This function will be called in various situations in order to clear
185 * any fault status bits that may have been set, in order to start over
186 * with a clean state. Presence changes and power state changes will
187 * want to clear any faults logged.
188 */
Brandon Wyman3c208462020-05-13 16:25:58 -0500189 void clearFaults();
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500190
191 /**
192 * @brief Adds properties to the inventory.
193 *
194 * Reads the values from the device and writes them to the
195 * associated power supply D-Bus inventory object.
196 *
197 * This needs to be done on startup, and each time the presence
198 * state changes.
199 *
200 * Properties added:
201 * - Serial Number
202 * - Part Number
203 * - CCIN (Customer Card Identification Number) - added as the Model
204 * - Firmware version
205 */
Brandon Wyman1d7a7df2020-03-26 10:14:05 -0500206 void updateInventory();
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500207
Brandon Wymanaed1f752019-11-25 18:10:52 -0600208 /**
209 * @brief Accessor function to indicate present status
210 */
211 bool isPresent() const
212 {
213 return present;
214 }
215
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600216 /**
Brandon Wymanfed0ba22020-09-26 20:02:51 -0500217 * @brief Returns the last read value from STATUS_WORD.
218 */
219 uint64_t getStatusWord() const
220 {
221 return statusWord;
222 }
223
224 /**
Brandon Wymanf07bc792021-10-12 19:00:35 +0000225 * @brief Returns the last read value from STATUS_INPUT.
226 */
227 uint64_t getStatusInput() const
228 {
229 return statusInput;
230 }
231
232 /**
Jay Meyer10d94052020-11-30 14:41:21 -0600233 * @brief Returns the last read value from STATUS_MFR.
234 */
235 uint64_t getMFRFault() const
236 {
237 return statusMFR;
238 }
239
240 /**
Brandon Wyman85c7bf42021-10-19 22:28:48 +0000241 * @brief Returns the last read value from STATUS_CML.
242 */
243 uint64_t getStatusCML() const
244 {
245 return statusCML;
246 }
247
248 /**
Brandon Wyman6710ba22021-10-27 17:39:31 +0000249 * @brief Returns the last read value from STATUS_VOUT.
250 */
251 uint64_t getStatusVout() const
252 {
253 return statusVout;
254 }
255
256 /**
Brandon Wymanb10b3be2021-11-09 22:12:15 +0000257 * @brief Returns the last value read from STATUS_IOUT.
258 */
259 uint64_t getStatusIout() const
260 {
261 return statusIout;
262 }
263
264 /**
Brandon Wyman7ee4d7e2021-11-19 20:48:23 +0000265 * @brief Returns the last value read from STATUS_FANS_1_2.
266 */
267 uint64_t getStatusFans12() const
268 {
269 return statusFans12;
270 }
271
272 /**
Brandon Wyman96893a42021-11-05 19:56:57 +0000273 * @brief Returns the last value read from STATUS_TEMPERATURE.
274 */
275 uint64_t getStatusTemperature() const
276 {
277 return statusTemperature;
278 }
279
280 /**
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600281 * @brief Returns true if a fault was found.
282 */
283 bool isFaulted() const
284 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000285 return (hasCommFault() || (vinUVFault >= DEGLITCH_LIMIT) ||
286 (inputFault >= DEGLITCH_LIMIT) ||
287 (voutOVFault >= DEGLITCH_LIMIT) ||
288 (ioutOCFault >= DEGLITCH_LIMIT) ||
289 (voutUVFault >= DEGLITCH_LIMIT) ||
290 (fanFault >= DEGLITCH_LIMIT) || (tempFault >= DEGLITCH_LIMIT) ||
Brandon Wyman6d469fd2022-06-15 16:58:21 +0000291 (pgoodFault >= PGOOD_DEGLITCH_LIMIT) ||
292 (mfrFault >= DEGLITCH_LIMIT));
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600293 }
294
295 /**
Brandon Wymanb76ab242020-09-16 18:06:06 -0500296 * @brief Return whether a fault has been logged for this power supply
297 */
298 bool isFaultLogged() const
299 {
300 return faultLogged;
301 }
302
303 /**
304 * @brief Called when a fault for this power supply has been logged.
305 */
306 void setFaultLogged()
307 {
308 faultLogged = true;
309 }
310
311 /**
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600312 * @brief Returns true if INPUT fault occurred.
313 */
314 bool hasInputFault() const
315 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000316 return (inputFault >= DEGLITCH_LIMIT);
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600317 }
318
319 /**
320 * @brief Returns true if MFRSPECIFIC occurred.
321 */
322 bool hasMFRFault() const
323 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000324 return (mfrFault >= DEGLITCH_LIMIT);
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600325 }
326
327 /**
328 * @brief Returns true if VIN_UV_FAULT occurred.
329 */
330 bool hasVINUVFault() const
331 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000332 return (vinUVFault >= DEGLITCH_LIMIT);
Brandon Wyman3f1242f2020-01-28 13:11:25 -0600333 }
334
Brandon Wymanc9efe412020-10-09 15:42:50 -0500335 /**
Brandon Wyman6710ba22021-10-27 17:39:31 +0000336 * @brief Returns true if VOUT_OV_FAULT occurred.
337 */
338 bool hasVoutOVFault() const
339 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000340 return (voutOVFault >= DEGLITCH_LIMIT);
Brandon Wyman6710ba22021-10-27 17:39:31 +0000341 }
342
343 /**
Brandon Wymanb10b3be2021-11-09 22:12:15 +0000344 * @brief Returns true if IOUT_OC fault occurred (bit 4 STATUS_BYTE).
345 */
346 bool hasIoutOCFault() const
347 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000348 return (ioutOCFault >= DEGLITCH_LIMIT);
Brandon Wymanb10b3be2021-11-09 22:12:15 +0000349 }
350
351 /**
Brandon Wyman2cf46942021-10-28 19:09:16 +0000352 * @brief Returns true if VOUT_UV_FAULT occurred.
353 */
354 bool hasVoutUVFault() const
355 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000356 return (voutUVFault >= DEGLITCH_LIMIT);
Brandon Wyman2cf46942021-10-28 19:09:16 +0000357 }
358
359 /**
Brandon Wyman7ee4d7e2021-11-19 20:48:23 +0000360 *@brief Returns true if fan fault occurred.
361 */
362 bool hasFanFault() const
363 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000364 return (fanFault >= DEGLITCH_LIMIT);
Brandon Wyman7ee4d7e2021-11-19 20:48:23 +0000365 }
366
367 /**
Brandon Wyman96893a42021-11-05 19:56:57 +0000368 * @brief Returns true if TEMPERATURE fault occurred.
369 */
370 bool hasTempFault() const
371 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000372 return (tempFault >= DEGLITCH_LIMIT);
Brandon Wyman96893a42021-11-05 19:56:57 +0000373 }
374
375 /**
Brandon Wyman2916ea52021-11-06 03:31:18 +0000376 * @brief Returns true if there is a PGood fault (PGOOD# inactive, or OFF
377 * bit on).
378 */
379 bool hasPgoodFault() const
380 {
Brandon Wyman6d469fd2022-06-15 16:58:21 +0000381 return (pgoodFault >= PGOOD_DEGLITCH_LIMIT);
Brandon Wyman2916ea52021-11-06 03:31:18 +0000382 }
383
384 /**
Brandon Wyman39ea02b2021-11-23 23:22:23 +0000385 * @brief Return true if there is a PS_Kill fault.
386 */
387 bool hasPSKillFault() const
388 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000389 return (psKillFault >= DEGLITCH_LIMIT);
Brandon Wyman39ea02b2021-11-23 23:22:23 +0000390 }
391
392 /**
393 * @brief Returns true if there is a 12Vcs (standy power) fault.
394 */
395 bool hasPS12VcsFault() const
396 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000397 return (ps12VcsFault >= DEGLITCH_LIMIT);
Brandon Wyman39ea02b2021-11-23 23:22:23 +0000398 }
399
400 /**
401 * @brief Returns true if there is a 12V current-share fault.
402 */
403 bool hasPSCS12VFault() const
404 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000405 return (psCS12VFault >= DEGLITCH_LIMIT);
Brandon Wyman39ea02b2021-11-23 23:22:23 +0000406 }
407
408 /**
Jim Wright4ab86562022-11-18 14:05:46 -0600409 * @brief Returns true if an AC fault has occurred in the window of
410 * interest.
411 */
412 bool hasACFault() const
413 {
414 return acFault != 0;
415 }
416
417 /**
Brandon Wymanc9efe412020-10-09 15:42:50 -0500418 * @brief Returns the device path
419 *
420 * This can be used for error call outs.
421 * Example: /sys/bus/i2c/devices/3-0068
422 */
Brandon Wyman4176d6b2020-10-07 17:41:06 -0500423 const std::string getDevicePath() const
424 {
425 return pmbusIntf->path();
426 }
427
Brandon Wymanc9efe412020-10-09 15:42:50 -0500428 /**
Brandon Wyman321a6152022-03-19 00:11:44 +0000429 * @brief Returns this power supply's inventory path.
Brandon Wymanc9efe412020-10-09 15:42:50 -0500430 *
431 * This can be used for error call outs.
432 * Example:
433 * /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
434 */
Brandon Wyman7e495272020-09-26 19:57:46 -0500435 const std::string& getInventoryPath() const
436 {
437 return inventoryPath;
438 }
439
Brandon Wymanc9efe412020-10-09 15:42:50 -0500440 /**
Brandon Wyman321a6152022-03-19 00:11:44 +0000441 * @brief Returns the short name (last part of inventoryPath).
442 */
443 const std::string& getShortName() const
444 {
445 return shortName;
446 }
447
448 /**
Brandon Wymanc9efe412020-10-09 15:42:50 -0500449 * @brief Returns the firmware revision version read from the power supply
450 */
451 const std::string& getFWVersion() const
452 {
453 return fwVersion;
454 }
455
Adriana Kobylak572a9052021-03-30 15:58:07 +0000456 /**
457 * @brief Returns the model name of the power supply
458 */
459 const std::string& getModelName() const
460 {
461 return modelName;
462 }
463
Jim Wright15300242022-11-17 16:37:04 -0600464 /**
465 * @brief Returns true if the number of failed reads exceeds limit
Brandon Wymanf65c4062020-08-19 13:15:53 -0500466 * TODO: or CML bit on.
467 */
468 bool hasCommFault() const
469 {
Brandon Wymanc2906f42021-12-21 20:14:56 +0000470 return ((readFail >= LOG_LIMIT) || (cmlFault >= DEGLITCH_LIMIT));
Brandon Wymanf65c4062020-08-19 13:15:53 -0500471 }
472
Adriana Kobylak4175ffb2021-08-02 14:51:05 +0000473 /**
474 * @brief Reads the pmbus input voltage and returns that actual voltage
475 * reading and the calculated input voltage based on thresholds.
476 * @param[out] actualInputVoltage - The actual voltage reading, in Volts.
477 * @param[out] inputVoltage - A rounded up/down value of the actual input
478 * voltage based on thresholds, in Volts.
479 */
480 void getInputVoltage(double& actualInputVoltage, int& inputVoltage) const;
481
Matt Spinler0975eaf2022-02-14 15:38:30 -0600482 /**
483 * @brief Check if the PS is considered to be available or not
484 *
485 * It is unavailable if any of:
486 * - not present
487 * - input fault active
488 * - Vin UV fault active
489 * - PS KILL fault active
490 * - Iout OC fault active
491 *
492 * Other faults will, through creating error logs with callouts, already
493 * be setting the Functional property to false.
494 *
495 * On changes, the Available property is updated in the inventory.
496 */
497 void checkAvailability();
498
Brandon Wymanc3324422022-03-24 20:30:57 +0000499 /**
500 * @brief Setup for power supply input history.
501 *
502 * This will setup the variables and interfaces needed to get the power
503 * supply input history data over to D-Bus. The only known support for this
504 * at this time is the INPUT_HISTORY command implemented by the IBM Common
505 * Form Factor Power Suppplies (ibm-cffps). The INPUT_HISTORY command for
506 * ibm-cffps is implemented via a manufacturing specific PMBus command.
507 */
508 void setupInputHistory();
509
510 /**
511 * @brief Returns true if this power supply has input history (supported).
512 */
513 bool hasInputHistory() const
514 {
515 return inputHistorySupported;
516 }
517
518 /**
519 * @brief Returns the number of input history records
520 *
521 * PowerSupply wrapper to getNumRecords() from RecordManager.
522 */
523 size_t getNumInputHistoryRecords() const
524 {
525 if (recordManager)
526 {
527 return recordManager->getNumRecords();
528 }
529 else
530 {
531 return 0;
532 }
533 }
534
Brandon Wyman18a24d92022-04-19 22:48:34 +0000535 /**
536 * @brief Returns true when INPUT_HISTORY sync is required.
537 */
538 bool isSyncHistoryRequired() const
539 {
540 return syncHistoryRequired;
541 }
542
543 /**
544 * @brief Clears the indicator that sync required for INPUT_HISTORY.
545 *
546 * Sets variable to false to indicate that the sync is no longer required.
547 * This can be used after the PSUManager has reacted to the need for the
548 * INPUT_HISTORY data to be synchronized.
549 */
550 void clearSyncHistoryRequired()
551 {
552 syncHistoryRequired = false;
553 }
554
Matt Spinlera068f422023-03-10 13:06:49 -0600555 /**
556 * @brief Puts the input voltage rating on D-Bus.
557 *
558 * The rating is like 0, 110, 220.
559 */
560 void setInputVoltageRating();
561
Matt Spinler592bd272023-08-30 11:00:01 -0500562 /**
563 * @brief Returns the peak input power value if there is one,
564 * otherwise std::nullopt.
565 */
566 std::optional<double> getPeakInputPower() const
567 {
568 std::optional<double> value;
569 if (peakInputPowerSensor)
570 {
571 value = peakInputPowerSensor->value();
572 }
573 return value;
574 }
575
576 /**
577 * @brief Converts a Linear Format power number to an integer
578 *
579 * The PMBus spec describes a 2 byte Linear Format
580 * number that is composed of an exponent and mantissa
581 * in two's complement notation.
582 *
583 * Value = Mantissa * 2**Exponent
584 *
585 * @return double - The converted value
586 */
587 static double linearToInteger(uint16_t data);
588
Brandon Wymana0f33ce2019-10-17 18:32:29 -0500589 private:
Jim Wright15300242022-11-17 16:37:04 -0600590 /**
Matt Spinlerd6760262023-08-30 10:13:05 -0500591 * @brief Examine STATUS_WORD for CML (communication, memory, logic fault).
592 */
593 void analyzeCMLFault();
594
595 /**
596 * @brief Examine STATUS_WORD for INPUT bit on.
597 *
598 * "An input voltage, input current, or input power fault or warning has
599 * occurred."
600 */
601 void analyzeInputFault();
602
603 /**
604 * @brief Examine STATUS_WORD for VOUT being set.
605 *
606 * If VOUT is on, "An output voltage fault or warning has occurred.", and
607 * VOUT_OV_FAULT is on, there is an output over-voltage fault.
608 */
609 void analyzeVoutOVFault();
610
611 /**
612 * @brief Examine STATUS_WORD value read for IOUT_OC_FAULT.
613 *
614 * "An output overcurrent fault has occurred." If it is on, and fault not
615 * set, trace STATUS_WORD, STATUS_MFR_SPECIFIC, and STATUS_IOUT values.
616 */
617 void analyzeIoutOCFault();
618
619 /**
620 * @brief Examines STATUS_WORD value read to see if there is a UV fault.
621 *
622 * Checks if the VOUT bit is on, indicating "An output voltage fault or
623 * warning has occurred", if it is on, but VOUT_OV_FAULT is off, it is
624 * determined to be an indication of an output under-voltage fault.
625 */
626 void analyzeVoutUVFault();
627
628 /**
629 * @brief Examine STATUS_WORD for the fan fault/warning bit.
630 *
631 * If fanFault is not on, trace that the bit now came on, include
632 * STATUS_WORD, STATUS_MFR_SPECIFIC, and STATUS_FANS_1_2 values as well, to
633 * help with understanding what may have caused it to be set.
634 */
635 void analyzeFanFault();
636
637 /**
638 * @brief Examine STATUS_WORD for temperature fault.
639 */
640 void analyzeTemperatureFault();
641
642 /**
643 * @brief Examine STATUS_WORD for pgood or unit off faults.
644 */
645 void analyzePgoodFault();
646
647 /**
648 * @brief Determine possible manufacturer-specific faults from bits in
649 * STATUS_MFR.
650 *
651 * The bits in the STATUS_MFR_SPECIFIC command response have "Manufacturer
652 * Defined" meanings. Determine which faults, if any, are present based on
653 * the power supply (device driver) type.
654 */
655 void determineMFRFault();
656
657 /**
658 * @brief Examine STATUS_WORD value read for MFRSPECIFIC bit on.
659 *
660 * "A manufacturer specific fault or warning has occurred."
661 *
662 * If it is on, call the determineMFRFault() helper function to examine the
663 * value read from STATUS_MFR_SPECIFIC.
664 */
665 void analyzeMFRFault();
666
667 /**
668 * @brief Analyzes the STATUS_WORD for a VIN_UV_FAULT indicator.
669 */
670 void analyzeVinUVFault();
671
672 /**
673 * @brief Given a full inventory path, returns the last node of the path as
674 * the "short name"
675 */
676 std::string findShortName(const std::string& invPath)
677 {
678 const auto lastSlashPos = invPath.find_last_of('/');
679
680 if ((lastSlashPos == std::string::npos) ||
681 ((lastSlashPos + 1) == invPath.size()))
682 {
683 return invPath;
684 }
685 else
686 {
687 return invPath.substr(lastSlashPos + 1);
688 }
689 }
690
691 /**
692 * @brief Binds or unbinds the power supply device driver
693 *
694 * Called when a presence change is detected to either bind the device
695 * driver for the power supply when it is installed, or unbind the device
696 * driver when the power supply is removed.
697 *
698 * Writes <device> to <path>/bind (or unbind)
699 *
700 * @param present - when true, will bind the device driver
701 * when false, will unbind the device driver
702 */
703 void bindOrUnbindDriver(bool present);
704
705 /**
706 * @brief Updates the presence status by querying D-Bus
707 *
708 * The D-Bus inventory properties for this power supply will be read to
709 * determine if the power supply is present or not and update this
710 * object's present member variable to reflect current status.
711 **/
712 void updatePresence();
713
714 /**
715 * @brief Updates the power supply presence by reading the GPIO line.
716 */
717 void updatePresenceGPIO();
718
719 /**
720 * @brief Callback for inventory property changes
721 *
722 * Process change of Present property for power supply.
723 *
724 * This is used if we are watching the D-Bus properties instead of reading
725 * the GPIO presence line ourselves.
726 *
727 * @param[in] msg - Data associated with Present change signal
728 **/
729 void inventoryChanged(sdbusplus::message_t& msg);
730
731 /**
732 * @brief Callback for inventory property added.
733 *
734 * Process add of the interface with the Present property for power supply.
735 *
736 * This is used if we are watching the D-Bus properties instead of reading
737 * the GPIO presence line ourselves.
738 *
739 * @param[in] msg - Data associated with Present add signal
740 **/
741 void inventoryAdded(sdbusplus::message_t& msg);
742
743 /**
744 * @brief Reads the pmbus MFR_POUT_MAX value.
745 *
746 * "The MFR_POUT_MAX command sets or retrieves the maximum rated output
747 * power, in watts, that the unit is rated to supply."
748 *
749 * @return max_power_out value converted from string.
750 */
751 auto getMaxPowerOut() const;
752
753 /**
754 * @brief Reads a VPD value from PMBus, correct size, and contents.
755 *
756 * If the VPD data read is not the passed in size, resize and fill with
757 * spaces. If the data contains a non-alphanumeric value, replace any of
758 * those values with spaces.
759 *
760 * @param[in] vpdName - The name of the sysfs "file" to read data from.
761 * @param[in] type - The HWMON file type to read from.
762 * @param[in] vpdSize - The expacted size of the data for this VPD/property
763 *
764 * @return A string containing the VPD data read, resized if necessary
765 */
766 auto readVPDValue(const std::string& vpdName,
767 const phosphor::pmbus::Type& type,
768 const std::size_t& vpdSize);
769
770 /**
771 * @brief Reads the most recent input history record from the power supply
772 * and updates the average and maximum properties in D-Bus if there is a new
773 * reading available.
774 *
775 * This will still run every time analyze() is called so code can post new
776 * data as soon as possible and the timestamp will more accurately reflect
777 * the correct time.
778 *
779 * D-Bus is only updated if there is a change and the oldest record will be
780 * pruned if the property already contains the max number of records.
781 */
782 void updateHistory();
783
784 /**
785 * @brief Retrieve PSU VPD keyword from D-Bus
786 *
787 * It retrieves PSU VPD keyword from D-Bus and assign the associated
788 * string to vpdStr.
789 * @param[in] keyword - The VPD search keyword
790 * @param[out] vpdStr - The VPD string associated with the keyword.
791 */
792 void getPsuVpdFromDbus(const std::string& keyword, std::string& vpdStr);
793
794 /**
Matt Spinler592bd272023-08-30 11:00:01 -0500795 * @brief Creates the appropriate sensor D-Bus objects.
796 */
797 void setupSensors();
798
799 /**
800 * @brief Monitors sensor values and updates D-Bus.
801 * Called from analyze().
802 */
803 void monitorSensors();
804
805 /**
806 * @brief Creates the peak input power sensor D-Bus object
807 * if the PS supports it.
808 */
809 void setupInputPowerPeakSensor();
810
811 /**
812 * @brief Monitors the peak input power sensor
813 */
814 void monitorPeakInputPowerSensor();
815
816 /**
817 * @brief Sets any sensor objects to Available = false on D-Bus.
818 */
819 void setSensorsNotAvailable();
820
821 /**
822 * @brief Returns the associations to create for a sensor on this
823 * power supply.
824 */
825 std::vector<AssociationTuple> getSensorAssociations();
826
827 /**
Jim Wright15300242022-11-17 16:37:04 -0600828 * @brief systemd bus member
829 */
Patrick Williams7354ce62022-07-22 19:26:56 -0500830 sdbusplus::bus_t& bus;
Brandon Wymanaed1f752019-11-25 18:10:52 -0600831
Jim Wright15300242022-11-17 16:37:04 -0600832 /**
Matt Spinlerd6760262023-08-30 10:13:05 -0500833 * @brief D-Bus path to use for this power supply's inventory status.
834 **/
835 std::string inventoryPath;
836
837 /**
838 * @brief The file system path used for binding the device driver.
839 */
840 const std::filesystem::path bindPath;
841
842 /**
843 * @brief Get the power on status of the psu manager class.
844 *
845 * This is a callback method used to get the power on status of the psu
846 * manager class.
847 */
848 std::function<bool()> isPowerOn;
849
850 /**
851 * @brief Set to true if INPUT_HISTORY command supported.
852 *
853 * Not all power supplies will support the INPUT_HISTORY command. The IBM
854 * Common Form Factor power supplies do support this command.
855 */
856 bool inputHistorySupported{false};
857
858 /**
859 * @brief Set to true when INPUT_HISTORY sync is required.
860 *
861 * A power supply will need to synchronize its INPUT_HISTORY data with the
862 * other power supplies installed in the system when it goes from missing to
863 * present.
864 */
865 bool syncHistoryRequired{false};
866
867 /**
868 * @brief Store the short name to avoid string processing.
869 *
870 * The short name will be something like powersupply1, the last part of the
871 * inventoryPath.
872 */
873 std::string shortName;
874
875 /**
876 * @brief The libgpiod object for monitoring PSU presence
877 */
878 std::unique_ptr<GPIOInterfaceBase> presenceGPIO = nullptr;
879
880 /**
881 * @brief True if the power supply is present.
882 */
883 bool present = false;
884
885 /**
886 * @brief Power supply model name.
887 */
888 std::string modelName;
889
890 /**
891 * @brief D-Bus match variable used to subscribe to Present property
892 * changes.
893 **/
894 std::unique_ptr<sdbusplus::bus::match_t> presentMatch;
895
896 /**
897 * @brief D-Bus match variable used to subscribe for Present property
898 * interface added.
899 */
900 std::unique_ptr<sdbusplus::bus::match_t> presentAddedMatch;
901
902 /**
903 * @brief Pointer to the PMBus interface
904 *
905 * Used to read or write to/from PMBus power supply devices.
906 */
907 std::unique_ptr<phosphor::pmbus::PMBusBase> pmbusIntf = nullptr;
908
909 /**
910 * @brief Stored copy of the firmware version/revision string
911 */
912 std::string fwVersion;
913
914 /**
915 * @brief The string to pass in for binding the device driver.
916 */
917 std::string bindDevice;
918
919 /**
920 * @brief The result of the most recent availability check
921 *
922 * Saved on the object so changes can be detected.
923 */
924 bool available = false;
925
926 /**
Jim Wright15300242022-11-17 16:37:04 -0600927 * @brief Will be updated to the latest/lastvalue read from STATUS_WORD.
928 */
Brandon Wymanfed0ba22020-09-26 20:02:51 -0500929 uint64_t statusWord = 0;
930
Jim Wright15300242022-11-17 16:37:04 -0600931 /**
932 * @brief Will be set to the last read value of STATUS_WORD.
933 */
Brandon Wyman9e292ee2022-03-10 22:56:23 +0000934 uint64_t statusWordOld = 0;
935
Jim Wright15300242022-11-17 16:37:04 -0600936 /**
937 * @brief Will be updated to the latest/lastvalue read from STATUS_INPUT.
938 */
Brandon Wymanf07bc792021-10-12 19:00:35 +0000939 uint64_t statusInput = 0;
940
Jim Wright15300242022-11-17 16:37:04 -0600941 /**
942 * @brief Will be updated to the latest/lastvalue read from STATUS_MFR.
943 */
Jay Meyer10d94052020-11-30 14:41:21 -0600944 uint64_t statusMFR = 0;
945
Jim Wright15300242022-11-17 16:37:04 -0600946 /**
947 * @brief Will be updated to the latest/last value read from STATUS_CML.
948 */
Brandon Wyman85c7bf42021-10-19 22:28:48 +0000949 uint64_t statusCML = 0;
950
Jim Wright15300242022-11-17 16:37:04 -0600951 /**
952 * @brief Will be updated to the latest/last value read from STATUS_VOUT.
953 */
Brandon Wyman6710ba22021-10-27 17:39:31 +0000954 uint64_t statusVout = 0;
955
Jim Wright15300242022-11-17 16:37:04 -0600956 /**
957 * @brief Will be updated to the latest/last value read from STATUS_IOUT.
958 */
Brandon Wymanb10b3be2021-11-09 22:12:15 +0000959 uint64_t statusIout = 0;
960
Jim Wright15300242022-11-17 16:37:04 -0600961 /**
962 * @brief Will be updated to the latest/last value read from
963 * STATUS_FANS_1_2.
964 */
Brandon Wyman7ee4d7e2021-11-19 20:48:23 +0000965 uint64_t statusFans12 = 0;
966
Jim Wright15300242022-11-17 16:37:04 -0600967 /**
968 * @brief Will be updated to the latest/last value read from
969 * STATUS_TEMPERATURE.
970 */
Brandon Wyman96893a42021-11-05 19:56:57 +0000971 uint64_t statusTemperature = 0;
972
Jim Wright15300242022-11-17 16:37:04 -0600973 /**
974 * @brief Will be updated with latest converted value read from READ_VIN
975 */
Brandon Wyman82affd92021-11-24 19:12:49 +0000976 int inputVoltage = phosphor::pmbus::in_input::VIN_VOLTAGE_0;
977
Jim Wright15300242022-11-17 16:37:04 -0600978 /**
979 * @brief Will be updated with the actual voltage last read from READ_VIN
Brandon Wyman4fc191f2022-03-10 23:07:13 +0000980 */
981 double actualInputVoltage = 0;
982
Jim Wright15300242022-11-17 16:37:04 -0600983 /**
984 * @brief True if an error for a fault has already been logged.
985 */
Brandon Wymanb76ab242020-09-16 18:06:06 -0500986 bool faultLogged = false;
987
Jim Wright15300242022-11-17 16:37:04 -0600988 /**
989 * @brief Incremented if bit 1 of STATUS_WORD low byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +0000990 *
991 * Considered faulted if reaches DEGLITCH_LIMIT.
992 */
993 size_t cmlFault = 0;
Brandon Wyman85c7bf42021-10-19 22:28:48 +0000994
Jim Wright15300242022-11-17 16:37:04 -0600995 /**
996 * @brief Incremented if bit 5 of STATUS_WORD high byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +0000997 *
998 * Considered faulted if reaches DEGLITCH_LIMIT.
999 */
1000 size_t inputFault = 0;
Brandon Wyman3f1242f2020-01-28 13:11:25 -06001001
Jim Wright15300242022-11-17 16:37:04 -06001002 /**
1003 * @brief Incremented if bit 4 of STATUS_WORD high byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001004 *
1005 * Considered faulted if reaches DEGLITCH_LIMIT.
1006 */
1007 size_t mfrFault = 0;
Brandon Wyman3f1242f2020-01-28 13:11:25 -06001008
Jim Wright15300242022-11-17 16:37:04 -06001009 /**
1010 * @brief Incremented if bit 3 of STATUS_WORD low byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001011 *
1012 * Considered faulted if reaches DEGLITCH_LIMIT.
1013 */
1014 size_t vinUVFault = 0;
Brandon Wyman3f1242f2020-01-28 13:11:25 -06001015
Jim Wright15300242022-11-17 16:37:04 -06001016 /**
1017 * @brief Incremented if bit 5 of STATUS_WORD low byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001018 *
1019 * Considered faulted if reaches DEGLITCH_LIMIT.
1020 */
1021 size_t voutOVFault = 0;
Brandon Wyman6710ba22021-10-27 17:39:31 +00001022
Jim Wright15300242022-11-17 16:37:04 -06001023 /**
1024 * @brief Incremented if bit 4 of STATUS_WORD low byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001025 *
1026 * Considered faulted if reaches DEGLITCH_LIMIT.
1027 */
1028 size_t ioutOCFault = 0;
Brandon Wymanb10b3be2021-11-09 22:12:15 +00001029
Jim Wright15300242022-11-17 16:37:04 -06001030 /**
1031 * @brief Incremented if bit 7 of STATUS_WORD high byte is on and bit 5
Brandon Wymanc2906f42021-12-21 20:14:56 +00001032 * (VOUT_OV) of low byte is off.
1033 *
1034 * Considered faulted if reaches DEGLITCH_LIMIT.
1035 */
1036 size_t voutUVFault = 0;
Brandon Wyman2cf46942021-10-28 19:09:16 +00001037
Jim Wright15300242022-11-17 16:37:04 -06001038 /**
1039 * @brief Incremented if FANS fault/warn bit on in STATUS_WORD.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001040 *
1041 * Considered faulted if reaches DEGLITCH_LIMIT.
1042 */
1043 size_t fanFault = 0;
Brandon Wyman7ee4d7e2021-11-19 20:48:23 +00001044
Jim Wright15300242022-11-17 16:37:04 -06001045 /**
1046 * @brief Incremented if bit 2 of STATUS_WORD low byte is on.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001047 *
Jim Wright15300242022-11-17 16:37:04 -06001048 * Considered faulted if reaches DEGLITCH_LIMIT.
1049 */
Brandon Wymanc2906f42021-12-21 20:14:56 +00001050 size_t tempFault = 0;
Brandon Wyman96893a42021-11-05 19:56:57 +00001051
Brandon Wyman2cf46942021-10-28 19:09:16 +00001052 /**
Brandon Wyman06ca4592021-12-06 22:52:23 +00001053 * @brief Incremented if bit 11 or 6 of STATUS_WORD is on. PGOOD# is
1054 * inactive, or the unit is off.
1055 *
1056 * Considered faulted if reaches DEGLITCH_LIMIT.
Brandon Wyman2916ea52021-11-06 03:31:18 +00001057 */
Brandon Wyman925c0262021-12-21 20:15:36 +00001058 size_t pgoodFault = 0;
Brandon Wyman2916ea52021-11-06 03:31:18 +00001059
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001060 /**
1061 * @brief Power Supply Kill fault.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001062 *
1063 * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use
1064 * bit 4 to indicate this fault. Considered faulted if it reaches
1065 * DEGLITCH_LIMIT.
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001066 */
Brandon Wymanc2906f42021-12-21 20:14:56 +00001067 size_t psKillFault = 0;
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001068
1069 /**
1070 * @brief Power Supply 12Vcs fault (standby power).
Brandon Wymanc2906f42021-12-21 20:14:56 +00001071 *
1072 * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use
1073 * bit 6 to indicate this fault. Considered faulted if it reaches
1074 * DEGLITCH_LIMIT.
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001075 */
Brandon Wymanc2906f42021-12-21 20:14:56 +00001076 size_t ps12VcsFault = 0;
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001077
1078 /**
1079 * @brief Power Supply Current-Share fault in 12V domain.
Brandon Wymanc2906f42021-12-21 20:14:56 +00001080 *
1081 * Incremented based on bits in STATUS_MFR_SPECIFIC. IBM power supplies use
1082 * bit 7 to indicate this fault. Considered faulted if it reaches
1083 * DEGLITCH_LIMIT.
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001084 */
Brandon Wymanc2906f42021-12-21 20:14:56 +00001085 size_t psCS12VFault = 0;
Brandon Wyman39ea02b2021-11-23 23:22:23 +00001086
Jim Wright15300242022-11-17 16:37:04 -06001087 /**
Jim Wright4ab86562022-11-18 14:05:46 -06001088 * @brief Set to AC_FAULT_LIMIT when AC fault is detected, decremented when
1089 * AC fault has cleared. Effectively forms a timer since last AC failure.
1090 * Zero indicates being outside the window of concern.
1091 */
1092 size_t acFault = 0;
1093
1094 /**
Jim Wright15300242022-11-17 16:37:04 -06001095 * @brief Count of the number of read failures.
1096 */
Brandon Wymanf65c4062020-08-19 13:15:53 -05001097 size_t readFail = 0;
1098
Brandon Wymanaed1f752019-11-25 18:10:52 -06001099 /**
Brandon Wymanc3324422022-03-24 20:30:57 +00001100 * @brief Class that manages the input power history records.
1101 **/
1102 std::unique_ptr<history::RecordManager> recordManager;
1103
1104 /**
1105 * @brief The D-Bus object for the average input power history
1106 **/
1107 std::unique_ptr<history::Average> average;
1108
1109 /**
1110 * @brief The D-Bus object for the maximum input power history
1111 **/
1112 std::unique_ptr<history::Maximum> maximum;
1113
1114 /**
1115 * @brief The base D-Bus object path to use for the average and maximum
1116 * objects.
1117 **/
1118 std::string historyObjectPath;
Matt Spinlera068f422023-03-10 13:06:49 -06001119
1120 /**
1121 * @brief The D-Bus object for the input voltage rating
1122 *
1123 * It is updated at startup and power on. If a power supply is
1124 * added or removed after that, it does not need to be updated
1125 * again (though that could be done as a future improvement).
1126 */
1127 std::unique_ptr<SensorObject> inputVoltageRatingIface;
Faisal Awadab66ae502023-04-01 18:30:32 -05001128
1129 /**
Matt Spinler592bd272023-08-30 11:00:01 -05001130 * @brief The D-Bus object for the peak input power sensor.
1131 */
1132 std::unique_ptr<PowerSensorObject> peakInputPowerSensor;
1133
1134 /**
Faisal Awadab66ae502023-04-01 18:30:32 -05001135 * @brief The device driver name
1136 */
1137 std::string driverName;
Brandon Wymana0f33ce2019-10-17 18:32:29 -05001138};
1139
1140} // namespace phosphor::power::psu