Jim Wright | 7945dd2 | 2021-04-06 16:55:15 -0500 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "pmbus.hpp" |
| 4 | #include "power_sequencer_monitor.hpp" |
| 5 | |
| 6 | #include <sdbusplus/bus.hpp> |
Jim Wright | 56ae78e | 2021-12-01 14:46:15 -0600 | [diff] [blame] | 7 | #include <sdbusplus/bus/match.hpp> |
Jim Wright | 7945dd2 | 2021-04-06 16:55:15 -0500 | [diff] [blame] | 8 | |
| 9 | namespace phosphor::power::sequencer |
| 10 | { |
| 11 | |
| 12 | /** |
| 13 | * @class UCD90320Monitor |
| 14 | * This class implements fault analysis for the UCD90320 |
| 15 | * power sequencer device. |
| 16 | */ |
| 17 | class UCD90320Monitor : public PowerSequencerMonitor |
| 18 | { |
| 19 | public: |
| 20 | UCD90320Monitor() = delete; |
| 21 | UCD90320Monitor(const UCD90320Monitor&) = delete; |
| 22 | UCD90320Monitor& operator=(const UCD90320Monitor&) = delete; |
| 23 | UCD90320Monitor(UCD90320Monitor&&) = delete; |
| 24 | UCD90320Monitor& operator=(UCD90320Monitor&&) = delete; |
| 25 | virtual ~UCD90320Monitor() = default; |
| 26 | |
| 27 | /** |
| 28 | * Create a device object for UCD90320 monitoring. |
| 29 | * @param[in] bus D-Bus bus object |
| 30 | * @param[in] i2cBus The bus number of the power sequencer device |
| 31 | * @param[in] i2cAddress The I2C address of the power sequencer device |
| 32 | */ |
| 33 | UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus, |
| 34 | const std::uint16_t i2cAddress); |
| 35 | |
Jim Wright | 56ae78e | 2021-12-01 14:46:15 -0600 | [diff] [blame] | 36 | /** |
| 37 | * Callback function to handle interfacesAdded D-Bus signals |
| 38 | * @param msg Expanded sdbusplus message data |
| 39 | */ |
| 40 | void interfacesAddedHandler(sdbusplus::message::message& msg); |
| 41 | |
Jim Wright | 7945dd2 | 2021-04-06 16:55:15 -0500 | [diff] [blame] | 42 | private: |
| 43 | /** |
| 44 | * The D-Bus bus object |
| 45 | */ |
| 46 | sdbusplus::bus::bus& bus; |
| 47 | |
| 48 | /** |
Jim Wright | 56ae78e | 2021-12-01 14:46:15 -0600 | [diff] [blame] | 49 | * The match to Entity Manager interfaces added. |
| 50 | */ |
| 51 | sdbusplus::bus::match_t match; |
| 52 | |
| 53 | /** |
Jim Wright | 7945dd2 | 2021-04-06 16:55:15 -0500 | [diff] [blame] | 54 | * The read/write interface to this hardware |
| 55 | */ |
Jim Wright | 56ae78e | 2021-12-01 14:46:15 -0600 | [diff] [blame] | 56 | pmbus::PMBus pmbusInterface; |
| 57 | |
| 58 | /** |
| 59 | * Finds the list of compatible system types using D-Bus methods. |
| 60 | * This list is used to find the correct JSON configuration file for the |
| 61 | * current system. |
| 62 | */ |
| 63 | void findCompatibleSystemTypes(); |
Jim Wright | 7945dd2 | 2021-04-06 16:55:15 -0500 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | } // namespace phosphor::power::sequencer |