blob: ce6af9731a4bc7ab0e7262a1063a73f98afdec75 [file] [log] [blame]
Jim Wright7945dd22021-04-06 16:55:15 -05001#pragma once
2
3#include "pmbus.hpp"
4#include "power_sequencer_monitor.hpp"
5
6#include <sdbusplus/bus.hpp>
Jim Wright56ae78e2021-12-01 14:46:15 -06007#include <sdbusplus/bus/match.hpp>
Jim Wright7945dd22021-04-06 16:55:15 -05008
9namespace phosphor::power::sequencer
10{
11
12/**
13 * @class UCD90320Monitor
14 * This class implements fault analysis for the UCD90320
15 * power sequencer device.
16 */
17class 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 Wright56ae78e2021-12-01 14:46:15 -060036 /**
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 Wright7945dd22021-04-06 16:55:15 -050042 private:
43 /**
44 * The D-Bus bus object
45 */
46 sdbusplus::bus::bus& bus;
47
48 /**
Jim Wright56ae78e2021-12-01 14:46:15 -060049 * The match to Entity Manager interfaces added.
50 */
51 sdbusplus::bus::match_t match;
52
53 /**
Jim Wright7945dd22021-04-06 16:55:15 -050054 * The read/write interface to this hardware
55 */
Jim Wright56ae78e2021-12-01 14:46:15 -060056 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 Wright7945dd22021-04-06 16:55:15 -050064};
65
66} // namespace phosphor::power::sequencer