pseq: Setup UCD90320 device GPIOs
Setup GPIOs for UCD90320 device. GPIOs will be used for power good fault
isolation. Use libgpiod.
Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: I9c104e3fddcb1847a95f6fb67bf6c139745f2d0c
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.hpp b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
index d7b66ad..2453251 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.hpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
@@ -3,6 +3,7 @@
#include "pmbus.hpp"
#include "power_sequencer_monitor.hpp"
+#include <gpiod.hpp>
#include <sdbusplus/bus.hpp>
#include <sdbusplus/bus/match.hpp>
@@ -15,7 +16,7 @@
struct Pin
{
std::string name;
- int line;
+ unsigned int line;
};
/**
@@ -40,7 +41,7 @@
* @param[in] i2cAddress The I2C address of the power sequencer device
*/
UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
- const std::uint16_t i2cAddress);
+ std::uint16_t i2cAddress);
/**
* Callback function to handle interfacesAdded D-Bus signals
@@ -50,6 +51,11 @@
private:
/**
+ * Set of GPIO lines to monitor in this UCD chip.
+ */
+ gpiod::line_bulk lines;
+
+ /**
* The D-Bus bus object
*/
sdbusplus::bus::bus& bus;
@@ -96,6 +102,12 @@
* @param[in] pathName the path name
*/
void parseConfigFile(const std::filesystem::path& pathName);
+
+ /**
+ * Set up GPIOs
+ * @param[in] offsets the list of pin offsets
+ */
+ void setUpGpio(const std::vector<unsigned int>& offsets);
};
} // namespace phosphor::power::sequencer