pseq: Add all the GPIO pin values in failure data

Add all the power sequencer pin values to the additional data in
failures. Refactor the GPIO isolation logic to use pins already read.
Only hold the pins open during the read.

Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: Ic9042b7d2b71e2332f8071b853aa1f21f90a5a3f
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.hpp b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
index 938d0a1..760b534 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.hpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
@@ -36,9 +36,9 @@
 
     /**
      * Create a device object for UCD90320 monitoring.
-     * @param[in] bus D-Bus bus object
-     * @param[in] i2cBus The bus number of the power sequencer device
-     * @param[in] i2cAddress The I2C address of the power sequencer device
+     * @param bus D-Bus bus object
+     * @param i2cBus The bus number of the power sequencer device
+     * @param i2cAddress The I2C address of the power sequencer device
      */
     UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
                     std::uint16_t i2cAddress);
@@ -54,11 +54,6 @@
 
   private:
     /**
-     * Set of GPIO lines to monitor in this UCD chip.
-     */
-    gpiod::line_bulk lines;
-
-    /**
      * The match to Entity Manager interfaces added.
      */
     sdbusplus::bus::match_t match;
@@ -91,13 +86,35 @@
      * types.
      * Throws an exception if an operating system error occurs while checking
      * for the existance of a file.
-     * @param[in] compatibleSystemTypes List of compatible system types
+     * @param compatibleSystemTypes List of compatible system types
      */
     void findConfigFile(const std::vector<std::string>& compatibleSystemTypes);
 
     /**
+     * Analyzes the device pins for errors when the device is known to be in an
+     * error state.
+     * @param message Message property of the error log entry
+     * @param additionalData AdditionalData property of the error log entry
+     */
+    void onFailureCheckPins(std::string& message,
+                            std::map<std::string, std::string>& additionalData);
+
+    /**
+     * Analyzes the device rails for errors when the device is known to be in an
+     * error state.
+     * @param message Message property of the error log entry
+     * @param additionalData AdditionalData property of the error log entry
+     * @param powerSupplyError The power supply error to log. A default
+     * std:string, i.e. empty string (""), is passed when there is no power
+     * supply error to log.
+     */
+    void onFailureCheckRails(std::string& message,
+                             std::map<std::string, std::string>& additionalData,
+                             const std::string& powerSupplyError);
+
+    /**
      * Parse the JSON configuration file.
-     * @param[in] pathName the path name
+     * @param pathName the path name
      */
     void parseConfigFile(const std::filesystem::path& pathName);
 
@@ -112,12 +129,6 @@
      * @return the register contents
      */
     uint16_t readStatusWord();
-
-    /**
-     * Set up GPIOs
-     * @param[in] offsets the list of pin offsets
-     */
-    void setUpGpio(const std::vector<unsigned int>& offsets);
 };
 
 } // namespace phosphor::power::sequencer