Brandon Wyman | a0f33ce | 2019-10-17 18:32:29 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | namespace phosphor::power::psu |
| 4 | { |
| 5 | /** |
| 6 | * @class PowerSupply |
| 7 | * Represents a PMBus power supply device. |
| 8 | */ |
| 9 | class PowerSupply |
| 10 | { |
| 11 | public: |
| 12 | PowerSupply(); |
| 13 | PowerSupply(const PowerSupply&) = delete; |
| 14 | PowerSupply(PowerSupply&&) = delete; |
| 15 | PowerSupply& operator=(const PowerSupply&) = delete; |
| 16 | PowerSupply& operator=(PowerSupply&&) = delete; |
| 17 | ~PowerSupply() = default; |
| 18 | |
| 19 | /** |
| 20 | * Power supply specific function to analyze for faults/errors. |
| 21 | * |
| 22 | * Various PMBus status bits will be checked for fault conditions. |
| 23 | * If a certain fault bits are on, the appropriate error will be |
| 24 | * committed. |
| 25 | */ |
| 26 | void analyze() |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Write PMBus CLEAR_FAULTS |
| 32 | * |
| 33 | * This function will be called in various situations in order to clear |
| 34 | * any fault status bits that may have been set, in order to start over |
| 35 | * with a clean state. Presence changes and power state changes will |
| 36 | * want to clear any faults logged. |
| 37 | */ |
| 38 | void clearFaults() |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @brief Adds properties to the inventory. |
| 44 | * |
| 45 | * Reads the values from the device and writes them to the |
| 46 | * associated power supply D-Bus inventory object. |
| 47 | * |
| 48 | * This needs to be done on startup, and each time the presence |
| 49 | * state changes. |
| 50 | * |
| 51 | * Properties added: |
| 52 | * - Serial Number |
| 53 | * - Part Number |
| 54 | * - CCIN (Customer Card Identification Number) - added as the Model |
| 55 | * - Firmware version |
| 56 | */ |
| 57 | void updateInventory() |
| 58 | { |
| 59 | } |
| 60 | |
| 61 | private: |
| 62 | /** @brief True if a fault has already been found and not cleared */ |
| 63 | bool faultFound = false; |
| 64 | }; |
| 65 | |
| 66 | } // namespace phosphor::power::psu |